Segfault during cgdb startup (64 bit Mint 16 "Petra")

56 views
Skip to first unread message

Thomas Goodfellow

unread,
Mar 21, 2014, 12:37:28 PM3/21/14
to cgdb-...@googlegroups.com
I'm getting a crash during startup which I (ignorantly) suspect could be from 64 bit compatibility. Specifically it's a crash from here

"length = std_list_length(kctx->buffer);"
#0  0x000000000042094e in kui_cangetkey (kctx=0xf800000000004000) at kui.c:1019
#1  0x0000000000420d80 in kui_manager_cangetkey (kuim=0x400059) at kui.c:1226
#2  0x00000000004052fe in main_loop () at cgdb.c:1398
#3  0x0000000000405d3a in main (argc=0, argv=0x7fffffffdf40) at cgdb.c:1737

where kctx was initialised plausibly through kui_manager_create() but then shortly afterwards stomped here:

Hardware watchpoint 2: kui_ctx->terminal_keys

Old value = (struct kuictx *) 0x64e9b0
New value = (struct kuictx *) 0xf800000000004000
0x00007ffff6e85f9a in _nc_init_acs () from /lib/x86_64-linux-gnu/libtinfo.so.5
(gdb) bt
#0  0x00007ffff6e85f9a in _nc_init_acs () from /lib/x86_64-linux-gnu/libtinfo.so.5
#1  0x00007ffff7982638 in _nc_setupscreen () from /lib/x86_64-linux-gnu/libncurses.so.5
#2  0x00007ffff797f95e in newterm () from /lib/x86_64-linux-gnu/libncurses.so.5
#3  0x00007ffff797c693 in initscr () from /lib/x86_64-linux-gnu/libncurses.so.5
#4  0x000000000040b848 in init_curses () at interface.c:157
#5  0x000000000040d523 in if_init () at interface.c:1159
#6  0x0000000000405b95 in main (argc=0, argv=0x7fffffffdf40) at cgdb.c:1694
(gdb) f 4
#4  0x000000000040b848 in init_curses () at interface.c:157


This is ncurses 5.9. Very likely it's some PEBKAC with me but before chasing further I'm keen to know whether it's familiar to anyone? (any cgdb 64 bit issues? standard ncurses gotcha?)

Thanks!

Mike Mueller

unread,
Mar 22, 2014, 1:54:18 PM3/22/14
to cgdb-...@googlegroups.com
Thanks for the detailed report, Thomas. It's been a while since cgdb had a 64-bit related issue, but there may still be one. I've got cgdb running on a Linux Mint system personally (Nadia), 64-bit, with ncurses 5.9, and it works fine. So whatever the issue here, it is either triggered by your usage pattern or a subtle difference in our systems... Either way it's a bug we need to fix. I'll try to look at it later today.

Can you let me know:

* What version of readline do you have?
* Do you have any interesting inputrc settings?
* Do you use any key mappings in cgdbrc?


--
You received this message because you are subscribed to the Google Groups "cgdb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgdb-users+...@googlegroups.com.
To post to this group, send email to cgdb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cgdb-users/64797f6a-56a7-4137-82d9-b889f79ac5f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Goodfellow

unread,
Mar 24, 2014, 7:16:15 AM3/24/14
to cgdb-...@googlegroups.com
Hello Mike

Thanks for the speedy follow-up & my apologies for the delay in responding - with your confirmation that it should work I bashed around a little more and got past that problem - since it's environment/tools/newbie rather than cgdb-specific I can ask about it elsewhere, but for your "amusement" anyway:

The segfault actually happens with the libncurses.so.5.9 that was presumably installed with Mint16 (file date is July 27 2013). I had rebuilt it already but hadn't noticed that this was ineffective, because:

(1) cgdb was using /lib/x86_64-linux-gnu/libncurses  (apparently from gcc -lncurses)
(2) the default build of libncurses5.9 installs it to /usr/lib/libncurses

As a Linux newbie I still lack any intuition for library search orders and locations, but in this case it shouldn't be a matter of "library too old" since ncurses5.9 is rather older than either build. I'm using gcc4.8.1
(Ubuntu/Linaro 4.8.1-10ubuntu9) but I (wildly) presume it has binary compatibility with gcc-built code from the last few years. Another (fantasy) explanation could be a now-fixed bug in a statically-linked library, though I don't see any libncurses pulling one in.

And just for the record, that's using readline v6.3, and I don't have any .cgdbrc or .inputrc at all (yet...)

Thanks again - now I'll get back to actually playing with cgdb :-)
Tom

Chandan Srivastava

unread,
Jul 23, 2021, 3:23:57 AM7/23/21
to cgdb
Hi,

I am getting segmentation fault at start up with with simple 'hello world' application.
Could you please help me to resolve it?

Best Regards,
Chandan Srivastava
Reply all
Reply to author
Forward
0 new messages