Re: [hatari-devel] readline linked with ncurses

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On tiistai 30 huhtikuu 2013, Christer Solskogen wrote:
> I managed to get some more now:
....
> warning: HEAP[hatari-debug.exe]:
> warning: HEAP: Free Heap block 3cdf2b0 modified at 3cdf308 after it was
> freed
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x0000000077c9f0b2 in ntdll!EtwpCreateEtwThread ()
>    from C:\WINDOWS\system32\ntdll.dll
> (gdb) bt
> #0  0x0000000077c9f0b2 in ntdll!EtwpCreateEtwThread ()
>    from C:\WINDOWS\system32\ntdll.dll
> #1  0x0000000077c4fd34 in ntdll!RtlIsDosDeviceName_U ()
>    from C:\WINDOWS\system32\ntdll.dll
> #2  0x0000000077cf0d20 in ntdll!RtlGetFileMUIPath ()
>    from C:\WINDOWS\system32\ntdll.dll
> #3  0x0000000003cdf2b0 in ?? ()
> #4  0x0000000003cdf308 in ?? ()
> #5  0x00000000ffffffff in ?? ()
> #6  0x0000000000000016 in ?? ()
> #7  0x0000000000000000 in ?? ()
> (gdb) c
> Continuing.

Unfortunately this doesn't tell where the memory corruption happens.

 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000659a430f in set_curterm_sp (sp=0x0, termp=0x3cdf2c0)
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/ncurses/ncurses/tinfo/lib_cur
> _term.c:99
> 99

I assume crash is NULL pointer access in your ncurses library.

This part seems to be related to terminal initilization and processing
its information (from the disk).  It's nothing related to what Hatari
asks from readline.


>  /home/solskogen/mingw-w64-builder/trunk/lib/ncurses/ncurses/tinfo/lib_cu
> r_term.c: No such file or directory.
> (gdb) bt
> #0  0x00000000659a430f in set_curterm_sp (sp=0x0, termp=0x3cdf2c0)
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/ncurses/ncurses/tinfo/lib_cur
> _term.c:99
> #1  0x00000000659ab51a in _nc_setupterm_ex (tp=0x22f9f0,
>     tname=0x659e3175 <tc_strings+469> "dumb", Filedes=1, errret=0x22f9f8,
>     reuse=1)
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/ncurses/ncurses/tinfo/lib_set
> up.c:763

And it happens for "dumb" terminal...

What terminal you've specified for your ncurses library
(with TERM environment variable), and what kind of terminal
descriptions your system has?  termcap?  terminfo database?


> #2  0x00000000659a24e2 in tgetent_sp (sp=0x0,
>     bufp=0x3cde2a0
> "\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º
> \rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd
> -º\rd-º
> \rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\r
> d-º\rd-º \rd-º\rd-º\rd-º\rd-º\rd-º\rd-º"...,
>     name=0x659e3175 <tc_strings+469> "dumb")
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/ncurses/ncurses/tinfo/lib_ter
> mcap.c:103
> #3  0x00000000659a3935 in tgetent (
>     bufp=0x3cde2a0
> "\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º
> \rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd
> -º\rd-º
> \rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\rd-º\r
> d-º\rd-º \rd-º\rd-º\rd-º\rd-º\rd-º\rd-º"...,
>     name=0x659e3175 <tc_strings+469> "dumb")
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/ncurses/ncurses/tinfo/lib_ter
> mcap.c:206
> #4  0x00000000659976c6 in _rl_init_terminal_io (terminal_name=0x0)
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/readline/terminal.c:452 #5 
> 0x000000006598269e in readline_initialize_everything ()
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/readline/readline.c:1066 #6 
> 0x000000006598254e in rl_initialize ()
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/readline/readline.c:968 #7 
> 0x0000000065981541 in readline (prompt=0x617e71 <OpcodeTable+32817> ">
> ")
>     at
> /home/solskogen/mingw-w64-builder/trunk/lib/readline/readline.c:334 #8 
> 0x000000000055b880 in DebugUI_GetCommand (input=<optimized out>) at
> /home/hatari/hatari-builder2/hatari/src/debug/debugui.c:733 #9 
> __fu5_rl_attempted_completion_function ()

This is line:
        return Str_Trim(readline("> "));

So I don't think your crash has anything to do with Hatari,
unless it's related to use-after-free error earlier.

As I haven't seen such error on Linux, that seems unlikely to me.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/