Giter VIP home page Giter VIP logo

mmtk-jikesrvm's People

Contributors

caizixian avatar fepicture avatar k-sareen avatar qinsoon avatar steveblackburn avatar udesou avatar wenyuzhao avatar wks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmtk-jikesrvm's Issues

Remove the JikesRVM submodule

We should adopt the pattern in https://github.com/mmtk/mmtk-v8, which does not have the v8 repo as a part of the binding repo. The submodule is considered as bad, as it implies that the VM repo is part of the binding, which is logically incorrect. Basically we would need to achieve this:

  • The binding does not include any submodule.
  • The binding still refers to a version/commit hash of the VM repo
  • In the CI tests for the binding, we use the version/commit hash to test.

Stack overflow for JikesRVM

In GitLab by @caizixian on Feb 7, 2019, 18:01

Rust uses different techniques to detect stack overflow. rust-lang/rust#27338

And JikesRVM relies on compiler-inserted code for detecting stack overflow, which doesn't work for Rust & Native code.

We have to be mindful for the stack usage of Rust code, especially Rust compiler tends to allocate on stack first and then copy to the heap.

It would be nice to at least build an infrastructure for detecting stack overflow for Rust code.

ASLR and "malloc returned something that is in RVM address space"

When executing rvm, there is a 50% chance that the error message "malloc returned something that is in RVM address space" will appear. For example:

$ ./dist/RBaseBaseSemiSpace_x86_64_m32-linux/rvm 
malloc returned something that is in RVM address space: 0x661c9360
malloc returned something that is in RVM address space: 0x661c93b0
malloc returned something that is in RVM address space: 0x661c93d0
[2024-02-01T09:10:06Z INFO  mmtk::memory_manager] Initialized MMTk with SemiSpace (FixedHeapSize(104857600))
malloc returned something that is in RVM address space: 0x661d1400
malloc returned something that is in RVM address space: 0x661d2510
malloc returned something that is in RVM address space: 0x661f40a0
malloc returned something that is in RVM address space: 0x661f40f0
malloc returned something that is in RVM address space: 0x661f4170
malloc returned something that is in RVM address space: 0x661f41c0
malloc returned something that is in RVM address space: 0x661f4210
malloc returned something that is in RVM address space: 0x661f4260
...
malloc returned something that is in RVM address space: 0x661ff8f0
malloc returned something that is in RVM address space: 0x661f15e0
malloc returned something that is in RVM address space: 0x661f15e0
malloc returned something that is in RVM address space: 0x661ff930
malloc returned something that is in RVM address space: 0x661ff930
malloc returned something that is in RVM address space: 0x661ff8f0
malloc returned something that is in RVM address space: 0x661ff8f0
malloc returned something that is in RVM address space: 0x661ff8f0
malloc returned something that is in RVM address space: 0x661ff8f0
vm: Please specify a class to execute.
vm:   You can invoke the VM with the "-help" flag for usage information.

It seems to be related to address space layout randomization (ASLR). If I turn ASLR off using setarch -R, the error message disappears.

$ setarch -R ./dist/RBaseBaseSemiSpace_x86_64_m32-linux/rvm 
[2024-02-01T09:18:04Z INFO  mmtk::memory_manager] Initialized MMTk with SemiSpace (FixedHeapSize(104857600))
vm: Please specify a class to execute.
vm:   You can invoke the VM with the "-help" flag for usage information.

So it may be related to the way malloc and mmtk-core manages the address space. I am not sure whether it is related to a random failure like this:

rvm -jar dacapo-2006-10-MR2.jar lusearch
malloc returned something that is in RVM address space: 0x615a5370
malloc returned something that is in RVM address space: 0x615a53c0
malloc returned something that is in RVM address space: 0x615a53e0
[2024-02-01T09:03:00Z INFO  mmtk::memory_manager] Initialized MMTk with SemiSpace (FixedHeapSize(104857600))
JikesRVM: Unhandled opcode 0x8e during decoding of instruction at 60610a00, stopped decoding

Fatal error: NullPointerException within uninterruptible region.
trapCode = 0
trapInfo = 0x00000000
Exiting virtual machine due to uninterruptibility violation.
Thread #1
-- Stack --
(0x6145a530 14268)   at [0x6145a530, 0x64360dbf] Lorg/jikesrvm/VM; sysFail(Ljava/lang/String;)V at line 2455 at bytecode index 14 at machine code offset 0x0000004c
(0x6145a56c 2945)   at [0x6145a56c, 0x00000000] Lorg/jikesrvm/runtime/RuntimeEntrypoints; deliverHardwareException(ILorg/vmmagic/unboxed/Word;)V at line 780 at bytecode index 368 at machine code offset 0x0000041b
   at [0x6145a580, 0x00000000] <native frame>
   at [0x61462b64, 0x64253682] <native frame>
(0x61462ba8 3100)   at [0x61462ba8, 0x642132e2] Lorg/jikesrvm/runtime/SysCall; sysAlloc(Lorg/vmmagic/unboxed/Address;IIII)Lorg/vmmagic/unboxed/Address; at line 270 at bytecode index 8 at machine code offset 0x00000052
(0x61462bec 8929)   at [0x61462bec, 0x64213401] Lorg/jikesrvm/mm/mminterface/MMTkMutatorContext; slowPath(IIII)Lorg/vmmagic/unboxed/Address; at line 379 at bytecode index 22 at machine code offset 0x00000062
(0x61462c4c 8928)   at [0x61462c4c, 0x64214f58] Lorg/jikesrvm/mm/mminterface/MMTkMutatorContext; bumpAllocatorFastPath(IIIII)Lorg/vmmagic/unboxed/Address; at line 367 at bytecode index 111 at machine code offset 0x00000101
(0x61462c98 8925)   at [0x61462c98, 0x64370d04] Lorg/jikesrvm/mm/mminterface/MMTkMutatorContext; alloc(IIIII)Lorg/vmmagic/unboxed/Address; at line 331 at bytecode index 38 at machine code offset 0x000000c8
(0x61462ce0 3404)   at [0x61462ce0, 0x64371038] Lorg/jikesrvm/mm/mminterface/MemoryManager; allocateSpace(Lorg/jikesrvm/mm/mminterface/Selected$Mutator;IIIII)Lorg/vmmagic/unboxed/Address; at line 729 at bytecode index 16 at machine code offset 0x0000006c
(0x61462d30 3400)   at [0x61462d30, 0x6436216f] Lorg/jikesrvm/mm/mminterface/MemoryManager; allocateScalar(ILorg/jikesrvm/objectmodel/TIB;IIII)Ljava/lang/Object; at line 629 at bytecode index 29 at machine code offset 0x00000094
(0x61462d7c 2931)   at [0x61462d7c, 0x64371fa6] Lorg/jikesrvm/runtime/RuntimeEntrypoints; resolvedNewScalar(ILorg/jikesrvm/objectmodel/TIB;ZIIII)Ljava/lang/Object; at line 330 at bytecode index 9 at machine code offset 0x0000006f
(0x61462db4 3377)   at [0x61462db4, 0x6436d583] Lorg/jikesrvm/mm/mminterface/MemoryManager; boot(Lorg/jikesrvm/runtime/BootRecord;)V at line 208 at bytecode index 100 at machine code offset 0x0000018a
(0x61462dd8 14091)   at [0x61462dd8, 0x6436e0ad] Lorg/jikesrvm/VM; finishBooting()V at line 202 at bytecode index 57 at machine code offset 0x000000db
(0x61462df0 14090)   at [0x61462df0, 0xf07377e0] Lorg/jikesrvm/VM; boot()V at line 172 at bytecode index 103 at machine code offset 0x00000115
********************************************************************************
*                      Abnormal termination of Jikes RVM                       *
* Jikes RVM terminated abnormally indicating a problem in the virtual machine. *
* Jikes RVM relies on community support to get debug information. Help improve *
* Jikes RVM for everybody by reporting this error. Please see:                 *
*                    http://www.jikesrvm.org/ReportingBugs/                    *
********************************************************************************
JikesRVM: Failing instruction starting at f0753b5b wasn't in RVM address space
JikesRVM: unexpected hardware trap outside of RVM address space - 0xf0753b5b (nil)
fault address 0x67a4e738
eip           0xf0753b5b
eax (T0)      0x6145a35c
ebx (ctrs)    0xf077ea30
ecx (S0)      0x1f
edx (T1)      0x6060e1a4
esi (TR)      (nil)
edi (S1)      0x67a4e738
ebp           0x7c967e3f
esp (SP)      0x6145a300
cs            0x23
ds            0x2b
es            0x2b
fs            (nil)
gs            0x63
ss            0x2b
trapno        0x0000000e
err           0x00000004
eflags        0x00010206
fpregs        0x615aba50
oldmask       0x00000000
cr2           0x67a4e738
attempting to dump proc map ...
3c000000-3d000000 rwxp 00000000 00:00 0 
60000000-61493000 rwxp 00000000 103:03 98456302                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/RVM.data.image
615a5000-615e8000 rw-p 00000000 00:00 0                                  [heap]
64000000-64375000 rwxp 00000000 103:03 98456301                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/RVM.code.image
67000000-67054000 r--p 00000000 103:03 98456304                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/RVM.rmap.image
ef600000-ef881000 rw-p 00000000 00:00 0 
efa00000-efa22000 r--p 00000000 103:02 1478230                           /usr/lib32/libc.so.6
efa22000-efba4000 r-xp 00022000 103:02 1478230                           /usr/lib32/libc.so.6
efba4000-efc1f000 r--p 001a4000 103:02 1478230                           /usr/lib32/libc.so.6
efc1f000-efc21000 r--p 0021e000 103:02 1478230                           /usr/lib32/libc.so.6
efc21000-efc22000 rw-p 00220000 103:02 1478230                           /usr/lib32/libc.so.6
efc22000-efc27000 rw-p 00000000 00:00 0 
efdd7000-efdda000 r--p 00000000 103:02 1478404                           /usr/lib32/libgcc_s.so.1
efdda000-efdf9000 r-xp 00003000 103:02 1478404                           /usr/lib32/libgcc_s.so.1
efdf9000-efdfe000 r--p 00022000 103:02 1478404                           /usr/lib32/libgcc_s.so.1
efdfe000-efdff000 r--p 00027000 103:02 1478404                           /usr/lib32/libgcc_s.so.1
efdff000-efe00000 rw-p 00028000 103:02 1478404                           /usr/lib32/libgcc_s.so.1
efe00000-efe29000 r--p 00000000 103:03 98456347                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libmmtk.so
efe29000-f03fa000 r-xp 00029000 103:03 98456347                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libmmtk.so
f03fa000-f05bf000 r--p 005fa000 103:03 98456347                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libmmtk.so
f05bf000-f05f0000 r--p 007bf000 103:03 98456347                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libmmtk.so
f05f0000-f05f1000 rw-p 007f0000 103:03 98456347                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libmmtk.so
f05f1000-f05f2000 rw-p 00000000 00:00 0 
f060e000-f0610000 rw-p 00000000 00:00 0 
f0610000-f061d000 r--p 00000000 103:02 1478240                           /usr/lib32/libm.so.6
f061d000-f06ab000 r-xp 0000d000 103:02 1478240                           /usr/lib32/libm.so.6
f06ab000-f06e2000 r--p 0009b000 103:02 1478240                           /usr/lib32/libm.so.6
f06e2000-f06e3000 r--p 000d1000 103:02 1478240                           /usr/lib32/libm.so.6
f06e3000-f06e4000 rw-p 000d2000 103:02 1478240                           /usr/lib32/libm.so.6
f0729000-f072c000 r--p 00000000 103:03 98456345                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libjvm.so
f072c000-f0739000 r-xp 00003000 103:03 98456345                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libjvm.so
f0739000-f0740000 r--p 00010000 103:03 98456345                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libjvm.so
f0740000-f0741000 r--p 00016000 103:03 98456345                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libjvm.so
f0741000-f0742000 rw-p 00017000 103:03 98456345                          /home/wks/projects/mmtk-github/parallels/feature/fork/jikesrvm/dist/RBaseBaseSemiSpace_x86_64_m32-linux/libjvm.so
f0742000-f0744000 rw-p 00000000 00:00 0 
f0744000-f0748000 r--p 00000000 00:00 0                                  [vvar]
f0748000-f074a000 r-xp 00000000 00:00 0                                  [vdso]
f074a000-f074b000 r--p 00000000 103:02 1478123                           /usr/lib32/ld-linux.so.2
f074b000-f076e000 r-xp 00001000 103:02 1478123                           /usr/lib32/ld-linux.so.2
f076e000-f077c000 r--p 00024000 103:02 1478123                           /usr/lib32/ld-linux.so.2
f077c000-f077e000 r--p 00031000 103:02 1478123                           /usr/lib32/ld-linux.so.2
f077e000-f077f000 rw-p 00033000 103:02 1478123                           /usr/lib32/ld-linux.so.2
ffbc8000-ffbea000 rw-p 00000000 00:00 0                                  [stack]

