Hi list,

Some days ago Ben Fritz CC'ed me from the "Generating html documentation with hlink to jump easily" thread on vim_use [1] asking me to verify that my publish plug-in [2] still works with 2html.vim after the recent changes to 2html.vim.

So I tried it out and, while running the 2html script, Vim died with a SIGSEGV signal. Since then I spent far too much time [3] learning how to compile Vim with debugging symbols so that GDB would give me a useful backtrace. I finally succeeded and got the attached backtrace `bt.txt'. Because I don't have any experience in debugging Vim and/or using GDB I'm now at a loss on how to continue debugging this issue. If there is any more information I can extract from GDB or if there's something else I can do to help others reproduce this issue please let me know.

Note that `PublishTest()' (referenced in `bt.txt') isn't defined in my publish plug-in; it's defined in my ~/.vimrc and does basically the same thing that the first Vim script snippet on [2] does. The main difference is that it publishes 20 files instead of 4, except that those files still aren't published because Vim keeps crashing :-). I don't think the crash is related to which files are published...

 - Peter Odding

[1] http://groups.google.com/group/vim_use/browse_thread/thread/54c88aba79f8b42e/

[2] http://peterodding.com/code/vim/publish/

[3] I followed the instructions in :help debug.txt but didn't realize that enabling "-g" doesn't disable "strip", which means Vim is first compiled with debugging symbols but then the debugging symbols are stripped before /usr/local/bin/vim is installed :-(. Maybe debug.txt should be corrected as in the attached "debug-help-entry-fix.diff"?!
gdb --args /usr/local/bin/gvim -fc 'call PublishTest()'
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/bin/gvim...done.
(gdb) r
Starting program: /usr/local/bin/gvim -fc call\ PublishTest\(\)
[Thread debugging using libthread_db enabled]

(gvim:5584): GLib-WARNING **: g_set_prgname() called multiple times

Program received signal SIGSEGV, Segmentation fault.
0x0000000000564107 in regmatch (scan=0xd5ea2a "\003") at regexp.c:4730
4730                    if (OP(next) != BRANCH) /* No choice. */
(gdb) bt
#0  0x0000000000564107 in regmatch (scan=0xd5ea2a "\003") at regexp.c:4730
#1  0x0000000000561c50 in regtry (prog=0xd5ea10, col=0) at regexp.c:3711
#2  0x0000000000561a17 in vim_regexec_both (line=0xcb9ae3 "\" Vim script", 
col=0, tm=0x0) at regexp.c:3600
#3  0x00000000005614a4 in vim_regexec_multi (rmp=0x7fffffffa3f0, win=0x8a00b0, 
buf=0x8a1990, lnum=1, col=0, tm=0x0) at regexp.c:3410
#4  0x00000000005af95d in syn_regexec (rmp=0x7fffffffa3f0, lnum=1, col=0) at 
syntax.c:3223
#5  0x00000000005ad536 in syn_current_attr (syncing=0, displaying=1, 
can_spell=0x0, keep_state=0) at syntax.c:2058
#6  0x00000000005ace3d in get_syntax_attr (col=0, can_spell=0x0, keep_state=0) 
at syntax.c:1817
#7  0x000000000056fd9c in win_line (wp=0x8a00b0, lnum=1, startrow=0, endrow=1, 
nochange=0) at screen.c:4074
#8  0x0000000000568b70 in update_single_line (wp=0x8a00b0, lnum=1) at 
screen.c:658
#9  0x00000000005da506 in win_goto (wp=0x8a00b0) at window.c:3911
#10 0x00000000005d4707 in do_window (nchar=119, Prenum=0, xchar=0) at 
window.c:288
#11 0x000000000049ec1a in ex_wincmd (eap=0x7fffffffac00) at ex_docmd.c:8202
#12 0x000000000049578c in do_one_cmd (cmdlinep=0x7fffffffae48, sourcing=1, 
cstack=0x7fffffffae80, fgetline=0x4910e1 <getsourceline>, cookie=0x7fffffffbbf0)
    at ex_docmd.c:2656
#13 0x0000000000492d5d in do_cmdline (cmdline=0xf27780 "2wincmd w", 
getline=0x4910e1 <getsourceline>, cookie=0x7fffffffbbf0, flags=3) at 
ex_docmd.c:1122
#14 0x00000000004788cc in ex_execute (eap=0x7fffffffb400) at eval.c:20246
#15 0x000000000049578c in do_one_cmd (cmdlinep=0x7fffffffb648, sourcing=1, 
cstack=0x7fffffffb680, fgetline=0x4910e1 <getsourceline>, cookie=0x7fffffffbbf0)
    at ex_docmd.c:2656
#16 0x0000000000492d5d in do_cmdline (cmdline=0xcdbb70 "\" Vim syntax support 
file", getline=0x4910e1 <getsourceline>, cookie=0x7fffffffbbf0, flags=7)
    at ex_docmd.c:1122
