On Sun, Oct 13, 2013 at 1:33 PM, glts <[email protected]> wrote:
> On Sun, Oct 13, 2013 at 11:15 AM, glts <[email protected]> wrote:
>> On Thu, Oct 3, 2013 at 12:40 AM, kans <[email protected]> wrote:
>>> I believe we have addressed all major concerns- the last one being the 
>>> ex_timers command which shows all pending timers.  If we have missed 
>>> something, or you have other concerns, please let us know.  As I wrote 
>>> before, we'd really like to see this feature in Vim.
>>
>> Second, do you know of existing plugins that rely on this patch, so that
>> we can grab it and try it out in our own settings without having to
>> write our own dummy plugins?
>
> Played around with this for a few minutes to see if I could implement
> one of the ideas upthread: show the date and time in the status line.
>
>         :call setinterval(200, "set stl=%{strftime('%c')}")
>
> doesn't work because the statusline is only updated when the cursor
> is moved, or on redraw.
>
>         :call setinterval(200, "set stl=%{strftime('%c')} | redraw")
>
> does work but constantly redraws the screen which causes flickering.
> Also, in this situation I would not be able to use :timers to diagnose
> the situation, because the redraw clears :timers output immediately. I'd
> be glad if you could show me what's wrong with my naive approach.
>
> Anyway, I think a working real-world example would really help to show
> what a plugin with timers can and can't do.

Played around some more and was rewarded with this:

Vim: Caught deadly signal SEGV
Segmentation fault (core dumped)
#0  call_timeouts (max_to_wait=max_to_wait@entry=71) at timers.c:100
#1  0x0000000000524aea in RealWaitForChar (fd=0, msec=71,
msec@entry=4000, check_for_gpm=0x0) at os_unix.c:5285
#2  0x0000000000524f9c in WaitForChar (msec=4000) at os_unix.c:5022
#3  WaitForChar (msec=<optimized out>) at os_unix.c:4973
#4  0x0000000000525f19 in mch_inchar (buf=buf@entry=0x876434
<typebuf_init+84> "", maxlen=maxlen@entry=60, wtime=wtime@entry=-1,
    tb_change_cnt=tb_change_cnt@entry=91) at os_unix.c:413
#5  0x000000000059e660 in ui_inchar (buf=buf@entry=0x876434
<typebuf_init+84> "", maxlen=60, wtime=wtime@entry=-1,
    tb_change_cnt=tb_change_cnt@entry=91) at ui.c:199
#6  0x00000000004ba18f in inchar (buf=0x876434 <typebuf_init+84> "",
maxlen=180, wait_time=-1, tb_change_cnt=91) at getchar.c:3039
#7  0x00000000004bc114 in vgetorpeek (advance=1) at getchar.c:2814
#8  vgetorpeek (advance=1) at getchar.c:1918
#9  0x00000000004bce76 in vgetc () at getchar.c:1590
#10 0x00000000004bd2d9 in safe_vgetc () at getchar.c:1795
#11 0x0000000000504770 in normal_cmd (oap=oap@entry=0x7fffffffe030,
toplevel=toplevel@entry=1) at normal.c:666
#12 0x00000000005e005d in main_loop (cmdwin=cmdwin@entry=0,
noexmode=noexmode@entry=0) at main.c:1329
#13 0x000000000043add7 in main (argc=<optimized out>, argv=<optimized
out>) at main.c:1020

I used the following toy code, the idea being: write the buffer to a
temp file and let an external tool do work on it. Communication happens
via a lock file created by the external component; the timed command
keeps polling for the lock file until it disappears.

        function! DispatchWorker()
          silent write !cat > testfile
          call system('./work.sh &')
          let g:worker_id = setinterval(300, 'call PollWorker()')
        endfunction

        function! PollWorker()
          if !filereadable('.lock')
            call canceltimeout(g:worker_id)
            echo "Job done!"
          endif
        endfunction

        command! Go call DispatchWorker()

The segfault happens on the call to canceltimeout().

I won't have time to look into this more today, so I'm just leaving the
report here.

-- 
-- 
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/groups/opt_out.

Raspunde prin e-mail lui