Arceos-monolithic / Starry

An experimental modular OS written in Rust.
http://rcore-os.cn/arceos/
Apache License 2.0
12 stars 15 forks source link

lmbench测试中每执行完一条测例会出现:Segmentation fault #12

Open apengaaa opened 7 months ago

apengaaa commented 7 months ago

lmbench测试中每执行完一条测例会出现:Segmentation fault,好像出现了内存访问问题,如此出现的结果还是否可信

       d8888                            .d88888b.   .d8888b.
      d88888                           d88P" "Y88b d88P  Y88b
     d88P888                           888     888 Y88b.
    d88P 888 888d888  .d8888b  .d88b.  888     888  "Y888b.
   d88P  888 888P"   d88P"    d8P  Y8b 888     888     "Y88b.
  d88P   888 888     888      88888888 888     888       "888
 d8888888888 888     Y88b.    Y8b.     Y88b. .d88P Y88b  d88P
d88P     888 888      "Y8888P  "Y8888   "Y88888P"   "Y8888P"

arch = riscv64
platform = riscv64-qemu-virt
target = riscv64gc-unknown-none-elf
smp = 1
build_mode = release
log_level = off

latency measurements
Simple syscall: 63.2294 microseconds
Segmentation fault  // ??
Simple read: 108.3636 microseconds
Segmentation fault
Simple write: 223.1044 microseconds
Segmentation fault
Simple stat: 248.8958 microseconds
Segmentation fault
Simple fstat: 121.6893 microseconds
Segmentation fault
Simple open/close: 519.3846 microseconds
Segmentation fault
Select on 100 fd's: 2098.2794 microseconds
Segmentation fault
Signal handler installation: 108.9000 microseconds
Segmentation fault
Signal handler overhead: 100.2369 microseconds
Segmentation fault
Protection fault: 44.9550 microseconds
Segmentation fault
Pipe latency: 1528.3885 microseconds
Segmentation fault
Process fork+exit: 97130.0000 microseconds
Segmentation fault
Process fork+execve: 81869.0000 microseconds
Segmentation fault
Process fork+/bin/sh -c: 91525.0000 microseconds
Segmentation fault
File /var/tmp/XXX write bandwidth:32447 KB/sec
Segmentation fault
Pagefaults on /var/tmp/XXX: 348.7340 microseconds
Segmentation fault
0.524288 2457
Segmentation fault
file system latency
0k      1166    1034    1495
1k      1021    890     1514
4k      981     891     1475
10k     897     809     1462
Segmentation fault
Bandwidth measurements
Pipe bandwidth: 4.61 MB/sec
Segmentation fault
0.524288 117.13
Segmentation fault
0.524288 87.81
Segmentation fault
0.524288 388.07
Segmentation fault
0.524288 10.97
Segmentation fault
context switch overhead

"size=32k ovr=295.41
2 696.26
4 858.59
8 708.59
16 470.34
24 436.67
32 385.22
64 517.64
96 434.29
Segmentation fault

目前认为是宏内核支持还不完善(需要确定)

scPointer commented 7 months ago

lmbench 的结果是对的,Segmentation fault 的原因是执行 main 函数完成后执行 return 0,结果在空栈上返回了。正常来说,main 的 return 应该是回到 libc 环境中调用 _exit。目前暂时不清楚为什么只有 lmbench 缺失了退出时的最后处理,但测试内容本身是执行完成了的。