[M3devel] Mika's thread test, -tests read

Dragiša Durić dragisha at m3w.org
Sat Apr 28 09:57:59 CEST 2012


RTFM helps, as always… No, I don't think it is redzone.  BUT.

One run:
=====
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000001ffff8
[Switching to process 4200 thread 0x10f]
0x0000000100037360 in RTCollector__Move (self=Cannot access memory at address 0xffffffffffffff77
) at ../src/runtime/common/RTCollector.m3:409
409	    IF hdr.typecode = RT0.TextLitTypecode THEN RETURN END;
(gdb)
=====

Next run:
=====
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000001ffff8
[Switching to process 4204 thread 0x40f]
0x0000000100017e6b in FileRd__Init (rd=Cannot access memory at address 0xffffffffffffffa7
) at ../src/rw/FileRd.m3:44
44	    IF (rd.buff = NIL) THEN
=====

Next:
=====
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000001ffff8
[Switching to process 4207 thread 0x1703]
0x0000000100037360 in RTCollector__Move (self=Cannot access memory at address 0xffffffffffffff77
) at ../src/runtime/common/RTCollector.m3:409
409	    IF hdr.typecode = RT0.TextLitTypecode THEN RETURN END;
(gdb) p hdr
Cannot access memory at address 0xffffffffffffffdf << local variable
=====

And so on…

Break in FileRd.Init() happens after AllocTraced() takes LongAlloc() route.

Break in Move happens along AllocTraced->CollectEnough. Interesting thing - previous call to AllocTraced took a LongAlloc() route.

C trace, in Move() break:
=====
(gdb) set lang c
(gdb) bt
#0  0x0000000100037360 in RTCollector__Move (self=0x100953c60, cp=0x100e50018) at ../src/runtime/common/RTCollector.m3:409
#1  0x00000001000358ca in RTHeapMap__Walk (x=0x0, pc=0x1009c0028, v=0x100098a88) at ../src/runtime/common/RTHeapMap.m3:202
#2  0x0000000100034fb2 in RTHeapMap__DoWalkRef (t=0x1, a=0x100083de8, v=0x1009c0028) at ../src/runtime/common/RTHeapMap.m3:62
#3  0x0000000100034f85 in RTHeapMap__DoWalkRef (t=0x100087898, a=0x100084848, v=0x1009c0018) at ../src/runtime/common/RTHeapMap.m3:57
#4  0x0000000100034f85 in RTHeapMap__DoWalkRef (t=0x100d09a30, a=0x100084a48, v=0x1009c0018) at ../src/runtime/common/RTHeapMap.m3:57
#5  0x0000000100034f21 in RTHeapMap__WalkRef (h=0x2018, v=0x1009c0010) at ../src/runtime/common/RTHeapMap.m3:47
#6  0x000000010003986a in RTCollector__CleanBetween (h=0x0, he=0x1009c0010, clean=0 '\0') at ../src/runtime/common/RTCollector.m3:1091
#7  0x0000000100039674 in RTCollector__CleanPage (page=0x1009d0000) at ../src/runtime/common/RTCollector.m3:1064
#8  0x0000000100038dd5 in RTCollector__CollectSomeInStateZero () at ../src/runtime/common/RTCollector.m3:885
#9  0x0000000100038532 in RTCollector__CollectSome () at ../src/runtime/common/RTCollector.m3:720
#10 0x000000010003820f in RTHeapRep__CollectEnough () at ../src/runtime/common/RTCollector.m3:654
=====

Lines can differ, as I've put few RTIO.* lines in RTAllocator/Collector.

On Apr 28, 2012, at 8:49 AM, Dragiša Durić wrote:

> What is stack redzone? Undetected stack overflows or almost overflows?




More information about the M3devel mailing list