Hi,

I've been playing with job_start to see what can be achieved with it, and I 
observe a crash with the following code on vim 7.4-1829 (compiled on an ubuntu 
x89_64 machine)

It seems related to the fact I use a dict function as callback.
I may no have the correct syntax, yet the crash is certainly not a correct 
behaviour.

The backtrace is:
------------ >% ------------
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7db26)[0x7f4aeaa83b26]
gvim[0x47d165]
gvim(dict_unref+0x2f)[0x47d1df]
gvim(partial_unref+0x5a)[0x47c24a]
gvim(channel_close+0x1a3)[0x5f64a3]
gvim(channel_parse_messages+0xf4)[0x5f7064]
gvim(parse_queued_messages+0x13)[0x50bd23]
gvim(gui_mch_wait_for_chars+0x3b)[0x5de07b]
gvim[0x5ce86b]
gvim(gui_wait_for_chars+0x87)[0x5d0647]
gvim(ui_inchar+0xe4)[0x5bda04]
gvim(inchar+0x12f)[0x4d3ccf]
gvim[0x4d5cc9]
gvim(vgetc+0x16d)[0x4d64bd]
gvim(safe_vgetc+0x9)[0x4d6859]
gvim(normal_cmd+0xed)[0x5217bd]
gvim(main_loop+0x375)[0x5fda15]
gvim(main+0x1474)[0x44c264]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f4aeaa2776d]
gvim[0x44d58d]
------------ >% ------------


and the (semi-minimalist) test program is the following
------------ >% ------------
" Attempt at non-interactive background compilation
"
" Compilation messages are analysed at the end of the compilation process

function! s:conclude(channel) abort
  echomsg "Compilation finished"
  exe 'cgetfile ' . s:buffer
endfunction

function! Build_comp(nb)
  let comp = {}

  " redundant version that crashes vim as well.
  function! comp.conclude(channel) dict abort
    echomsg "Compilation finished"
    exe 'cgetfile ' . self.buffer
  endfunction
  let comp.conclude = function('s:conclude')

  function! comp.init(nb) dict abort
    " let self.buffer = tempname()
    let s:buffer = tempname()
    " tests/lh/repeat-wait.sh prints stuff to stdout
    let self.job = job_start(['tests/repeat-wait.sh', a:nb],
          \ { 'out_io': 'file', 'out_name': s:buffer
          \ , 'close_cb': function('s:conclude', self)} )
    " let self.job = job_start(['tests/repeat-wait.sh', 2],
          " \ { 'out_io': 'file', 'out_name': self.buffer
          " \ , 'close_cb': function('self.conclude', self)} )
  endfunction
  
  return comp.init(a:nb)
endfunction
------------ >% ------------

-- 
Luc Hermitte

-- 
-- 
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