Summary: | net-libs/wvstreams-4.6.1 compiled with GCC 4.7.0: assertion failed when dialing a 3G/GPRS modem | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Ioannis Galanommatis <galanom> |
Component: | Current packages | Assignee: | C++ Team [disbanded] <cpp+disabled> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ssuominen |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 419563 | ||
Bug Blocks: |
Description
Ioannis Galanommatis
2012-06-06 19:08:26 UTC
So this is after applying the patch from bug #419563, right? Fixed by -r2 in Portage. Please test. (In reply to comment #2) Yes! (In reply to comment #2) > Fixed by -r2 in Portage. Please test. Weird. It segfaults with these flags: CFLAGS="-O2 -march=native -pipe" CHOST="x86_64-pc-linux-gnu" CXXFLAGS="${CFLAGS}" Output: --> WvDial: Internet dialer version 1.61 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: AT&F E1 V1 X1 &D2 &C1 S0=0 AT&F E1 V1 X1 &D2 &C1 S0=0 OK --> Sending: AT+CGDCONT=1,"IP","internet.vodafone.gr" AT+CGDCONT=1,"IP","internet.vodafone.gr" OK --> Modem initialized. --> Idle Seconds = 3600, disabling automatic reconnect. Program received signal SIGSEGV, Segmentation fault. 0x00007ffff731c9da in WvTaskMan::do_task() () from /usr/lib64/libwvbase.so.4.6 (gdb) bt #0 0x00007ffff731c9da in WvTaskMan::do_task() () from /usr/lib64/libwvbase.so.4.6 #1 0x00007ffff7de8c75 in ?? () from /lib64/ld-linux-x86-64.so.2 #2 0x00007ffff7def2c5 in ?? () from /lib64/ld-linux-x86-64.so.2 #3 0x00007ffff7311469 in WvCont::_call(WvCont::Data*) () from /usr/lib64/libwvbase.so.4.6 #4 0x00007ffff7311620 in WvCont::operator()(void*) () from /usr/lib64/libwvbase.so.4.6 #5 0x00007ffff7323fa9 in WvStream::callback() () from /usr/lib64/libwvbase.so.4.6 #6 0x000000000040760c in ?? () #7 0x00007ffff6a386c5 in __libc_start_main () from /lib64/libc.so.6 #8 0x0000000000407c11 in ?? () #9 0x00007fffffffeac8 in ?? () #10 0x0000000000000000 in ?? () I don't know why there are these empty parenthesis or question marks, I did not tell portage to strip symbols. I guessed that -O2 removes them. So I switched to -O2 in make.conf and ...it compiles fine!! Why could compile fine with -O0 and not with -02??? GCC 4.7.0 is stable, according to GNU. Shall I post a bug there? (In reply to comment #3) > (In reply to comment #2) > Yes! > > (In reply to comment #2) > > Fixed by -r2 in Portage. Please test. > > Weird. It segfaults with these flags: > CFLAGS="-O2 -march=native -pipe" > CHOST="x86_64-pc-linux-gnu" > CXXFLAGS="${CFLAGS}" > > Output: > > --> WvDial: Internet dialer version 1.61 > --> Cannot get information for serial port. > --> Initializing modem. > --> Sending: ATZ > ATZ > OK > --> Sending: AT&F E1 V1 X1 &D2 &C1 S0=0 > AT&F E1 V1 X1 &D2 &C1 S0=0 > OK > --> Sending: AT+CGDCONT=1,"IP","internet.vodafone.gr" > AT+CGDCONT=1,"IP","internet.vodafone.gr" > OK > --> Modem initialized. > --> Idle Seconds = 3600, disabling automatic reconnect. > > Program received signal SIGSEGV, Segmentation fault. > 0x00007ffff731c9da in WvTaskMan::do_task() () from > /usr/lib64/libwvbase.so.4.6 > (gdb) bt > #0 0x00007ffff731c9da in WvTaskMan::do_task() () from > /usr/lib64/libwvbase.so.4.6 > #1 0x00007ffff7de8c75 in ?? () from /lib64/ld-linux-x86-64.so.2 > #2 0x00007ffff7def2c5 in ?? () from /lib64/ld-linux-x86-64.so.2 > #3 0x00007ffff7311469 in WvCont::_call(WvCont::Data*) () from > /usr/lib64/libwvbase.so.4.6 > #4 0x00007ffff7311620 in WvCont::operator()(void*) () from > /usr/lib64/libwvbase.so.4.6 > #5 0x00007ffff7323fa9 in WvStream::callback() () from > /usr/lib64/libwvbase.so.4.6 > #6 0x000000000040760c in ?? () > #7 0x00007ffff6a386c5 in __libc_start_main () from /lib64/libc.so.6 > #8 0x0000000000407c11 in ?? () > #9 0x00007fffffffeac8 in ?? () > #10 0x0000000000000000 in ?? () > > > I don't know why there are these empty parenthesis or question marks, I did > not tell portage to strip symbols. I guessed that -O2 removes them. So I > switched to -O2 in make.conf and ...it compiles fine!! Portage is set to strip symbols by default, see FEATURES="nostrip" here: http://www.gentoo.org/proj/en/qa/backtraces.xml > Why could compile fine with -O0 and not with -02??? It's -O2 instead of -02. > GCC 4.7.0 is stable, according to GNU. Shall I post a bug there? But you are using it on Gentoo so only KEYWORDS matter, and gcc-4.7.0 is not even keyworded for ~arch (testing) yet. The portage tree is far from being ready for 4.7.0. I thought you were just testing it to contribute patches, fun, etc. ;-) Anyway, please get a proper backtrace with those ?? changed to something useful and/or build.log with failure and then reopen the bug if necessary. (In reply to comment #4) I think I found the most insane bug in my life. As is it segfaults. I added FEATURES="nostrip" and I did not enable debug flag as your page suggests. If I add -ggdb, I don't get more symbols. If I add -fno-omit-frame-pointer then instead of sefaulting, it aborts with the initial magic number thing assertion failure. Just for fun: I go to utils/wvtask.cc:501 to see what happens It's assert(magic_number == -WVTASK_MAGIC); assert(task); assert(task->magic_number == WVTASK_MAGIC); and it sefaults. If I do this, to see if task==NULL: assert(magic_number == -WVTASK_MAGIC); assert(task); fprintf(stderr, "hello world! %x", task); assert(task->magic_number == WVTASK_MAGIC); Then it does NOT segfault! I prints an address (non-NULL) and aborts: utils/wvtask.cc:502: static void WvTaskMan::do_task(): Assertion `task->magic_number == 0x123678' failed. (Please note that the first assert is with positive sign and second with negative.) So, dereferrencing a variable changes its contents??? What is this, quantum programming? Anyway. Compiling wvstreams and wvdial with -ggdb and FEATURES="nostrip" but without -fno-omit-frame-pointer, all I can get is: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff731c9da in WvTaskMan::do_task () at utils/wvtask.cc:501 501 utils/wvtask.cc: No such file or directory. (gdb) bt #0 0x00007ffff731c9da in WvTaskMan::do_task () at utils/wvtask.cc:501 #1 0x00007ffff7de8c75 in ?? () from /lib64/ld-linux-x86-64.so.2 #2 0x00007ffff7def2c5 in ?? () from /lib64/ld-linux-x86-64.so.2 #3 0x00007ffff7311469 in WvCont::_call (data=0x62e660) at utils/wvcont.cc:176 #4 0x00007ffff7311620 in call (this=0x62e190) at ./include/wvcont.h:54 #5 WvCont::operator() (this=0x62e190, p1=0x0) at utils/wvcont.cc:209 #6 0x00007ffff7323fa9 in operator() (__args#0=<optimized out>, this=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/include/g++-v4/tr1/functional:2154 #7 WvStream::callback (this=0x7fffffffd030) at streams/wvstream.cc:432 #8 0x00000000004074bc in main (argc=<optimized out>, argv=<optimized out>) at wvdial.cc:225 If you need more info, please tell me which packages should compile with what options. tx Well, you posted the patch and the link to it and the cause is described there: "The compiler aggressively optimizes..." But still I fail to see why someone wants optimization and not have NDEBUG defined to get rid of the asserts. http://pkgs.fedoraproject.org/gitweb/?p=libwvstreams.git;a=commit;h=59d3a449a4595758e0f3701f8754e067a0b8dcad Fedora inserted these flags to prevent crashing with 4.7: -fno-tree-dce -fno-optimize-sibling-calls I've done the same for portage now. Let's try the FIXED resolution again. You will need to recompile wvstreams -r2 |