s117 / anycore-riscv

The AnyCore toolset targetting the RISC-V ISA
Other
0 stars 0 forks source link

603.bwaves_s_ref failed (User store segfault @ 0x0000000000000000) #15

Closed s117 closed 4 years ago

s117 commented 4 years ago

Binary is compiled by https://github.com/s117/riscv-gnu-toolchain/commit/d0bdaa9a282a32cc68e6203098dc1162021ceba7

$ spike -m8192 pk -c speed_bwaves_base.riscv-m64 bwaves_1 < bwaves_1.in

Requesting target memory 0x200000000
******* Resetting core ********** 
****Initializing the processor system****
******* Resetting core ********** 
******* Resetting core ********** 
****Initialization complete****
 BI-CGSTAB & symmetric difference scheme 
 3D  Laminar shock wave propagation
 Re:   100000.000000    Pr:        0.720000
 grid size is:    108   131   251
 CFL:  2.000   nuim:  0.100  nuex2:  0.100 nuex4:  0.050
 Implicit scheme is working
 Cubic initial configuration
 Number of Time Steps:     80

z  0000000000000000 ra 00000000d3b79d28 sp 00000001feff32d0 gp 00000000000c62b8
tp 00000000000c7c80 t0 0000000000000001 t1 ffffffffffffffd0 t2 0000000128621a08
s0 0000000000005460 s1 000000007f0d2048 a0 00000000d3b79d28 a1 000000007f0d2048
a2 0000000152b75878 a3 00000000fe0cdb98 a4 00000000a9625eb8 a5 00000000000d64f8
a6 0000000128621a08 a7 ffffffffffffff08 s2 0000000152b75878 s3 00000000fe0cdb98
s4 00000000a9625eb8 s5 00000000fe0cdc90 s6 00000000d3b79e20 s7 00000000a9625fb0
s8 000000007f0d2140 s9 00000000000d64f8 sA 0000000152b75970 sB 00000000000d65f0
t3 ffffffffffffff08 t4 00000000000010b0 t5 fffffffffffffffa t6 000000000000006b
sr 00000000000000f9 pc 00000000000145d8 va 0000000000000000 insn       ffffffff
User store segfault @ 0x0000000000000000
cycle = 79782206
instret = 79782213
******* Resetting core ********** 
s117 commented 4 years ago

A guess: it might be caused by an unchecked malloc() call.

So when out of memory, NULL is returned and used.

s117 commented 4 years ago

Increasing the memory from 8GB to 16GB solved the problem in 603.bwaves_s_1_ref and 603.bwaves_s_2_ref

And I observed the spike's uses around 11GB to simulator each 603.bwaves run. So the guess seems reasonable.

$ spike -m16384 pk -c speed_bwaves_base.riscv-m64 bwaves_1 < bwaves_1.in

Requesting target memory 0x400000000
******* Resetting core ********** 
****Initializing the processor system****
******* Resetting core ********** 
******* Resetting core ********** 
****Initialization complete****
 BI-CGSTAB & symmetric difference scheme 
 3D  Laminar shock wave propagation
 Re:   100000.000000    Pr:        0.720000
 grid size is:    108   131   251
 CFL:  2.000   nuim:  0.100  nuex2:  0.100 nuex4:  0.050
 Implicit scheme is working
 Cubic initial configuration
 Number of Time Steps:     80

 Time step:      1  dt:    0.26805236261E-03
    0.11557376220        0.10000000000E-02
  ......
 Time step:     80  dt:    0.41929380035E-02
     3.7693919829        0.10000000000E-02
cycle = 7633085355747
instret = 7633085355754
******* Resetting core ********** 

Though still want to confirm the guess, close this issue for now.

s117 commented 4 years ago

Similar to #17