Tracking down "Segmentation fault" in blassic
I have blassic installed on my 64-bit PC and 32-bit netbook.
On the PC it runs fine (using multilib) but on the netbook, every time I try to dimension a string array, it causes a segmentation fault and the terminal cursor disappears. In an attempt to try and find out what is going wrong, I edited the blassic.SlackBuild script to stop it stripping down the symbols and then recreated and upgraded the new package. When I ran gdb, this is what I got: Code:
Reading symbols from /usr/bin/blassic...done. |
Code:
bash-4.2$ gdb ./blassic |
Looking at the backtrace may be useful.
exchange_and_add sounds like a threading synchronization primitive to me. |
Quote:
This is not the only package that gives inconsistent results like this and I want to get to the bottom of it. If I can figure out what the problem is for one package then I might be able to figure it out for the others. Blassic got the short straw so I am starting off with that package. @ntubski, I will see what backtrace does and post the results here. |
Quote:
rename /usr/lib to /usr/lib~ and rebuild for 64 bit. and if your building for compat32 that is another road. to look at. the reason it runs on multi-lib is when you built it it used some 32bit stuff and linked to it. remeber to switch it back after building |
Quote:
When I created a symbol version of blassic for the PC, it too started seg-faulting. When I rebuilt the symbol-free version, it was also seg-faulting. However, when I upgrade to the original package, it runs fine. @ntubski This is the backtrace I got on the netbook: Code:
(gdb) run Code:
(gdb) run The segfault in the PC version occurs at delref() in "anonymous namespace" (the linux-gate.so.1 bit) but in the netbook version, delref() manages to call __exchange_and_add_dispatch() before the segfault happens. Now I'm stuck. |
you may try ldd to check which libraries are in use....
|
ldd on netbook:
Code:
$ ldd /usr/bin/blassic Code:
$ ldd /usr/bin/blassic-symb |
Quote:
This because the gdb output mentions linux-gate.so.1. This implies that it is compiled as a x86 32bit program, not a 64 bit one. See vDSO names listed in the man page. So if you are rebuilding to get symbols on the 64 bit machine you have to make sure you indeed build in a 32 bit environment on that machine. Is that the case? |
are those libraries really identical (use file and/or md5sum)
|
Quote:
I just compiled it as a 64-bit executable again but I still get seg-faults when I try to dimension a string array. Quote:
|
Seeing the combination of a segfault in a C++ section of the blassic code and gcc to compile I personally would start suspecting that the blassic code itself has "issues" with more recent versions of gcc. Simply because this would be the key thing that is different compared to when you compiled it in 2012 and there have been a lot of changes on the C++ front since then.
That something compiles on a newer compiler doesn't necessarily mean that it actually works as expected. |
`blassic-0.11.0' : Segmentation fault.
`blassic-0.10.2 : OK with ./configure --disable-svgalib → Code:
$ blassic - |
Quote:
The website https://build.opensuse.org/package/v...c/blassic.spec included some "sed"s which I tried too but to no avail. Thanks for the suggestion though. |
Quote:
So the next thing to try is to run under valgrind, but compile with debug info so you can get line numbers. |
All times are GMT -5. The time now is 09:58 PM. |