David Fishburn <[email protected]> wrote:
> I was just trying some tests on my Ubuntu 12.04 box and compiled my own Vim:
> Included patches: 1-729
>
> I started Vim using:
> gvim -u .vimrc -U .gvimrc --noplugin -S
> /usr/share/vim/vimfiles/plugin/yankring.vim foo
>
> "foo" [converted] 5L, 42C
> Error detected while processing function <SNR>11_YRCheckClipboard:
> line 5:
> E341: Internal error: lalloc(0, )
> Error detected while processing function
> <SNR>11_YRFocusGained..<SNR>11_YRCheckClipboard:
> line 5:
> E341: Internal error: lalloc(0, )
> Press ENTER or type command to continue
>
>
> I can't reproduce this reliably, but since I compiled this myself, I should
> be able to use a debug version and get a stack trace.
...
> If someone could point out how to enable debug (with Windows I just add
> debug=yes with nmake) .
Hi David
Make sure that you compile Vim with "-g -O0" to enable debug and
disable optimisations which can hinder debugging. Then make sure
that you're not using a strip version of Vim ("make install" strips Vim
by default, i.e. removed debug symbols).
This should do it:
====================
--- a/src/Makefile Wed Nov 28 23:03:07 2012 +0100
+++ b/src/Makefile Thu Nov 29 07:58:44 2012 +0100
@@ -559,7 +559,7 @@
# Often used for GCC: mixed optimizing, lot of optimizing, debugging
#CFLAGS = -g -O2 -fno-strength-reduce -Wall -Wshadow -Wmissing-prototypes
-#CFLAGS = -g -O2 -fno-strength-reduce -Wall -Wmissing-prototypes
+CFLAGS = -g -O0 -fno-strength-reduce -Wall -Wmissing-prototypes
#CFLAGS = -g -Wall -Wmissing-prototypes
#CFLAGS = -O6 -fno-strength-reduce -Wall -Wshadow -Wmissing-prototypes
#CFLAGS = -g -DDEBUG -Wall -Wshadow -Wmissing-prototypes
@@ -1058,7 +1058,7 @@
### Program to run on installed binary. Use the second one to disable strip.
#STRIP = strip
-#STRIP = /bin/true
+STRIP = /bin/true
### Permissions for binaries {{{1
BINMOD = 755
====================
Rebuild Vim. Then you can run Vim with gdb with a breakpoint
when Vim gives E341:
$ cd vim/src
$ grep -n E341 *c
misc2.c:902: EMSGN(_("E341: Internal error: lalloc(%ld, )"), size);
$ gdb --args ./vim -f -g
(gdb) br misc2.c:902
Breakpoint 1 at 0x4eb006: file misc2.c, line 902.
(gdb) run
Then when Vim hits the breakpoint, you can type gdb command "bt"
to get a backtrace.
-- Dominique
--
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