Reply to topic  [ 5 posts ] 
dbwhere 
Author Message
Yorick Master

Joined: Wed Jun 01, 2005 11:34 am
Posts: 112
Post dbwhere
When I try using dbwhere, it causes a SIGSEGV segmentation violation interrupt. Here are examples of how I've tried to use it:

Code:
func test1(a,b,c) { dbwhere; }
func test2(a,b,c) { write, dbwhere(); }
func test3(a,b,c) { cause_error(); }


For test3, I entered dbug mode and tried "dbwhere;" and "write, dbwhere();". I've tried these tests with the functions entered at the command line as well as sourced from a file.

Am I using the command wrong?

(I reviewed the output during compilation in case there was something compiling wrong on my system. I found the issue I posted about SIGFPE, but that seems unrelated. I don't see any other compile issues.)


Fri Feb 01, 2013 8:48 am
Profile
Yorick Master

Joined: Mon Nov 22, 2004 9:43 am
Posts: 354
Location: Livermore, CA, USA
Post Re: dbwhere
These all work fine on my Ubuntu 12.04 system. Did you start a fresh copy of yorick, define test1, and execute it? If that causes SIGSEGV, there may be an uninitialized variable somewhere that happens to have a non-fatal value for me, but not for you. What OS/compiler are you using? If you build yorick like this:

Code:
make siteclean
env CFLAGS='-g -O0' make config
make install


Does it still fail? If so, can you run it under a debugger and tell me what line it's dying on?


Mon Feb 25, 2013 8:08 pm
Profile
Yorick Master

Joined: Wed Jun 01, 2005 11:34 am
Posts: 112
Post Re: dbwhere
I built a fresh Yorick as you instructed and the problem still persists. Here's a sample output:

Code:
$ ./yorick                                                                     
Copyright (c) 2005.  The Regents of the University of California.
All rights reserved.  Yorick 2.2.02x ready.  For help type 'help'
> func test(a,b,c) {dbwhere;}
> test
test[5]
*main*[2]
ERROR (test) Segmentation violation interrupt (SIGSEGV)
WARNING source code unavailable (try dbdis function)
now at pc= 4 (of 11), failed at pc= 6
To enter debug mode, type <RETURN> now (then dbexit to get out)
>


And here's the same run under valgrind:

Code:
$ valgrind ./yorick                                                             
==12425== Memcheck, a memory error detector
==12425== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==12425== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==12425== Command: ./yorick
==12425==
==12425== Conditional jump or move depends on uninitialised value(s)
==12425==    at 0x449397: u_fpu_detect (fpuset.c:213)
==12425==    by 0x4493EE: u_fpu_setup (fpuset.c:249)
==12425==    by 0x41A658: u_main_loop (umain.c:32)
==12425==    by 0x41A5FA: main (main.c:22)
==12425==
==12425== Conditional jump or move depends on uninitialised value(s)
==12425==    at 0x4493B0: u_fpu_detect (fpuset.c:214)
==12425==    by 0x4493EE: u_fpu_setup (fpuset.c:249)
==12425==    by 0x41A658: u_main_loop (umain.c:32)
==12425==    by 0x41A5FA: main (main.c:22)
==12425==
==12425== Conditional jump or move depends on uninitialised value(s)
==12425==    at 0x449400: u_fpu_setup (fpuset.c:251)
==12425==    by 0x41A658: u_main_loop (umain.c:32)
==12425==    by 0x41A5FA: main (main.c:22)
==12425==
==12425== Conditional jump or move depends on uninitialised value(s)
==12425==    at 0x449410: u_fpu_setup (fpuset.c:253)
==12425==    by 0x41A658: u_main_loop (umain.c:32)
==12425==    by 0x41A5FA: main (main.c:22)
==12425==
Copyright (c) 2005.  The Regents of the University of California.
All rights reserved.  Yorick 2.2.02x ready.  For help type 'help'
> func test(a,b,c) {dbwhere;}
> test
test[5]
*main*[2]
==12425== Invalid read of size 8
==12425==    at 0x4D52BE: ydb_funcof (debug.c:1070)
==12425==    by 0x4D5178: Y_dbwhere (debug.c:1042)
==12425==    by 0x4B55D6: EvalBI (fnctn.c:438)
==12425==    by 0x4B26EA: Print (yio.c:263)
==12425==    by 0x498A8E: YRun (task.c:128)
==12425==    by 0x498E3F: DoTask (task.c:255)
==12425==    by 0x499DEA: y_on_idle (task.c:621)
==12425==    by 0x41AE0C: p_on_idle (alarms.c:56)
==12425==    by 0x41A93E: u_waiter (umain.c:107)
==12425==    by 0x41A6EE: u_main_loop (umain.c:42)
==12425==    by 0x41A5FA: main (main.c:22)
==12425==  Address 0x773000 is not stack'd, malloc'd or (recently) free'd
==12425==
ERROR (test) Segmentation violation interrupt (SIGSEGV)
WARNING source code unavailable (try dbdis function)
now at pc= 4 (of 11), failed at pc= 6
To enter debug mode, type <RETURN> now (then dbexit to get out)
>


According to uname -a: "Linux grapeape 2.6.35.14-106.fc14.x86_64 #1 SMP Wed Nov 23 13:07:52 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux". And /etc/redhat-release says it's "Federal release 14 (Laughlin)".

To be sure it wasn't something specific to that system, I also tried running that test function on another system (using the Yorick I already had built, not a fresh version). It also gave a SIGSEGV. That system's uname -a: "Linux automatix 2.6.18-164.11.1.el5 #1 SMP Wed Jan 6 13:26:04 EST 2010 x86_64 x86_64 x86_64 GNU/Linux". And /etc/redhat-release says it's "Red Hat Enterprise Linux Server release 5.4 (Tikanga)".

EDIT: I forgot to include what version of the compiler I'm using. Here's the output for "cc -v" on the first system:
Code:
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.5.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)


Tue Feb 26, 2013 8:30 am
Profile
Yorick Master

Joined: Mon Nov 22, 2004 9:43 am
Posts: 354
Location: Livermore, CA, USA
Post Re: dbwhere
Fixed by commit 14f7caf at github.com/dhmunro/yorick.

Turns out to be a massive buffer overreach bug. Memory was laid out differently on my machine and in my few test cases the problem was miraculously benign. Please check that this fix works for you, but I'm pretty confident it will.

Thank you for reporting and tracking this down for me.


Tue Feb 26, 2013 7:45 pm
Profile
Yorick Master

Joined: Wed Jun 01, 2005 11:34 am
Posts: 112
Post Re: dbwhere
The new version appears to work properly on my machine. Thanks much for the quick fix! :)


Wed Feb 27, 2013 6:01 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.