Random stuck in eclipse

JikesRVM may randomly get stuck in eclipse (maybe in other benchmarks as well).

  • After the workpacket refactoring, it happens more frequently.
  • With 1 GC thread, it almost always happens.

Failing instruction is not in RVM space

It is a random bug. I think I have seen it a few times before. The most recent occurrence before this issue was the run for the PR: mmtk/mmtk-core#381. But I don't think it is introduced by the PR.

./dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/rvm -X:gc:threads=16 -Xms75M -Xmx75M -jar benchmarks/dacapo-2006-10-MR2.jar lusearch
===== DaCapo lusearch starting =====
4 query batches completed
8 query batches completed
12 query batches completed
16 query batches completed
20 query batches completed
24 query batches completed
28 query batches completed
32 query batches completed
JikesRVM: Failing instruction starting at f7e22030 wasn't in RVM address space
00400000-00800000 rwxp 00000000 00:00 0 
JikesRVM: unexpected hardware trap outside of RVM address space - 0xf7e22030 0x300
2b000000-2b800000 rwxp 00000000 00:00 0 
fault address 0x3b7a0300
37800000-38000000 rwxp 00000000 00:00 0 
eip           0xf7e22030
3b400000-3c000000 rwxp 00000000 00:00 0 
eax (T0)      0x1b380000
3ec00000-3f000000 rwxp 00000000 00:00 0 
ebx (ctrs)    0xf7ef5eb0
56567000-5656c000 r-xp 00000000 08:01 1568092                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
ecx (S0)      0xd9f0003c
5656c000-5656d000 r-xp 00004000 08:01 1568092                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
edx (T1)      0xf7ef0101
5656d000-5656e000 rwxp 00005000 08:01 1568092                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
esi (TR)      0x300
57878000-5908c000 rwxp 00000000 00:00 0                                  [heap]
edi (S1)      0x6957800c
60000000-62174000 rwxp 00000000 08:01 1568028                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.data.image
ebp           0x68d09ba8
64000000-6521a000 rwxp 00000000 08:01 1568027                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.code.image
esp (SP)      0x68d09ba4
67000000-67074000 r-xp 00000000 08:01 1568030                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.rmap.image
cs            0x23
68000000-69c00000 rwxp 00000000 00:00 0 
ds            0x2b
ba100000-ba1f5000 rwxp 00000000 00:00 0 
es            0x2b
ba1f5000-ba200000 ---p 00000000 00:00 0 
fs            (nil)
ba200000-ba235000 rwxp 00000000 00:00 0 
gs            0x63
ba235000-ba300000 ---p 00000000 00:00 0 
ss            0x2b
ba300000-ba3ff000 rwxp 00000000 00:00 0 
trapno        0x0000000e
ba3ff000-ba400000 ---p 00000000 00:00 0 
err           0x00000006
ba400000-ba500000 rwxp 00000000 00:00 0 
eflags        0x00010206
ba500000-ba5fd000 rwxp 00000000 00:00 0 
fpregs        0xf571ca90
ba5fd000-ba600000 ---p 00000000 00:00 0 
oldmask       0x00020000
ba600000-ba6fe000 rwxp 00000000 00:00 0 
cr2           0x3b7a0300
ba6fe000-ba700000 ---p 00000000 00:00 0 
attempting to dump proc map ...
ba700000-ba800000 rwxp 00000000 00:00 0 
ba800000-ba8fe000 rwxp 00000000 00:00 0 
ba8fe000-ba900000 ---p 00000000 00:00 0 
ba900000-baa00000 rwxp 00000000 00:00 0 
baa00000-bab00000 rwxp 00000000 00:00 0 
bab00000-bac00000 rwxp 00000000 00:00 0 
bac00000-bad00000 rwxp 00000000 00:00 0 
bad00000-bae00000 rwxp 00000000 00:00 0 
bae00000-baf00000 rwxp 00000000 00:00 0 
baf00000-bb000000 rwxp 00000000 00:00 0 
bb000000-bb100000 rwxp 00000000 00:00 0 
bb100000-bb200000 rwxp 00000000 00:00 0 
bb200000-bb300000 rwxp 00000000 00:00 0 
bb300000-bb400000 rwxp 00000000 00:00 0 
bb400000-bb500000 rwxp 00000000 00:00 0 
bb500000-bb600000 rwxp 00000000 00:00 0 
bb600000-bb700000 rwxp 00000000 00:00 0 
bb700000-bb800000 rwxp 00000000 00:00 0 
bb800000-bb900000 rwxp 00000000 00:00 0 
bb900000-bba00000 rwxp 00000000 00:00 0 
bba00000-bbb00000 rwxp 00000000 00:00 0 
bbb00000-bbc00000 rwxp 00000000 00:00 0 
bbc00000-bbd00000 rwxp 00000000 00:00 0 
bbd00000-bbe00000 rwxp 00000000 00:00 0 
bbe00000-bbf00000 rwxp 00000000 00:00 0 
bbf00000-bc000000 rwxp 00000000 00:00 0 
bc000000-bc100000 rwxp 00000000 00:00 0 
bc100000-bc300000 rwxp 00000000 00:00 0 
bc300000-bc400000 rwxp 00000000 00:00 0 
bc400000-bc500000 rwxp 00000000 00:00 0 
bc500000-bc600000 rwxp 00000000 00:00 0 
bc600000-bc700000 rwxp 00000000 00:00 0 
bc700000-bc800000 rwxp 00000000 00:00 0 
d08f4000-d08f5000 ---p 00000000 00:00 0 
d08f5000-d18f5000 rwxp 00000000 00:00 0 
d48f8000-d48f9000 ---p 00000000 00:00 0 
d48f9000-d58f9000 rwxp 00000000 00:00 0 
d9f00000-d9fb9000 rwxp 00000000 00:00 0 
d9fb9000-da000000 ---p 00000000 00:00 0 
da100000-da300000 rwxp 00000000 00:00 0 
da300000-da500000 rwxp 00000000 00:00 0 
da500000-da700000 rwxp 00000000 00:00 0 
da700000-da900000 rwxp 00000000 00:00 0 
da900000-dab00000 rwxp 00000000 00:00 0 
dab00000-dad00000 rwxp 00000000 00:00 0 
dad00000-daf00000 rwxp 00000000 00:00 0 
daf00000-db100000 rwxp 00000000 00:00 0 
db100000-db300000 rwxp 00000000 00:00 0 
db300000-db500000 rwxp 00000000 00:00 0 
db500000-db700000 rwxp 00000000 00:00 0 
db700000-db900000 rwxp 00000000 00:00 0 
db900000-dbb00000 rwxp 00000000 00:00 0 
dbb00000-dbd00000 rwxp 00000000 00:00 0 
dbd00000-dbf00000 rwxp 00000000 00:00 0 
dbf00000-dc100000 rwxp 00000000 00:00 0 
dc100000-dc300000 rwxp 00000000 00:00 0 
dc300000-dc500000 rwxp 00000000 00:00 0 
dc500000-dc6fd000 rwxp 00000000 00:00 0 
dc6fd000-dc700000 ---p 00000000 00:00 0 
dc700000-dc900000 rwxp 00000000 00:00 0 
dc900000-dcb00000 rwxp 00000000 00:00 0 
dcb00000-dcd00000 rwxp 00000000 00:00 0 
dcd00000-dcf00000 rwxp 00000000 00:00 0 
dcf00000-dd100000 rwxp 00000000 00:00 0 
dd100000-dd300000 rwxp 00000000 00:00 0 
dd300000-dd400000 rwxp 00000000 00:00 0 
dd4e8000-dd4e9000 ---p 00000000 00:00 0 
dd4e9000-de4e9000 rwxp 00000000 00:00 0 
de4e9000-de4ea000 ---p 00000000 00:00 0 
de4ea000-df4ea000 rwxp 00000000 00:00 0 
df4ea000-df4eb000 ---p 00000000 00:00 0 
df4eb000-e04eb000 rwxp 00000000 00:00 0 
e04eb000-e04ec000 ---p 00000000 00:00 0 
e04ec000-e14ec000 rwxp 00000000 00:00 0 
e14ec000-e14ed000 ---p 00000000 00:00 0 
e14ed000-e24ed000 rwxp 00000000 00:00 0 
e24ed000-e24ee000 ---p 00000000 00:00 0 
e24ee000-e34ee000 rwxp 00000000 00:00 0 
e34ee000-e34ef000 ---p 00000000 00:00 0 
e34ef000-e44ef000 rwxp 00000000 00:00 0 
e44ef000-e44f0000 ---p 00000000 00:00 0 
e44f0000-e54f0000 rwxp 00000000 00:00 0 
e54f0000-e54f1000 ---p 00000000 00:00 0 
e54f1000-e64f1000 rwxp 00000000 00:00 0 
e64f1000-e64f2000 ---p 00000000 00:00 0 
e64f2000-e74f2000 rwxp 00000000 00:00 0 
e74f2000-e74f3000 ---p 00000000 00:00 0 
e74f3000-e84f3000 rwxp 00000000 00:00 0 
e84f3000-e84f4000 ---p 00000000 00:00 0 
e84f4000-e94f4000 rwxp 00000000 00:00 0 
e94f4000-e94f5000 ---p 00000000 00:00 0 
e94f5000-ea4f5000 rwxp 00000000 00:00 0 
ea4f5000-ea4f6000 ---p 00000000 00:00 0 
ea4f6000-eb4f6000 rwxp 00000000 00:00 0 
eb4f6000-eb4f7000 ---p 00000000 00:00 0 
eb4f7000-ec4f7000 rwxp 00000000 00:00 0 
ec4f7000-ec4f8000 ---p 00000000 00:00 0 
ec4f8000-ed4f8000 rwxp 00000000 00:00 0 
ed4f8000-ed4f9000 ---p 00000000 00:00 0 
ed4f9000-ee4f9000 rwxp 00000000 00:00 0 
ee4f9000-ee4fa000 ---p 00000000 00:00 0 
ee4fa000-ef4fa000 rwxp 00000000 00:00 0 
ef4fa000-ef4fb000 ---p 00000000 00:00 0 
ef4fb000-f04fb000 rwxp 00000000 00:00 0 
f04fb000-f04fc000 ---p 00000000 00:00 0 
f04fc000-f14fc000 rwxp 00000000 00:00 0 
f14fc000-f14fd000 ---p 00000000 00:00 0 
f14fd000-f24fd000 rwxp 00000000 00:00 0 
f24fd000-f24fe000 ---p 00000000 00:00 0 
f24fe000-f34fe000 rwxp 00000000 00:00 0 
f34fe000-f34ff000 ---p 00000000 00:00 0 
f34ff000-f44ff000 rwxp 00000000 00:00 0 
f44ff000-f4500000 ---p 00000000 00:00 0 
f4500000-f5500000 rwxp 00000000 00:00 0 
f5500000-f5600000 rwxp 00000000 00:00 0 
f5600000-f5700000 rwxp 00000000 00:00 0 
f5700000-f5800000 rwxp 00000000 00:00 0 
f583d000-f584d000 r-xp 00000000 08:01 1568090                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavanio.so
f584d000-f584e000 r-xp 0000f000 08:01 1568090                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavanio.so
f584e000-f584f000 rwxp 00010000 08:01 1568090                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavanio.so
f584f000-f5850000 rwxp 00000000 00:00 0 
f5850000-f586a000 r-xp 00000000 08:01 1568086                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavalang.so
f586a000-f586b000 r-xp 00019000 08:01 1568086                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavalang.so
f586b000-f586c000 rwxp 0001a000 08:01 1568086                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavalang.so
f586c000-f586d000 rwxp 00000000 00:00 0 
f586d000-f586e000 ---p 00000000 00:00 0 
f586e000-f686e000 rwxp 00000000 00:00 0 
f686e000-f686f000 ---p 00000000 00:00 0 
f686f000-f7ab2000 rwxp 00000000 00:00 0 
f7ab2000-f7ab5000 r-xp 00000000 08:01 5677065                            /lib32/libdl-2.27.so
f7ab5000-f7ab6000 r-xp 00002000 08:01 5677065                            /lib32/libdl-2.27.so
f7ab6000-f7ab7000 rwxp 00003000 08:01 5677065                            /lib32/libdl-2.27.so
f7ab7000-f7b80000 r-xp 00000000 08:01 5677066                            /lib32/libm-2.27.so
f7b80000-f7b81000 r-xp 000c8000 08:01 5677066                            /lib32/libm-2.27.so
f7b81000-f7b82000 rwxp 000c9000 08:01 5677066                            /lib32/libm-2.27.so
f7b82000-f7b9d000 r-xp 00000000 08:01 5677076                            /lib32/libpthread-2.27.so
f7b9d000-f7b9e000 r-xp 0001a000 08:01 5677076                            /lib32/libpthread-2.27.so
f7b9e000-f7b9f000 rwxp 0001b000 08:01 5677076                            /lib32/libpthread-2.27.so
f7b9f000-f7ba1000 rwxp 00000000 00:00 0 
f7ba1000-f7ba9000 r-xp 00000000 08:01 5677078                            /lib32/librt-2.27.so
f7ba9000-f7baa000 r-xp 00007000 08:01 5677078                            /lib32/librt-2.27.so
f7baa000-f7bab000 rwxp 00008000 08:01 5677078                            /lib32/librt-2.27.so
f7bab000-f7bc7000 r-xp 00000000 08:01 1053000                            /usr/lib32/libgcc_s.so.1
f7bc7000-f7bc8000 r-xp 0001b000 08:01 1053000                            /usr/lib32/libgcc_s.so.1
f7bc8000-f7bc9000 rwxp 0001c000 08:01 1053000                            /usr/lib32/libgcc_s.so.1
f7bc9000-f7d9b000 r-xp 00000000 08:01 5677062                            /lib32/libc-2.27.so
f7d9b000-f7d9c000 ---p 001d2000 08:01 5677062                            /lib32/libc-2.27.so
f7d9c000-f7d9e000 r-xp 001d2000 08:01 5677062                            /lib32/libc-2.27.so
f7d9e000-f7d9f000 rwxp 001d4000 08:01 5677062                            /lib32/libc-2.27.so
f7d9f000-f7da2000 rwxp 00000000 00:00 0 
f7da5000-f7daf000 r-xp 00000000 08:01 1568085                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavaio.so
f7daf000-f7db0000 r-xp 00009000 08:01 1568085                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavaio.so
f7db0000-f7db1000 rwxp 0000a000 08:01 1568085                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavaio.so
f7db1000-f7db2000 rwxp 00000000 00:00 0 
f7db2000-f7db3000 r-xp 00000000 08:01 1568094                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm_jni.so
f7db3000-f7db4000 r-xp 00000000 08:01 1568094                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm_jni.so
f7db4000-f7db5000 rwxp 00001000 08:01 1568094                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm_jni.so
f7db5000-f7eef000 r-xp 00000000 08:01 1568095                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
f7eef000-f7ef6000 r-xp 00139000 08:01 1568095                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
f7ef6000-f7ef7000 rwxp 00140000 08:01 1568095                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
f7ef7000-f7ef8000 rwxp 00000000 00:00 0 
f7ef8000-f7f0e000 r-xp 00000000 08:01 1568093                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
f7f0e000-f7f0f000 r-xp 00015000 08:01 1568093                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
f7f0f000-f7f10000 rwxp 00016000 08:01 1568093                            /home/runner/work/mmtk-core/mmtk-core/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
f7f10000-f7f12000 rwxp 00000000 00:00 0 
f7f12000-f7f15000 r--p 00000000 00:00 0                                  [vvar]
f7f15000-f7f16000 r-xp 00000000 00:00 0                                  [vdso]
f7f16000-f7f3c000 r-xp 00000000 08:01 5677058                            /lib32/ld-2.27.so
f7f3c000-f7f3d000 r-xp 00025000 08:01 5677058                            /lib32/ld-2.27.so
f7f3d000-f7f3e000 rwxp 00026000 08:01 5677058                            /lib32/ld-2.27.so
ff7eb000-ff80d000 rwxp 00000000 00:00 0                                  [stack]

Use JikesRVM-specific weak reference processing and finalisation mechanism

Parent issue: mmtk/mmtk-core#694

The task

When we rewrote JikesRVM's MMTk in Rust, we also reimplemented its weak reference and finalisation processors, namely ReferenceProcessor and FinalizableProcessor, in Rust, and included them in mmtk-core (See reference_processor.rs and finalizable_processor.rs). Currently, both mmtk-openjdk and mmtk-jikesrvm use the ref/final processors in mmtk-core.

We later decided that this approach is problematic. The main reason is that it is not general enough for languages other than Java. See mmtk/mmtk-core#694 for details.

We have designed a general language-neutral weak reference processing API, and have included it in mmtk-core (See: mmtk/mmtk-core#700). The existing ref/final processors in mmtk-core are deprecated for removal.

Now, we should implement the reference/finalisation processors in the mmtk-jikesrvm or jikesrvm repository in a JikesRVM-specific manner.

Reuse the Rust implementation or bridge with the Java implementation?

There are two ways to implement ref/final processors for mmtk-jikesrvm.

  1. Copy and paste the ref/final processors from the mmtk-core repository to mmtk-jikesrvm and make changes to adapt to the new API.
  2. Connect the new API to JikesRVM's existing ReferenceProcessor and FinalizableProcessor written in Java.

I once tried method (1) for mmtk-openjdk for the purpose of testing whether the new language-neutral weak reference processing API is general enough for Java. It worked. It showed that the API is general enough to support Java, and it only requires a minimum amount of changes to make the ref/final processors working in the VM binding repo (mmtk-openjdk). It should be just as easy to do the same for JikesRVM.

However, because the ref/final processors are rewritten in Rust, it behaves differently from the existing ref/final processors in JikesRVM written in Java. This is bad because if we compare the vanilla JikesRVM (using its own MMTk written in Java) against JikesRVM with Rust MMTk, the two VMs will be using two different ref/final processor implementations. That's not an apple-to-apple comparison. Any performance advantage or disadvantage shown in the comparison may not be the result of using the Rust MMTk as the GC, but the result of different ref/final processor implementations.

It is therefore more advisable to use the existing Java version of ref/final processor in JikesRVM.

More details

The main part of the new API is the Scanning::process_weak_refs function which the VM binding should implement. It is executed after the first transitive closure is computed (i.e. after all strongly reachable objects are visited), and allows the VM binding to (1) query if any object is live and (2) add any object to the transitive closure. JikesRVM's existing ReferenceProcessor.scan method relies on the TraceLocal argument for those capabilities. We probably need to provide a TraceLocal implementation to provide those capabilities to the Java code.

Java has multiple reference strengths (soft/weak/final/phantom references). My previous work demonstrated a way to build a state machine to handle soft/weak/final/phantom references while expanding the transitive closure multiple times. (See: https://github.com/wks/mmtk-openjdk/blob/gen-weakref-api/mmtk/src/weak_processor/mod.rs).

Call trace_object on an empty space

I started to see this error in #101

This is potentially a bug introduced by MMTk SFT trace object: mmtk/mmtk-core@e85d997

++ ./dist/RFastAdaptiveSemiSpace_x86_64_m32-linux/rvm -Xms200M -Xmx200M -jar /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/.github/scripts/../../repos/jikesrvm/dacapo/dacapo-2006-10-MR2.jar hsqldb
===== DaCapo hsqldb starting =====
*********************************************************
* PseudoJDBCBench v1.1                                  *
*********************************************************

Scale factor value: 64
Number of clients: 20
Number of transactions per client: 40

Initializing dataset...DBMS: HSQL Database Engine
In transaction mode
	80000	 records inserted
	160000	 records inserted
	240000	 records inserted
	320000	 records inserted
	400000	 records inserted
	480000	 records inserted
	560000	 records inserted
	640000	 records inserted
done.

* Starting Benchmark Run *
thread '<unnamed>' panicked at 'Call trace_object() on 72400000, which maps to an empty space', /home/runner/.cargo/git/checkouts/mmtk-core-3306bdeb8eb4322b/dbd152b/src/policy/space.rs:156:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
./.github/scripts/ci-test-normal.sh: line 36: 26540 Aborted                 (core dumped) ./dist/RFastAdaptiveSemiSpace_x86_64_m32-linux/rvm $RVM_OPTIONS -Xms200M -Xmx200M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar hsqldb

Clean up warnings

The rust compilation should not produce warnings when the repo is in a clean state. The current warnings need to be fixed.

Random fail in lusearch

This error appeared multiple times in our binding test with the following revisions:

binding: 3be34fc
mmtk-core: 2892dee7160384cf47f8bd7f55a023a85d243fd9

++ ./dist/RFastAdaptiveSemiSpace_x86_64-linux/rvm -Xms75M -Xmx75M -jar benchmarks/dacapo-2006-10-MR2.jar lusearch
===== DaCapo lusearch starting =====
4 query batches completed
free(): invalid pointer

CI random fail in lusearch

We saw this fail in luserach running on CI (rust nightly 1.39), but a rerun was fine. This seems to be a random fail.

./dist/RFastAdaptiveSemiSpace_x86_64-linux/rvm -Xms75M -Xmx75M -jar benchmarks/dacapo-2006-10-MR2.jar lusearch
===== DaCapo lusearch starting =====
4 query batches completed
double free or corruption (out)

However, the same revision of the binding works consistently on our dev machines (rust nightly 1.44).

We should keep an eye on whether this error occurs again, and whether this error would occur after we upgrade rust version on our CI.

[ospp][wip] Use the new weak reference processing API for the JikesRVM binding

this issue is tracking the weekly update on this project. also, mmtk@zulipchat has a sub-channel for this project discussion.

Motivation

shortly, porting the java-style jikesRVM to rust-lang is straightforward, but the reference processing is java-specific.
say, we expected a more general reference processing if we want to move forward to another language or gc mechanism.

Milestone

  • Compile and familiar code base
  • Refactor the weak ref handling mechanism
  • Run DaCapo benchmark and analyze the perf result
  • With previous perf result to optimize the current impl
  • Verify the impl correctness on CI
  • Write a doc

reference

#137
mmtk/mmtk-core#694
https://summer-ospp.ac.cn/org/prodetail/235730136

validRef() is incorrectly implemented

The Rust implementation of MemoryManager.validRef() does not perform the checks that the original version does. Specifically, the original version checks the integrity of the referenced object (according to the JikesRVM object model -- ie that the TIB is sound, etc), which the Rust version is not doing.

The only part that should be Rust-MMTk-specific is the check to see whether the referent object is in a currently mapped space. The remaining logic (checking the TIB etc) should be executed for both cases since it has nothing to do with the memory manager.

Failing instruction starting at xxxxx wasn't in RVM address space

I saw a failed CI run for the PR #105 after merging master with this PR: https://github.com/mmtk/mmtk-jikesrvm/runs/5825456121?check_suite_focus=true. After a rerun, it passed.

I don't think this is related to the PR, and it is very hard to reproduce the issue. I have run the same command for the PR and for the master 896a3dc for 200 runs, and they all succeeded.

Failing instruction starting at xxxxx wasn't in RVM address space usually means a segfault in the Rust code.

./dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/rvm -Xms75M -Xmx75M -jar /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/.github/scripts/../../repos/jikesrvm/dacapo/dacapo-2006-10-MR2.jar luindex
===== DaCapo luindex starting =====
adding luindex/william/README
adding luindex/william/comedies/allswellthatendswell
adding luindex/william/comedies/asyoulikeit
adding luindex/william/comedies/comedyoferrors
adding luindex/william/comedies/cymbeline
adding luindex/william/comedies/loveslabourslost
adding luindex/william/comedies/measureforemeasure
adding luindex/william/comedies/merchantofvenice
adding luindex/william/comedies/merrywivesofwindsor
adding luindex/william/comedies/midsummersnightsdream
adding luindex/william/comedies/muchadoaboutnothing
adding luindex/william/comedies/periclesprinceoftyre
JikesRVM: Failing instruction starting at f7cb6910 wasn't in RVM address space
JikesRVM: unexpected hardware trap outside of RVM address space - 0xf7cb6910 0x597fffec
fault address 0xb2ffffe0
eip           0xf7cb6910
eax (T0)      (nil)
ebx (ctrs)    0x597fffec
ecx (S0)      0x597fff05
edx (T1)      0x597ffff0
esi (TR)      0x597fffec
edi (S1)      0x597ffff4
ebp           0x68d097a8
esp (SP)      0x68d09730
cs            0x23
ds            0x2b
es            0x2b
fs            (nil)
gs            0x63
ss            0x2b
trapno        0x0000000e
err           0x00000004
eflags        0x00010246
fpregs        0x5887dc10
oldmask       0x00020000
cr2           0xb2ffffe0
attempting to dump proc map ...
12800000-13800000 rwxp 00000000 00:00 0 
17800000-17c00000 rwxp 00000000 00:00 0 
18000000-18400000 rwxp 00000000 00:00 0 
3ac00000-3b800000 rwxp 00000000 00:00 0 
4e800000-4ec00000 rwxp 00000000 00:00 0 
56633000-56638000 r-xp 00000000 08:01 2358757                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
56638000-56639000 r-xp 00004000 08:01 2358757                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
56639000-5663a000 rwxp 00005000 08:01 2358757                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
57884000-5b970000 rwxp 00000000 00:00 0                                  [heap]
60000000-62177000 rwxp 00000000 08:01 2358685                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.data.image
64000000-6521a000 rwxp 00000000 08:01 2358681                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.code.image
67000000-67074000 r-xp 00000000 08:01 2358695                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.rmap.image
68000000-69c00000 rwxp 00000000 00:00 0 
dd4e8000-dd4e9000 ---p 00000000 00:00 0 
dd4e9000-de4e9000 rwxp 00000000 00:00 0 
de4e9000-de4ea000 ---p 00000000 00:00 0 
de4ea000-df4ea000 rwxp 00000000 00:00 0 
df4ea000-df4eb000 ---p 00000000 00:00 0 
df4eb000-e04eb000 rwxp 00000000 00:00 0 
e04eb000-e04ec000 ---p 00000000 00:00 0 
e04ec000-e14ec000 rwxp 00000000 00:00 0 
e14ec000-e14ed000 ---p 00000000 00:00 0 
e14ed000-e24ed000 rwxp 00000000 00:00 0 
e24ed000-e24ee000 ---p 00000000 00:00 0 
e24ee000-e34ee000 rwxp 00000000 00:00 0 
e34ee000-e34ef000 ---p 00000000 00:00 0 
e34ef000-e44ef000 rwxp 00000000 00:00 0 
e44ef000-e44f0000 ---p 00000000 00:00 0 
e44f0000-e54f0000 rwxp 00000000 00:00 0 
e54f0000-e54f1000 ---p 00000000 00:00 0 
e54f1000-e64f1000 rwxp 00000000 00:00 0 
e64f1000-e64f2000 ---p 00000000 00:00 0 
e64f2000-e74f2000 rwxp 00000000 00:00 0 
e74f2000-e74f3000 ---p 00000000 00:00 0 
e74f3000-e84f3000 rwxp 00000000 00:00 0 
e84f3000-e84f4000 ---p 00000000 00:00 0 
e84f4000-e94f4000 rwxp 00000000 00:00 0 
e94f4000-e94f5000 ---p 00000000 00:00 0 
e94f5000-ea4f5000 rwxp 00000000 00:00 0 
ea4f5000-ea4f6000 ---p 00000000 00:00 0 
ea4f6000-eb4f6000 rwxp 00000000 00:00 0 
eb4f6000-eb4f7000 ---p 00000000 00:00 0 
eb4f7000-ec4f7000 rwxp 00000000 00:00 0 
ec4f7000-ec4f8000 ---p 00000000 00:00 0 
ec4f8000-ed4f8000 rwxp 00000000 00:00 0 
ed4f8000-ed4f9000 ---p 00000000 00:00 0 
ed4f9000-ee4f9000 rwxp 00000000 00:00 0 
ee4f9000-ee4fa000 ---p 00000000 00:00 0 
ee4fa000-ef4fa000 rwxp 00000000 00:00 0 
ef4fa000-ef4fb000 ---p 00000000 00:00 0 
ef4fb000-f04fb000 rwxp 00000000 00:00 0 
f04fb000-f04fc000 ---p 00000000 00:00 0 
f04fc000-f14fc000 rwxp 00000000 00:00 0 
f14fc000-f14fd000 ---p 00000000 00:00 0 
f14fd000-f24fd000 rwxp 00000000 00:00 0 
f24fd000-f24fe000 ---p 00000000 00:00 0 
f24fe000-f34fe000 rwxp 00000000 00:00 0 
f34fe000-f34ff000 ---p 00000000 00:00 0 
f34ff000-f44ff000 rwxp 00000000 00:00 0 
f44ff000-f4500000 ---p 00000000 00:00 0 
f4500000-f5500000 rwxp 00000000 00:00 0 
f5500000-f55ae000 rwxp 00000000 00:00 0 
f55ae000-f5600000 ---p 00000000 00:00 0 
f5600000-f56ff000 rwxp 00000000 00:00 0 
f56ff000-f5700000 ---p 00000000 00:00 0 
f5700000-f57d7000 rwxp 00000000 00:00 0 
f57d7000-f5800000 ---p 00000000 00:00 0 
f58af000-f58bf000 r-xp 00000000 08:01 2358755                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavanio.so
f58bf000-f58c0000 r-xp 0000f000 08:01 2358755                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavanio.so
f58c0000-f58c1000 rwxp 00010000 08:01 2358755                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavanio.so
f58c1000-f58c2000 rwxp 00000000 00:00 0 
f58c2000-f58dc000 r-xp 00000000 08:01 2358751                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavalang.so
f58dc000-f58dd000 r-xp 00019000 08:01 2358751                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavalang.so
f58dd000-f58de000 rwxp 0001a000 08:01 2358751                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavalang.so
f58de000-f58df000 rwxp 00000000 00:00 0 
f58df000-f58e0000 ---p 00000000 00:00 0 
f58e0000-f68e0000 rwxp 00000000 00:00 0 
f68e0000-f68e1000 ---p 00000000 00:00 0 
f68e1000-f7b24000 rwxp 00000000 00:00 0 
f7b24000-f7bed000 r-xp 00000000 08:01 4902922                            /lib32/libm-2.27.so
f7bed000-f7bee000 r-xp 000c8000 08:01 4902922                            /lib32/libm-2.27.so
f7bee000-f7bef000 rwxp 000c9000 08:01 4902922                            /lib32/libm-2.27.so
f7bef000-f7c0a000 r-xp 00000000 08:01 4902932                            /lib32/libpthread-2.27.so
f7c0a000-f7c0b000 r-xp 0001a000 08:01 4902932                            /lib32/libpthread-2.27.so
f7c0b000-f7c0c000 rwxp 0001b000 08:01 4902932                            /lib32/libpthread-2.27.so
f7c0c000-f7c0e000 rwxp 00000000 00:00 0 
f7c0e000-f7c16000 r-xp 00000000 08:01 4902934                            /lib32/librt-2.27.so
f7c16000-f7c17000 r-xp 00007000 08:01 4902934                            /lib32/librt-2.27.so
f7c17000-f7c18000 rwxp 00008000 08:01 4902934                            /lib32/librt-2.27.so
f7c18000-f7c34000 r-xp 00000000 08:01 3622477                            /usr/lib32/libgcc_s.so.1
f7c34000-f7c35000 r-xp 0001b000 08:01 3622477                            /usr/lib32/libgcc_s.so.1
f7c35000-f7c36000 rwxp 0001c000 08:01 3622477                            /usr/lib32/libgcc_s.so.1
f7c36000-f7c39000 r-xp 00000000 08:01 4902921                            /lib32/libdl-2.27.so
f7c39000-f7c3a000 r-xp 00002000 08:01 4902921                            /lib32/libdl-2.27.so
f7c3a000-f7c3b000 rwxp 00003000 08:01 4902921                            /lib32/libdl-2.27.so
f7c3b000-f7e0d000 r-xp 00000000 08:01 4902918                            /lib32/libc-2.27.so
f7e0d000-f7e0e000 ---p 001d2000 08:01 4902918                            /lib32/libc-2.27.so
f7e0e000-f7e10000 r-xp 001d2000 08:01 4902918                            /lib32/libc-2.27.so
f7e10000-f7e11000 rwxp 001d4000 08:01 4902918                            /lib32/libc-2.27.so
f7e11000-f7e14000 rwxp 00000000 00:00 0 
f7e17000-f7e21000 r-xp 00000000 08:01 2358750                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavaio.so
f7e21000-f7e22000 r-xp 00009000 08:01 2358750                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavaio.so
f7e22000-f7e23000 rwxp 0000a000 08:01 2358750                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjavaio.so
f7e23000-f7e24000 rwxp 00000000 00:00 0 
f7e24000-f7e25000 r-xp 00000000 08:01 2358759                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm_jni.so
f7e25000-f7e26000 r-xp 00000000 08:01 2358759                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm_jni.so
f7e26000-f7e27000 rwxp 00001000 08:01 2358759                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm_jni.so
f7e27000-f7f67000 r-xp 00000000 08:01 2358760                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
f7f67000-f7f68000 ---p 00140000 08:01 2358760                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
f7f68000-f7f71000 r-xp 00140000 08:01 2358760                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
f7f71000-f7f72000 rwxp 00149000 08:01 2358760                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
f7f72000-f7f73000 rwxp 00000000 00:00 0 
f7f73000-f7f89000 r-xp 00000000 08:01 2358758                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
f7f89000-f7f8a000 r-xp 00015000 08:01 2358758                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
f7f8a000-f7f8b000 rwxp 00016000 08:01 2358758                            /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/repos/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
f7f8b000-f7f8d000 rwxp 00000000 00:00 0 
f7f8d000-f7f90000 r--p 00000000 00:00 0                                  [vvar]
f7f90000-f7f91000 r-xp 00000000 00:00 0                                  [vdso]
f7f91000-f7fb7000 r-xp 00000000 08:01 4902914                            /lib32/ld-2.27.so
f7fb7000-f7fb8000 r-xp 00025000 08:01 4902914                            /lib32/ld-2.27.so
f7fb8000-f7fb9000 rwxp 00026000 08:01 4902914                            /lib32/ld-2.27.so
ffdea000-ffe0c000 rwxp 00000000 00:00 0                                  [stack]

List of functionalities to implement for JikesRVM

In GitLab by @caizixian on Apr 27, 2018, 15:58

  • JMXSupport.getCollectionCount()
  • JMXSupport.getCollectionTime()
  • JMXSupport.fullyBootedVM()
    • Map a space name to its index.
    • Create an array of space names
  • MemoryManager.gc() Force a gc
  • MemoryManager.mightBeFP() Check if the address is in an area that may contain stacks
  • MemoryManager.addressInVM() Checks if an address refers to an in-use area of memory
  • MemoryManager.objectInVM() Checks if a reference refers to an object in an in-use area of memory.
  • MemoryManager.modifyCheck() Make sure that during GC, we don't update on a possibly moving object
  • MemoryManager.isImmortal() whether the object is immortal
  • MemoryManager.gcInProgress()

Random fail in antlr

This error appeared in our binding test since this revision (after migrating Rust to nightly-2020-07-08):

binding: a2dc142
mmtk-core: 45975c6df858bf2e81f9738efe69b012ad8ee675

malloc returned something that is in RVM address space: 0x6a956e70
malloc returned something that is in RVM address space: 0x6a956e70
malloc returned something that is in RVM address space: 0x6a956e70
malloc returned something that is in RVM address space: 0x6a956e70
Running antlr on grammar antlr/java/subc.g
malloc returned something that is in RVM address space: 0x6a956e70
malloc returned something that is in RVM address space: 0x6a956e70
malloc returned something that is in RVM address space: 0x6a956e70
malloc returned something that is in RVM address space: 0x6a956e70
malloc returned something that is in RVM address space: 0x6a956e70
malloc returned something that is in RVM address space: 0x6a956e70
ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
error: grammar TinyCParser not defined
Running antlr on grammar antlr/java/t.g
ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
Running antlr on grammar antlr/java/TinyBasic.g
ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
malloc returned something that is in RVM address space: 0x6a956e70
double free or corruption (out)
./.github/scripts/ci-test.sh: line 26: 29089 Aborted                 (core dumped) ./dist/RFastAdaptiveSemiSpace_x86_64-linux/rvm -Xms75M -Xmx75M -jar benchmarks/dacapo-2006-10-MR2.jar antlr

Use asm! to replace llvm_asm!

llvm_asm! is going to be deprecated soon, and the new asm! (with new syntax) should be used for inline assembly. And asm! will be stabilised. We should migrate to asm! as soon as we can. Currently I am putting a #![allow(deprecated)] to the whole binding crate to allow the clippy warning about deprecated llvm_asm!.

boot image mmap overwrites the JikesRVM executable mapping

The phenomenon is that the process crashes almost immediately after invoking the rvm command. It is very easy to reproduce when using rr. (Note that you need to compile rr from source in order to make rr support the 32-bit x86 architecture on 64-bit OS. Compiling the git head using the default configuration should just work, but the rr from your Linux distro may not have 32-bit support.)

Example 1

In one particular execution, the executable JikesRVM was mapped near address 0x61b4????.

(rr) info proc mappings
process 128175
Mapped address spaces:

        Start Addr   End Addr       Size     Offset  Perms   objfile
        0x61b43000 0x61b44000     0x1000        0x0  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x61b44000 0x61b46000     0x2000     0x1000  r-xp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x61b46000 0x61b48000     0x2000     0x3000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x61b48000 0x61b49000     0x1000     0x4000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x61b49000 0x61b4a000     0x1000     0x5000  rw-p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x62287000 0x622a9000    0x22000        0x0  rw-p   [heap]
        0x68000000 0x68200000   0x200000        0x0  rwxp   
        0x6fffd000 0x70001000     0x4000        0x0  r-xp   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpage_32.so
        0x70001000 0x70002000     0x1000        0x0  rw-s   /tmp/rr-shared-preload_thread_locals-131561-25
        0x70003000 0x70004000     0x1000        0x0  r-xp   
        0x70004000 0x70104000   0x100000        0x0  rw-s   /tmp/rr-shared-syscallbuf.128175-131561-28
        0xe8400000 0xe841e000    0x1e000        0x0  r--p   /usr/lib32/libc.so.6
        0xe841e000 0xe85a0000   0x182000    0x1e000  r-xp   /usr/lib32/libc.so.6
        0xe85a0000 0xe861b000    0x7b000   0x1a0000  r--p   /usr/lib32/libc.so.6
        0xe861b000 0xe861d000     0x2000   0x21a000  r--p   /usr/lib32/libc.so.6
        0xe861d000 0xe861e000     0x1000   0x21c000  rw-p   /usr/lib32/libc.so.6
        0xe861e000 0xe8623000     0x5000        0x0  rw-p   
        0xe8800000 0xe881b000    0x1b000        0x0  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
        0xe881b000 0xe89ce000   0x1b3000    0x1b000  r-xp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
        0xe89ce000 0xe8a9c000    0xce000   0x1ce000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
        0xe8a9c000 0xe8a9d000     0x1000   0x29c000  rw-p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
        0xe8b2c000 0xe8b2e000     0x2000        0x0  rw-p   
        0xe8b2e000 0xe8b31000     0x3000        0x0  r--p   /usr/lib32/libgcc_s.so.1
        0xe8b31000 0xe8b50000    0x1f000     0x3000  r-xp   /usr/lib32/libgcc_s.so.1
        0xe8b50000 0xe8b56000     0x6000    0x22000  r--p   /usr/lib32/libgcc_s.so.1
        0xe8b56000 0xe8b57000     0x1000    0x28000  rw-p   /usr/lib32/libgcc_s.so.1
        0xe8b57000 0xe8b62000     0xb000        0x0  r--p   /usr/lib32/libm.so.6
        0xe8b62000 0xe8bf0000    0x8e000     0xb000  r-xp   /usr/lib32/libm.so.6
        0xe8bf0000 0xe8c27000    0x37000    0x99000  r--p   /usr/lib32/libm.so.6
        0xe8c27000 0xe8c28000     0x1000    0xcf000  r--p   /usr/lib32/libm.so.6
        0xe8c28000 0xe8c29000     0x1000    0xd0000  rw-p   /usr/lib32/libm.so.6
        0xe8c29000 0xe8c2c000     0x3000        0x0  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c2c000 0xe8c39000     0xd000     0x3000  r-xp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c39000 0xe8c40000     0x7000    0x10000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c40000 0xe8c41000     0x1000    0x16000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c41000 0xe8c42000     0x1000    0x17000  rw-p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c42000 0xe8c43000     0x1000        0x0  r--p   /usr/lib32/libdl.so.2
        0xe8c43000 0xe8c44000     0x1000     0x1000  r-xp   /usr/lib32/libdl.so.2
        0xe8c44000 0xe8c45000     0x1000     0x2000  r--p   /usr/lib32/libdl.so.2
        0xe8c45000 0xe8c46000     0x1000     0x2000  r--p   /usr/lib32/libdl.so.2
        0xe8c46000 0xe8c47000     0x1000     0x3000  rw-p   /usr/lib32/libdl.so.2
        0xe8c8c000 0xe8c8d000     0x1000        0x0  r--p   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpreload_32.so
        0xe8c8d000 0xe8c94000     0x7000     0x1000  r-xp   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpreload_32.so
        0xe8c94000 0xe8c98000     0x4000     0x8000  r--p   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpreload_32.so
        0xe8c98000 0xe8c99000     0x1000     0xc000  rw-p   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpreload_32.so
        0xe8c99000 0xe8ca4000     0xb000        0x0  rw-p   
        0xe8ca4000 0xe8ca6000     0x2000        0x0  r-xp   [vdso]
        0xe8ca6000 0xe8ca7000     0x1000        0x0  r--p   /usr/lib32/ld-linux.so.2
        0xe8ca7000 0xe8cca000    0x23000     0x1000  r-xp   /usr/lib32/ld-linux.so.2
        0xe8cca000 0xe8cd8000     0xe000    0x24000  r--p   /usr/lib32/ld-linux.so.2
        0xe8cd8000 0xe8cda000     0x2000    0x31000  r--p   /usr/lib32/ld-linux.so.2
        0xe8cda000 0xe8cdb000     0x1000    0x33000  rw-p   /usr/lib32/ld-linux.so.2
        0xff98f000 0xff9b2000    0x23000        0x0  rw-p   [stack]

Then JikesRVM executed the mmap syscall in mapImageFile to map RVM.data.image. The stack trace is:

(rr) bt
#0  0x70000002 in syscall_traced ()
#1  0xe8c929ad in _raw_syscall () at /home/wks/tocompile/rr/build-release/32/preload/raw_syscall.S:34
#2  0xe8c8dcd3 in traced_raw_syscall (call=call@entry=0x681fffd8) at /home/wks/tocompile/rr/build-release/32/preload/syscallbuf.c:377
#3  0xe8c905e7 in sys_quotactl (call=0x681fffd8) at /home/wks/tocompile/rr/build-release/32/preload/syscallbuf.c:3710
#4  syscall_hook_internal (call=0x681fffd8) at /home/wks/tocompile/rr/build-release/32/preload/syscallbuf.c:4229
#5  syscall_hook (call=0x681fffd8) at /home/wks/tocompile/rr/build-release/32/preload/syscallbuf.c:4355
#6  syscall_hook (call=<optimized out>) at /home/wks/tocompile/rr/build-release/32/preload/syscallbuf.c:4339
#7  0xe8c8d341 in _syscall_hook_trampoline () at /home/wks/tocompile/rr/build-release/32/preload/syscall_hook.S:131
#8  0xe8c8d3b2 in _syscall_hook_trampoline_90_90_90 () at /home/wks/tocompile/rr/build-release/32/preload/syscall_hook.S:211
#9  0x6ffff005 in __kernel_vsyscall ()
#10 0xe851b366 in ?? () from /usr/lib32/libc.so.6
#11 0xe852216c in mmap64 () from /usr/lib32/libc.so.6
#12 0xe8c2d7a1 in mapImageFile (fileName=0xff9b0d0f "/home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.data.image", targetAddress=0x60000000, executable=1 '\001', 
    writable=1 '\001', roundedImageSize=0xff9ae8d4) at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/jvm.c:319
#13 0xe8c2d8cf in createVM (vmInSeparateThread=0) at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/jvm.c:359
#14 0xe8c2dffa in JNI_CreateJavaVM (mainJavaVM=0xff9ae95c, mainJNIEnv=0xff9ae960, initArgs=0xff9ae96c) at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/jvm.c:497
#15 0x61b459a0 in main (argc=19, argv=0xff9aea68) at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/main.c:594

After that, the mapping becomes:

(rr) info proc mappings
process 128175
Mapped address spaces:

        Start Addr   End Addr       Size     Offset  Perms   objfile
        0x60000000 0x6218a000  0x218a000        0x0  rwxp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.data.image
        0x62287000 0x622a9000    0x22000        0x0  rw-p   [heap]
        0x68000000 0x68200000   0x200000        0x0  rwxp   
        0x6fffd000 0x70001000     0x4000        0x0  r-xp   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpage_32.so
        0x70001000 0x70002000     0x1000        0x0  rw-s   /tmp/rr-shared-preload_thread_locals-131561-25
        0x70003000 0x70004000     0x1000        0x0  r-xp   
        0x70004000 0x70104000   0x100000        0x0  rw-s   /tmp/rr-shared-syscallbuf.128175-131561-28
        0xe8400000 0xe841e000    0x1e000        0x0  r--p   /usr/lib32/libc.so.6
        0xe841e000 0xe85a0000   0x182000    0x1e000  r-xp   /usr/lib32/libc.so.6
        0xe85a0000 0xe861b000    0x7b000   0x1a0000  r--p   /usr/lib32/libc.so.6
        0xe861b000 0xe861d000     0x2000   0x21a000  r--p   /usr/lib32/libc.so.6
        0xe861d000 0xe861e000     0x1000   0x21c000  rw-p   /usr/lib32/libc.so.6
        0xe861e000 0xe8623000     0x5000        0x0  rw-p   
        0xe8800000 0xe881b000    0x1b000        0x0  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
        0xe881b000 0xe89ce000   0x1b3000    0x1b000  r-xp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
        0xe89ce000 0xe8a9c000    0xce000   0x1ce000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
        0xe8a9c000 0xe8a9d000     0x1000   0x29c000  rw-p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libmmtk.so
        0xe8b2c000 0xe8b2e000     0x2000        0x0  rw-p   
        0xe8b2e000 0xe8b31000     0x3000        0x0  r--p   /usr/lib32/libgcc_s.so.1
        0xe8b31000 0xe8b50000    0x1f000     0x3000  r-xp   /usr/lib32/libgcc_s.so.1
        0xe8b50000 0xe8b56000     0x6000    0x22000  r--p   /usr/lib32/libgcc_s.so.1
        0xe8b56000 0xe8b57000     0x1000    0x28000  rw-p   /usr/lib32/libgcc_s.so.1
        0xe8b57000 0xe8b62000     0xb000        0x0  r--p   /usr/lib32/libm.so.6
        0xe8b62000 0xe8bf0000    0x8e000     0xb000  r-xp   /usr/lib32/libm.so.6
        0xe8bf0000 0xe8c27000    0x37000    0x99000  r--p   /usr/lib32/libm.so.6
        0xe8c27000 0xe8c28000     0x1000    0xcf000  r--p   /usr/lib32/libm.so.6
        0xe8c28000 0xe8c29000     0x1000    0xd0000  rw-p   /usr/lib32/libm.so.6
        0xe8c29000 0xe8c2c000     0x3000        0x0  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c2c000 0xe8c39000     0xd000     0x3000  r-xp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c39000 0xe8c40000     0x7000    0x10000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c40000 0xe8c41000     0x1000    0x16000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c41000 0xe8c42000     0x1000    0x17000  rw-p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/libjvm.so
        0xe8c42000 0xe8c43000     0x1000        0x0  r--p   /usr/lib32/libdl.so.2
        0xe8c43000 0xe8c44000     0x1000     0x1000  r-xp   /usr/lib32/libdl.so.2
        0xe8c44000 0xe8c45000     0x1000     0x2000  r--p   /usr/lib32/libdl.so.2
        0xe8c45000 0xe8c46000     0x1000     0x2000  r--p   /usr/lib32/libdl.so.2
        0xe8c46000 0xe8c47000     0x1000     0x3000  rw-p   /usr/lib32/libdl.so.2
        0xe8c8c000 0xe8c8d000     0x1000        0x0  r--p   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpreload_32.so
        0xe8c8d000 0xe8c94000     0x7000     0x1000  r-xp   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpreload_32.so
        0xe8c94000 0xe8c98000     0x4000     0x8000  r--p   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpreload_32.so
        0xe8c98000 0xe8c99000     0x1000     0xc000  rw-p   /home/wks/tocompile/rr/build-release/install/lib/rr/librrpreload_32.so
        0xe8c99000 0xe8ca4000     0xb000        0x0  rw-p   
        0xe8ca4000 0xe8ca6000     0x2000        0x0  r-xp   [vdso]
        0xe8ca6000 0xe8ca7000     0x1000        0x0  r--p   /usr/lib32/ld-linux.so.2
        0xe8ca7000 0xe8cca000    0x23000     0x1000  r-xp   /usr/lib32/ld-linux.so.2
        0xe8cca000 0xe8cd8000     0xe000    0x24000  r--p   /usr/lib32/ld-linux.so.2
        0xe8cd8000 0xe8cda000     0x2000    0x31000  r--p   /usr/lib32/ld-linux.so.2
        0xe8cda000 0xe8cdb000     0x1000    0x33000  rw-p   /usr/lib32/ld-linux.so.2
        0xff98f000 0xff9b2000    0x23000        0x0  rw-p   [stack]

Note that the memory mappings for all sections in the JikesRVM executable are overwritten by RVM.data.image which spans from 0x60000000 to 0x6218a000.

It is also interesting that the mmap succeeded silently without warning about existing mmaps at the same location.

The execution went on. It eventually crashed when calling jikesrvm_alloc. That function is defined in glue.asm which is statically lined into the JikesRVM executable. The address that was supposed to hold the function body of jikesrvm_alloc is now mapped to RVM.data.image and the address contains a sequence of 0x00 bytes which may be interpreted as add %al,(%eax). The program crashed with SIGSEGV, with the message

Failing instruction offset: 0xfd11f1fe in method sysAlloc with descriptor (Lorg/vmmagic/unboxed/Address;IIII)Lorg/vmmagic/unboxed/Address; declared by class with descriptor Lorg/jikesrvm/runtime/SysCall;

Example 2

The error is non-deterministic. (I left ASLR enabled by default.) In another execution, the JikesRVM was mapped to another address:

        Start Addr   End Addr       Size     Offset  Perms   objfile
        0x64533000 0x64534000     0x1000        0x0  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x64534000 0x64536000     0x2000     0x1000  r-xp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x64536000 0x64538000     0x2000     0x3000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x64538000 0x64539000     0x1000     0x4000  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x64539000 0x6453a000     0x1000     0x5000  rw-p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/JikesRVM
        0x655c5000 0x655e7000    0x22000        0x0  rw-p   [heap]
        0x68000000 0x68200000   0x200000        0x0  rwxp   

Then it was RVM.code.image that overwrote the mappings for JikesRVM.

        Start Addr   End Addr       Size     Offset  Perms   objfile
        0x60000000 0x6218a000  0x218a000        0x0  rwxp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.data.image
        0x64000000 0x6521e000  0x121e000        0x0  rwxp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.code.image
        0x655c5000 0x655e6000    0x21000        0x0  rw-p   [heap]
        0x68000000 0x68200000   0x200000        0x0  rwxp   

And the process managed to execute the third mmap for RVM.rmap.image

        Start Addr   End Addr       Size     Offset  Perms   objfile
        0x60000000 0x6218a000  0x218a000        0x0  rwxp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.data.image
        0x64000000 0x6521e000  0x121e000        0x0  rwxp   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.code.image
        0x655c5000 0x655e6000    0x21000        0x0  rw-p   [heap]
        0x67000000 0x67074000    0x74000        0x0  r--p   /home/wks/projects/mmtk-github/jikesrvm/dist/RFastAdaptiveMarkSweep_x86_64_m32-linux/RVM.rmap.image
        0x68000000 0x68200000   0x200000        0x0  rwxp   

and then it crashed due to SIGSEGV.

430                         if (((*hasharr ^ new_hash) >> 1) == 0)                                                                                                                                         
(rr) bt
#0  do_lookup_x (undef_name=undef_name@entry=0xe8e229a2 "checkMalloc", new_hash=new_hash@entry=1550431963, old_hash=old_hash@entry=0xff955b90, ref=0xe8e2221c, result=0xff955b94, scope=0xe8ed2b9c, 
    i=<optimized out>, version=0xe8e9bd10, flags=1, skip=0x0, type_class=1, undef_map=0xe8e9ab30) at dl-lookup.c:430
