Bug 4676

Summary: incorrect back trace produced by libunwind
Product: frysk Reporter: Sami Wagiaalla <swagiaal>
Component: generalAssignee: Unassigned <frysk-bugzilla>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 3076    

Description Sami Wagiaalla 2007-06-20 18:07:27 UTC
1)
testFrameAdjustedAddress(frysk.rt.TestFrameDebugInfo)junit.framework.AssertionFailedError:
fourth

(test coming soon to cvs)
Comment 1 Sami Wagiaalla 2007-06-20 18:53:14 UTC
Test program:

#include <stdlib.h>

void fourth(){
  exit(1);
}

void third(){
  fourth();
}

void second(){
  third();
}

void first(){
  second();
}


int main(){
  first ();
  return 0;
}

Comment 2 Sami Wagiaalla 2007-06-20 18:54:32 UTC
Stack trace:

#0 0x00b19402 in __kernel_vsyscall ()
#1 0x0051efc4 in __GI__exit ()
#2 0x08048374 in third ()
#3 0x080483a9 in third ()
#4 0x080483c6 in second ()
#5 0x080483e3 in first ()
#6 0x08048410 in main ()
#7 0x004a6f2c in __libc_start_main ()
#8 0x080482f1 in _start ()

Frame #2 is incorrect. It should be fourth
Comment 3 Sami Wagiaalla 2007-06-20 19:53:46 UTC
Test is now in cvs 

Index: frysk-core/frysk/pkglibdir/ChangeLog
2007-06-20  Sami Wagiaalla  <swagiaal@redhat.com>

       * funit-stacks-exit.c: New.

Index: frysk-core/frysk/rt/ChangeLog
2007-06-20  Sami Wagiaalla  <swagiaal@redhat.com>

       * TestFrameDebugInfo.java (testFrameAdjustedAddress): New test.
Comment 4 Sami Wagiaalla 2007-08-17 13:06:23 UTC
Also on a 32 bit machine:

[swagiaal@towns frysk-core]$ ./frysk/bindir/fstack $$
Task #505
#0 0x0051d402 in __kernel_vsyscall () from [vdso]
#1 0x00337d69 in __waitpid_nocancel () from /lib/libc-2.6.so
#2 0x100f41dd in [unknown] from Unknown
#3 0x0807bfa8 in wait_for () from /bin/bash
#4 0x0806eedd in execute_command_internal () from /bin/bash
#5 0x0806f923 in execute_command () from /bin/bash
#6 0x0805ef61 in reader_loop () from /bin/bash
#7 0x0805ea70 in main () from /bin/bash
#8 0x002bdf70 in __libc_start_main () from /lib/libc-2.6.so
#9 0x0805c6c1 in _start () from /bin/bash
[swagiaal@towns frysk-core]$ pstack $$
#0  0x0051d402 in __kernel_vsyscall ()
#1  0x00337d73 in __waitpid_nocancel () from /lib/libc.so.6
#2  0x0807a12d in ?? ()
#3  0x0807bfa8 in wait_for ()
#4  0x0806eedd in execute_command_internal ()
#5  0x0806f923 in execute_command ()
#6  0x0805ef61 in reader_loop ()
#7  0x0805ea70 in main ()


The addresses are different between the two stack back traces.