Cesar Romani wrote:

> Bram Moolenaar wrote:
>>
>> Cesar Romani wrote:
>>
>>> I tried compiling vim 7.2 with termcap on MSYS, and it compiles fine.
>>> However, when I execute it, I get:
>>> --------------------
>>> $ vim
>>> Vim: Caught deadly signal SEGV
>>> Vim: Finished.
>>> --------------------
>>>
>>> If I run gdb on it, I get:
>>> --------------------
>>> $ gdb vim.exe
>>> GNU gdb 6.8
>>> Copyright (C) 2008 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 "i686-pc-mingw32"...
>>> (gdb) run
>>> Starting program: C:\msys\1.0\home\Romer\msys\vim72\src/vim.exe
>>> [New thread 5908.0xfec]
>>> Vim: Warning: Output is not to a terminal
>>> Vim: Warning: Input is not from a terminal
>>> [New thread 5908.0x580]
>>>
>>> Program received signal SIGSEGV, Segmentation fault.
>>> 0x004fee32 in set_termname (
>>>     term=0x3a6c3532 <Address 0x3a6c3532 out of bounds>) at term.c:1866
>>> 1866        if (STRCMP(term, "pcterm") == 0)
>>> --------------------
>>>
>>> The compilation and execution of vim for win32 with MingW is fine and I
>>> want to compile it on the MSYS environment because the vim version there
>>> is too old, 5.8
>>
>> Strange that it crashes there.  Earlier in the set_termname() function
>> there is this line:
>>
>>    if (term_is_builtin(term))
>>
>> Try setting a breakpoint there.
>>
>> With weird errors I suspect the compiler.  Did you disable the
>> optimizer?  There are quite a few versions of gcc with bugs in the
>> optimizer code.
>
> The gcc version I'm using is 2.95.3-1
> and the optimizer isn't disabled:
> CFLAGS = -g -O2
>
> If I put a break at line 1615:
>    if (term_is_builtin(term))
> I get:
> --------------------
> (gdb) break term.c:1615
> Breakpoint 1 at 0x4fcdee: file term.c, line 1615.
> (gdb) run
> The program being debugged has been started already.
> Start it from the beginning? (y or n) [answered Y; input not from
> terminal]
> Starting program: C:\msys\1.0\home\Romer\msys\vim72\src/vim.exe
> [New thread 3524.0x7b8]
> Vim: Warning: Output is not to a terminal
> Vim: Warning: Input is not from a terminal
> [New thread 3524.0x59c]
>
> Breakpoint 1, set_termname (term=0xa0158b8 "msys") at term.c:1615
> 1615        if (term_is_builtin(term))
> --------------------
>
> Regards,
> Cesar


I don't understand how term can be correct at line term.c:1615 and
then later incorrect at line 1866.

It's worth disabling optimization by building Vim with -O0 instead of -O2.
This can be done by adding a line in src/Makefile with -O0.  For example:

 528 # Often used for GCC: mixed optimizing, lot of optimizing, debugging
 529 CFLAGS = -g -O0 -Wall

Then re-compile with: "make clean; make"

When putting a breakpoint at line term.c:1615,
what is the value of 'term' variable? (output of gdb command: print term)

Ex:

(gdb) p term
$1 = (char_u *) 0x946e25c "xterm-256color"

What is also the value of 'term' later at line 1866 where it crashes?

Output of gdb command "bt full" might also be helpful.

Cheers
-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui