Hi Paul,

On Thu, Jul 22, 2010 at 1:39 PM, Paul DeBruicker <pdebruic@gmail.com> wrote:


Have you updated to r2244 or better?  As I hoped in the log:

svn log platforms/unix/vm/sqUnixHeartbeat.c
r2244 | eliot | 2010-07-20 11:20:26 -0700 (Tue, 20 Jul 2010) | 3 lines

Fix heartbeat clock log (-ve % +ve =>  -ve bounds violation).
This will hopefully fix crashes in the heartbeat under linux.

If you're already at 2244 then what's the backtrace in gdb, registers etc?

 
Yes I think I'm at r2247. svn update finds no changes for platforms, src, and unixbuild.

You'll have to be explicit for what you want from gdb as I'm a complete novice.

OK, frst create .gdbinit in your home directory with the following contents
---------8<------- ~/.gdbinit ---------8<-------
set history save on
handle SIGUSR1 nostop noprint noignore
handle SIGUSR2 nostop noprint noignore
handle SIGALRM nostop noprint noignore
handle SIGPOLL nostop noprint noignore
handle SIGPIPE nostop noprint noignore
---------------------------8<---------------------

then run as usual and when the segfault happens type
(gdb) where
(gdb) info registers
(gdb) x/5i $eip
(gdb) info threads

and post the results.  where gives a stack backtrace.  info registers prints the registers.  x/5i $eip prints the faulting instruction and the 4 following it.  If its very close to the start of the function containing the segfault you can also say disass func and get the code surroundig the fault.  info threads prints how many threads there are.  If you want you can say thread N and then where to get the stack backtrace for each thread.

cheers
Eliot


Here's the gdb session:

paul@paul-laptop:~/src/squeakvm/unixbuild/bld$ gdb ./squeak
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/paul/src/squeakvm/unixbuild/bld/squeak...done.

(gdb) run Pharo-1.1-11409-rc4dev10.07.2.image
Starting program: /home/paul/src/squeakvm/unixbuild/bld/squeak Pharo-1.1-11409-rc4dev10.07.2.image
warning: the debug information found in "/lib/ld-2.11.1.so" does not match "/lib/ld-linux.so.2" (CRC mismatch).

[Thread debugging using libthread_db enabled]
[New Thread 0xb7adbb70 (LWP 27073)]

Program received signal SIGUSR2, User defined signal 2.
[Switching to Thread 0xb7adbb70 (LWP 27073)]
heartbeat_handler (sig=14, sig_info=0x63, context=0x0)
   at /home/paul/src/squeakvm/platforms/unix/vm/sqUnixHeartbeat.c:461
461     {

(gdb) bt
#0  heartbeat_handler (sig=14, sig_info=0x63, context=0x0)
   at /home/paul/src/squeakvm/platforms/unix/vm/sqUnixHeartbeat.c:461
#1 <signal handler called>
#2  0xf7fdf430 in __kernel_vsyscall ()
#3  0xf7fabb16 in nanosleep () from /lib32/libpthread.so.0
#4  0x0805fa38 in tickerSleepCycle (ignored=0x0)
   at /home/paul/src/squeakvm/platforms/unix/vm/sqUnixHeartbeat.c:375
#5  0xf7fa396e in start_thread () from /lib32/libpthread.so.0
#6  0xf7ed6b5e in clone () from /lib32/libc.so.6

(gdb) info registers
eax            0xe      14
ecx            0x0      0
edx            0x0      0
ebx            0xb7adb388       -1213353080
esp            0xb7adadfc       0xb7adadfc
ebp            0xb7adb398       0xb7adb398
esi            0xb7adbb70       -1213351056
edi            0x3d0f00 4001536
eip            0x805f6d0        0x805f6d0 <heartbeat_handler>
eflags         0x296    [ PF AF SF IF ]
cs             0x23     35
ss             0x2b     43
ds             0x2b     43
es             0x2b     43
fs             0x0      0
gs             0x63     99
(gdb)