This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug boehm-gc/52179] boehm-gc incompatible with aslr on darwin11


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52179

--- Comment #7 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-02-11 01:10:48 UTC ---
Interestingly, aslr randomizes the gdb crash log. For instance...

# gdb ./gctest

(gdb) break mark.c:361
Breakpoint 1 at 0x20c49ba5e20a81: file
../../../gcc-4.7-20120209/boehm-gc/mark.c, line 361.
(gdb) r
Starting program:
/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.3.0/boehm-gc/testsuite/.libs/gctest 
Reading symbols for shared libraries + done
Reading symbols for shared libraries ++++........................ done

Breakpoint 1, GC_mark_some (cold_gc_frame=0x7fff6624b64c "\001") at
../../../gcc-4.7-20120209/boehm-gc/mark.c:361
361                    MARK_FROM_MARK_STACK();
(gdb) c 106
Will ignore next 105 crossings of breakpoint 1.  Continuing.

Breakpoint 1, GC_mark_some (cold_gc_frame=0x7fff6624b64c "\001") at
../../../gcc-4.7-20120209/boehm-gc/mark.c:361
361                    MARK_FROM_MARK_STACK();
(gdb) break mark.c:759
Breakpoint 2 at 0x1066722ac: file ../../../gcc-4.7-20120209/boehm-gc/mark.c,
line 759.
(gdb) c 3000
Will ignore next 2999 crossings of breakpoint 1.  Continuing.

Breakpoint 2, GC_mark_from (mark_stack_top=0x106716000, mark_stack=0x106716000,
mark_stack_limit=0x106726000) at ../../../gcc-4.7-20120209/boehm-gc/mark.c:759
759          deferred = *limit;
(gdb) c 1000
Will ignore next 999 crossings of breakpoint 2.  Continuing.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00007fff662d03d8
GC_mark_from (mark_stack_top=0x106716000, mark_stack=0x106716000,
mark_stack_limit=0x106726000) at ../../../gcc-4.7-20120209/boehm-gc/mark.c:759
759          deferred = *limit;

vs

# gdb ./gctest
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov  3 21:59:02 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared
libraries .... done

(gdb) set disable-aslr off
(gdb) break mark.c:361
Breakpoint 1 at 0x20c49ba5e20a81: file
../../../gcc-4.7-20120209/boehm-gc/mark.c, line 361.
(gdb) r
Starting program:
/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.3.0/boehm-gc/testsuite/.libs/gctest 
Reading symbols for shared libraries + done
Reading symbols for shared libraries ++++........................ done

Breakpoint 1, GC_mark_some (cold_gc_frame=0x7fff605eb64c "\001") at
../../../gcc-4.7-20120209/boehm-gc/mark.c:361
361                    MARK_FROM_MARK_STACK();
(gdb) c 106
Will ignore next 105 crossings of breakpoint 1.  Continuing.

Breakpoint 1, GC_mark_some (cold_gc_frame=0x7fff605eb64c "\001") at
../../../gcc-4.7-20120209/boehm-gc/mark.c:361
361                    MARK_FROM_MARK_STACK();
(gdb) break mark.c:759
Breakpoint 2 at 0x100a112ac: file ../../../gcc-4.7-20120209/boehm-gc/mark.c,
line 759.
(gdb) c 4000
Will ignore next 3999 crossings of breakpoint 1.  Continuing.

Breakpoint 2, GC_mark_from (mark_stack_top=0x100abb000, mark_stack=0x100abb000,
mark_stack_limit=0x100acb000) at ../../../gcc-4.7-20120209/boehm-gc/mark.c:759
759          deferred = *limit;
(gdb) 

where the second attempt crosses the same number of breakpoints on mark.c:759
without crashing as in the first try.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]