#17 0x0000000000490d39 in do_source (fname=0xddef10 
"/usr/local/share/vim/vim73/syntax/2html.vim", check_other=0, is_vimrc=0) at 
ex_cmds2.c:3204
#18 0x0000000000490011 in source_callback (fname=0xddef10 
"/usr/local/share/vim/vim73/syntax/2html.vim", cookie=0x0) at ex_cmds2.c:2627
#19 0x0000000000490220 in do_in_runtimepath (name=0xddf10c "syntax/2html.vim", 
all=0, callback=0x48ffeb <source_callback>, cookie=0x0) at ex_cmds2.c:2721
#20 0x000000000049003e in source_runtime (name=0xddf10c "syntax/2html.vim", 
all=0) at ex_cmds2.c:2641
#21 0x000000000048ffe9 in ex_runtime (eap=0x7fffffffbe00) at ex_cmds2.c:2617
#22 0x000000000049578c in do_one_cmd (cmdlinep=0x7fffffffc048, sourcing=1, 
cstack=0x7fffffffc080, fgetline=0x4938f6 <get_loop_line>, cookie=0x7fffffffbfb0)
    at ex_docmd.c:2656
#23 0x0000000000492d5d in do_cmdline (cmdline=0x0, getline=0x47d422 
<get_func_line>, cookie=0xcd5800, flags=7) at ex_docmd.c:1122
#24 0x000000000047c8f7 in call_user_func (fp=0xabb340, argcount=3, 
argvars=0x7fffffffc9a0, rettv=0x7fffffffcb70, firstline=1, lastline=1, 
selfdict=0x0)
    at eval.c:21960
#25 0x0000000000465614 in call_func (funcname=0x8a9380 "Publish", len=7, 
rettv=0x7fffffffcb70, argcount=3, argvars=0x7fffffffc9a0, firstline=1, 
lastline=1, 
    doesrange=0x7fffffffcbb8, evaluate=1, selfdict=0x0) at eval.c:8291
#26 0x00000000004651cb in get_func_tv (name=0x8a9380 "Publish", len=7, 
rettv=0x7fffffffcb70, arg=0x7fffffffcba8, firstline=1, lastline=1, 
doesrange=0x7fffffffcbb8, 
    evaluate=1, selfdict=0x0) at eval.c:8133
#27 0x000000000045dfcd in ex_call (eap=0x7fffffffcc30) at eval.c:3391
#28 0x000000000049578c in do_one_cmd (cmdlinep=0x7fffffffce78, sourcing=1, 
cstack=0x7fffffffceb0, fgetline=0x47d422 <get_func_line>, cookie=0xcd4fc0)
    at ex_docmd.c:2656
#29 0x0000000000492d5d in do_cmdline (cmdline=0x0, getline=0x47d422 
<get_func_line>, cookie=0xcd4fc0, flags=7) at ex_docmd.c:1122
#30 0x000000000047c8f7 in call_user_func (fp=0xaa0e90, argcount=0, 
argvars=0x7fffffffd7d0, rettv=0x7fffffffd9a0, firstline=1, lastline=1, 
selfdict=0x0)
    at eval.c:21960
#31 0x0000000000465614 in call_func (funcname=0x8a6080 "PublishTest", len=11, 
rettv=0x7fffffffd9a0, argcount=0, argvars=0x7fffffffd7d0, firstline=1, 
lastline=1, 
    doesrange=0x7fffffffd9e8, evaluate=1, selfdict=0x0) at eval.c:8291
---Type <return> to continue, or q <return> to quit--- 
#32 0x00000000004651cb in get_func_tv (name=0x8a6080 "PublishTest", len=11, 
rettv=0x7fffffffd9a0, arg=0x7fffffffd9d8, firstline=1, lastline=1, 
    doesrange=0x7fffffffd9e8, evaluate=1, selfdict=0x0) at eval.c:8133
#33 0x000000000045dfcd in ex_call (eap=0x7fffffffda60) at eval.c:3391
#34 0x000000000049578c in do_one_cmd (cmdlinep=0x7fffffffdca8, sourcing=1, 
cstack=0x7fffffffdce0, fgetline=0, cookie=0x0) at ex_docmd.c:2656
#35 0x0000000000492d5d in do_cmdline (cmdline=0x7fffffffe7ca "call 
PublishTest()", getline=0, cookie=0x0, flags=11) at ex_docmd.c:1122
#36 0x0000000000492396 in do_cmdline_cmd (cmd=0x7fffffffe7ca "call 
PublishTest()") at ex_docmd.c:728
#37 0x00000000004decc6 in exe_commands (parmp=0x7fffffffe230) at main.c:2807
#38 0x00000000004dc178 in main (argc=3, argv=0x7fffffffe478) at main.c:885
(gdb) q
A debugging session is active.

        Inferior 1 [process 5584] will be killed.

Quit anyway? (y or n) y
diff -r 073ff46fe397 runtime/doc/debug.txt
--- a/runtime/doc/debug.txt	Fri Aug 20 11:11:57 2010 +0200
+++ b/runtime/doc/debug.txt	Thu Sep 02 15:43:59 2010 +0200
@@ -22,7 +22,8 @@
 This also applies when using the MingW tools.
 
 1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
-   which you can uncomment).
+   which you can uncomment) and make sure "strip" is disabled (include the
+   line "STRIP = /bin/true" in the Makefile).
 
 2. Execute these commands (replace "11" with the test that fails): >
 	cd testdir
-- 
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

Raspunde prin e-mail lui