#1  0xe8ea852e in _dl_lookup_symbol_x (undef_name=0xe8e229a2 "checkMalloc", undef_map=0xe8e9ab30, ref=0xff955c10, symbol_scope=<optimized out>, version=0xe8e9bd10, type_class=1, flags=1, skip_map=0x0)
    at dl-lookup.c:793
#2  0xe8eae1d6 in _dl_fixup (l=0xe8e9ab30, reloc_arg=768) at dl-runtime.c:95
#3  0xe8eb02d4 in _dl_runtime_resolve () at ../sysdeps/i386/dl-trampoline.S:38
#4  0xe8e2f40d in sysMonitorCreate () at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/sysThread.c:671
#5  0xe8e2e540 in sysInitialize () at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/sysThread.c:125
#6  0xe8e25c1d in createVM (vmInSeparateThread=0) at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/jvm.c:459
#7  0xe8e25ffa in JNI_CreateJavaVM (mainJavaVM=0xff955d2c, mainJNIEnv=0xff955d30, initArgs=0xff955d3c) at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/jvm.c:497
#8  0x645359a0 in main (argc=19, argv=0xff955e38) at /home/wks/projects/mmtk-github/jikesrvm/tools/bootloader/main.c:594

Line 671 in sysThread.c attempts to call checkMalloc, but the stack trace shows it didn't enter checkMalloc, but it ended up crashing in the system linker/loader when trying to resolve the symbol checkMalloc. It is likely because the linking metadata was overwritten by the mmap of RVM.*.image.

