Ozaki Kiichi wrote:

> When giving list (or dict, some objects managed lifetime by copyID) to 
> partial to timer_start() 2nd argument, SEGV (or ABRT) may occur at timer 
> fires. 
> 
> [repro steps]
> 
> test.vim:
> 
> ```
> function Callback(lists, timer)
>   echo a:lists
> endfunction
> call timer_start(500, function('Callback', [['a']]))
> call garbagecollect()
> ```
> 
> vim -Nu NONE -S test.vim
> 
> and vim finishes by SEGV or ABRT.
> 
> 
> [cause]
> 
> The copyID of the object held by timer.tr_partial (['a'] of above)
> isn't be updated during GC process, so GC releases it and it becomes
> dangling pointer.
> 
> 
> [patch]
> 
> Add set_ref_in_timer() function:
> 
> https://gist.github.com/ichizok/b41ac7f68c3364a38bb07479bc9c7a49

Thanks!

-- 
`The Guide says there is an art to flying,' said Ford, `or at least a
knack. The knack lies in learning how to throw yourself at the ground
and miss.' He smiled weakly.
                -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui