1

I'm having an odd crash in Boehm on Android x86 (but arm works fine); It's crashing on:

deferred = *(word *)limit;

with:

LogCat: I/DEBUG ( 6453): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xa31f8

It's always the same address (0xa31f8) it fails at; Now this is probably something I'm doing wrong. This is a custom language and I'm just linking to libc.so. What could possibly cause this?

Log:

LogCat: I/BDWGC ( 7930): Grow heap to 64 KiB after 0 bytes allocated

LogCat: D/BDWGC ( 7930): Creating thread 0xb7795160

LogCat: D/BDWGC ( 7930): Stopping the world from 0xb7795160

LogCat: D/BDWGC ( 7930): World stopped from 0xb7795160

LogCat: D/BDWGC ( 7930): Pushing stacks from thread 0xb7795160

LogCat: D/BDWGC ( 7930): Stack for thread 0xb7795160 = [0xbf90be1c,0xbf90f000) LogCat: F/libc ( 7930): Fatal signal 11 (SIGSEGV), code 1, fault addr 0xa31f8 in tid 7930 (ksample.oxygene)

Backtrace:

(gdb) bt

#0 0xa502c9ad in GC_mark_from (mark_stack_top=0xb8b30010, mark_stack=0xb8b30000, mark_stack_limit=0xb8b38000) at mark.c:853

#1 0xa502c1d0 in GC_mark_some (cold_gc_frame=0xbf90beec "l¿\220¿Hò\001¥ì¾\220¿") at mark.c:409

#2 0xa501f248 in GC_stopped_mark (stop_func=0xa501e420 ) at alloc.c:702

#3 0xa501eed2 in GC_try_to_collect_inner (stop_func=0xa501e420 ) at alloc.c:488

#4 0xa50254ff in GC_init () at misc.c:1288

coinbird
  • 1,202
  • 4
  • 24
  • 44
Carlo Kok
  • 1,128
  • 5
  • 14
  • "What could possibly cause this?" Heap corruption? There isn't nearly enough info in this question to give a useful answer. – Thomas Aug 15 '17 at 15:08
  • @Thomas sorry about that, this is a boehm specific question. – Carlo Kok Aug 15 '17 at 15:34
  • But maybe it does not have a Boehm specific answer. If something, somewhere corrupted some memory that Boehm was using... boom. The "something, somewhere" could be in Boehm code (in which case it's a bug) but it might be in your own code, or in some other library you're using. – Thomas Aug 15 '17 at 15:36
  • It happens on the entrypoint of boehm (calling GC_init), but it's possible I'm not implementing a dependent api properly yes, hence my question. – Carlo Kok Aug 15 '17 at 17:48

1 Answers1

2

There was a bug in boehm-gc for Android causing registration of a data root with an unmapped memory region (thus resulting in a SIGSEGV/SEGV_MAPERR during GC initialization). Now it is fixed.

Ivan Maidanski
  • 251
  • 2
  • 2