How is this related to other "failing instruction" errors?

I am not sure, but it is quite likely that #108 is caused by some code sections overwritten by irrelevant mmaps.

JikesRVM: error loading library ./libcore_3_1_0.so in semispace eclipse

This bug seems to be introduced in the rebase of JikesRVM to upstream. The error message is JikesRVM: error loading library ./dist/RFastAdaptiveSemiSpace_x86_64_m32-linux/libcore_3_1_0.so: No such file or directory.

===

After rebasing to JikesRVM upstream:

  • binding: b186ad2
  • jikesrvm: aadd13f760034bfb921aec9da4ea871c7a4d77e1
  • build: RUSTUP_TOOLCHAIN=nightly-2020-12-20 ./bin/buildit localhost RFastAdaptiveSemiSpace --answer-yes --use-third-party-heap=../.. --use-third-party-build-configs=../../jikesrvm/build/configs/ --use-external-source=../../jikesrvm/rvm/src --m32
  • Run
$ ./dist/RFastAdaptiveSemiSpace_x86_64_m32-linux/rvm -X:gc:threads=16 -Xms150M -Xmx150M -jar /usr/share/benchmarks/dacapo/dacapo-2006-10-MR2.jar eclipse
===== DaCapo eclipse starting =====
<setting up workspace...>
JikesRVM: error loading library ./dist/RFastAdaptiveSemiSpace_x86_64_m32-linux/libcore_3_1_0.so: ./dist/RFastAdaptiveSemiSpace_x86_64_m32-linux/libcore_3_1_0.so: cannot open shared object file: No such file or directory
JikesRVM: error loading library ./libcore_3_1_0.so: ./libcore_3_1_0.so: cannot open shared object file: No such file or directory
<creating projects..............................................................>
<running tests at level 0...>
<performing build tests...>
        org.apache.ant (not open) opening cleaning building
        org.junit (not open) opening cleaning building
        org.eclipse.osgi (not open) opening cleaning building
