Hello, I am currently attempting to run Z3 (SMT solver) on gem5 in SE mode. Running a Z3 benchmark file with the Z3 binary on my local machine uses the following command, and this particular benchmark finishes in 0.01s:
./z3 cut_lemma_02_005.smt2.slack.smt2
After copying the Z3 binary and benchmark to my gem5 directory, the following command is an example of one (of many) configurations I tried to run Z3 with on gem5:
build/X86/gem5.fast configs/example/se.py --cpu-type=X86TimingSimpleCPU --cpu-clock=3.4GHz --sys-clock=2GHz --caches --l1d_size=32kB --l1i_size=32kB --l1i_assoc=8 --l1d_assoc=8 --l2cache --l2_size=256kB --l2_assoc=8 --mem-type=SimpleMemory --mem-size=16GB -c ./z3 -o cut_lemma_02_005.smt2.slack.smt2
When using a cpu type of X86TimingSimpleCPU I attain a panic condition that I am unfamiliar with (see below). When using an O3 cpu (such as X86O3CPU), the program typically runs into a segmentation fault after almost identical output before the ‘std::system_error’ line seen below. I also noticed that many syscalls are ignored, including mprotect(..), set_robust_list(...), rt_sigaction(...), and rt_sigprocmask(...).
Any insights on what this error means or insights on running this program and benchmark appropriately on gem5 would be greatly appreciated.
Run error output:
gem5 version 22.1.0.0
gem5 compiled Mar 5 2023 18:58:05
gem5 started Mar 10 2023 23:15:45
gem5 executing on DESKTOP-50E7TK9, pid 123
command line: build/X86/gem5.fast configs/example/se.py --cpu-type=X86TimingSimpleCPU --cpu-clock=3.4GHz --sys-clock=2GHz --caches --l1d_size=32kB --l1i_size=32kB --l1i_assoc=8 --l1d_assoc=8 --l2cache --l2_size=256kB --l2_assoc=8 --mem-type=SimpleMemory --mem-size=16GB -c ./z3 -o cut_lemma_02_005.smt2.slack.smt2
warn: The `get_runtime_isa` function is deprecated. Please migrate away from using this function.
warn: The `get_runtime_isa` function is deprecated. Please migrate away from using this function.
Global frequency set at 1000000000000 ticks per second
warn: No dot file generated. Please install pydot to generate the dot file and pdf.
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****
build/X86/sim/simulate.cc:192: info: Entering event queue @ 0. Starting simulation...
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall set_robust_list(...)
build/X86/sim/syscall_emul.cc:86: warn: ignoring syscall rt_sigaction(...)
(further warnings will be suppressed)
build/X86/sim/syscall_emul.cc:86: warn: ignoring syscall rt_sigprocmask(...)
(further warnings will be suppressed)
build/X86/sim/mem_state.cc:443: info: Increasing stack size by one page.
build/X86/sim/mem_state.cc:443: info: Increasing stack size by one page.
build/X86/arch/generic/debugfaults.hh:145: warn: MOVNTDQ: Ignoring non-temporal hint, modeling as cacheable!
build/X86/sim/mem_state.cc:443: info: Increasing stack size by one page.
build/X86/sim/syscall_emul.cc:74: warn: ignoring syscall mprotect(...)
terminate called after throwing an instance of 'std::system_error'
what(): Resource temporarily unavailable
build/X86/sim/faults.cc:61: panic: panic condition !FullSystem occurred: fault (General-Protection) detected @ PC (0x7ffff705c8e0=>0x7ffff705c8e1).(0=>1)
Memory Usage: 17684436 KBytes
Program aborted at tick 33535233480
--- BEGIN LIBC BACKTRACE ---
build/X86/gem5.fast(+0x10dcdbc)[0x7f0a49adcdbc]
build/X86/gem5.fast(+0x10f99ea)[0x7f0a49af99ea]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f0a47b42980]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f0a4629ee87]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f0a462a07f1]
build/X86/gem5.fast(+0x279f4f)[0x7f0a48c79f4f]
build/X86/gem5.fast(+0x113ea38)[0x7f0a49b3ea38]
build/X86/gem5.fast(+0x285105)[0x7f0a48c85105]
build/X86/gem5.fast(+0xa28132)[0x7f0a49428132]
build/X86/gem5.fast(+0xa24cb2)[0x7f0a49424cb2]
build/X86/gem5.fast(+0xa257b4)[0x7f0a494257b4]
build/X86/gem5.fast(+0x10ec4ad)[0x7f0a49aec4ad]
build/X86/gem5.fast(+0x1110418)[0x7f0a49b10418]
build/X86/gem5.fast(+0x11109a3)[0x7f0a49b109a3]
build/X86/gem5.fast(+0x108c96e)[0x7f0a49a8c96e]
build/X86/gem5.fast(+0x25a66a)[0x7f0a48c5a66a]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyCFunction_Call+0x96)[0x7f0a47f63736]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x76e0)[0x7f0a47ed4b20]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17ba0f)[0x7f0a47ecba0f]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c0fc)[0x7f0a47ecc0fc]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f0a47ed2303]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a803)[0x7f0a47eca803]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2be)[0x7f0a47ecc2be]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f0a47ed2303]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17ba0f)[0x7f0a47ecba0f]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c0fc)[0x7f0a47ecc0fc]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f0a47ed2303]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17ba0f)[0x7f0a47ecba0f]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e)[0x7f0a47ecc4ce]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCode+0x1b)[0x7f0a47ecd24b]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x18855d)[0x7f0a47ed855d]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x1bb)[0x7f0a47f6353b]
--- END LIBC BACKTRACE ---
I think the key thing here might be the:
"Resource temporarily unavailable"
You seem to have exceeded some limited resource, perhaps
available memory, number of processes (forks), or something
like that.
You may also have more success booting an actual kernel
as opposed to running with emulated syscalls, though of
course it will tend to be a bit slower to simulate.
Regards - Eliot Moss