<performing type hierarchy tests...>
        Hierarchy: org.eclipse.help.internal HelpPlugin
<performing AST tests...>
        AST creation: org.eclipse.jdt.internal.compiler.parser
<performing completion tests...>
        Completion: Completion>Name>Empty
        Completion: Completion>Name>Empty>No Method
<performing search tests...>
        Searching: indexing
===== DaCapo eclipse PASSED in 15299 msec =====

===

Before rebase:

  • binding: e8980fd
  • jikesrvm: 6c1967070af9f3fd82f0999205647ff46053be56
  • build: RUSTUP_TOOLCHAIN=nightly-2020-12-20 ./bin/buildit localhost RFastAdaptiveSemiSpace --answer-yes --use-third-party-heap=../.. --use-third-party-build-configs=../../jikesrvm/build/configs/ --use-external-source=../../jikesrvm/rvm/src
  • run
$ ./dist/RFastAdaptiveSemiSpace_x86_64-linux/rvm -X:gc:threads=16 -Xms150M -Xmx150M -jar /usr/share/benchmarks/dacapo/dacapo-2006-10-MR2.jar eclipse===== DaCapo eclipse starting =====
<setting up workspace...>
<creating projects..............................................................>
<running tests at level 0...>
<performing build tests...>
        org.apache.ant (not open) opening cleaning building
        org.junit (not open) opening cleaning building
        org.eclipse.osgi (not open) opening cleaning building
<performing type hierarchy tests...>
        Hierarchy: org.eclipse.help.internal HelpPlugin
<performing AST tests...>
        AST creation: org.eclipse.jdt.internal.compiler.parser
<performing completion tests...>
        Completion: Completion>Name>Empty
        Completion: Completion>Name>Empty>No Method
<performing search tests...>
        Searching: indexing
===== DaCapo eclipse PASSED in 14978 msec =====

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.