Discussion:
[gem5-users] Gem5 full-system simulation panic error
Mandi Das
2018-09-25 22:18:57 UTC
Permalink
Dear all,
I’m trying to run full system simulation on ARM architecture.
I have followed all the steps mentioned in the gem5.org resources.
And I get this error while running the simulation:
panic: panic condition sz != 2 occurred: Couldn't read magic bytes from object file
Can anyone please tell me what this error is about?

I’m running gem5 on Ubuntu 18.04.1 LTS
And the fullsystem files: aarch-system-20180409.tar.xz

Any help is appreciated
Thanks

Regards,
Mandi Das

From the terminal
command line: build/ARM/gem5.opt configs/example/fs.py --disk-image=/home/md3kq/fullsysimg/disks/aarch64-ubuntu-trusty-headless.img
--kernel=/home/md3kq/fullsysimg/binaries/vmlinux.vexpress_emm64 –dtb-filename=/home/md3kq/fullsysimg/binaries/vexpress-v2p-ca15-tc1-gem5_dvfs_1cpus.dtb

Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
panic: panic condition sz != 2 occurred: Couldn't read magic bytes from object file
Memory Usage: 757604 KBytes
Program aborted at tick 0
--- BEGIN LIBC BACKTRACE ---
build/ARM/gem5.opt(_Z15print_backtracev+0x2c)[0x559eec498b5c]
build/ARM/gem5.opt(_Z12abortHandleri+0x4a)[0x559eec4ae50a]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f56c871d890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f56c737fe97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f56c7381801]
build/ARM/gem5.opt(+0x7331cf)[0x559eebe621cf]
build/ARM/gem5.opt(_Z16createObjectFileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x352)[0x559eec447cc2]
build/ARM/gem5.opt(_ZN6SystemC1EP12SystemParams+0x8ad)[0x559eec4cea4d]
build/ARM/gem5.opt(_ZN9ArmSystemC2EP15ArmSystemParams+0x36)[0x559eec7157d6]
build/ARM/gem5.opt(_ZN14LinuxArmSystemC2EP20LinuxArmSystemParams+0x2f)[0x559eec6e846f]
build/ARM/gem5.opt(_ZN20LinuxArmSystemParams6createEv+0x21)[0x559eec6e9d21]
build/ARM/gem5.opt(+0xbea92a)[0x559eec31992a]
build/ARM/gem5.opt(+0xa8e41b)[0x559eec1bd41b]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ff3)[0x7f56c89d81b3]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f56c89d1029]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ac0)[0x7f56c89d7c80]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f56c89d1029]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyRun_StringFlags+0x76)[0x7f56c8a74546]
build/ARM/gem5.opt(_Z6m5MainiPPc+0x63)[0x559eec4ad173]
build/ARM/gem5.opt(main+0x33)[0x559eebe05243]
--- END LIBC BACKTRACE ---
Aborted (core dumped)

Sent from Mail for Windows 10
Ciro Santilli
2018-09-26 04:27:02 UTC
Permalink
Looks like your dtb is an empty file. Try re-downloading it.

Alternatively, here is another setup that just works:
https://github.com/cirosantilli/linux-kernel-module-cheat/tree/6b563c0234de948da56df9924e0cf4e671cf220c#gem5-buildroot-setup-getting-started

How I debugged it:

First pipe the trace through c++filt to demangle it and make it more readable.

Then, read the source of the interesting trace parts, which are those
inside build/ARM/gem5.opt , everything else is usually noise.

You see that in LinuxArmSystem::initState() the line is:

ObjectFile *dtb_file = createObjectFile(params()->dtb_filename, true);

so we know it is a problem with the DTB.

Then, further down the trace:

static bool
hasGzipMagic(int fd)
{
uint8_t buf[2] = {0};
size_t sz = pread(fd, buf, 2, 0);
panic_if(sz != 2, "Couldn't read magic bytes from object file");
Post by Mandi Das
Dear all,
I’m trying to run full system simulation on ARM architecture.
I have followed all the steps mentioned in the gem5.org resources.
panic: panic condition sz != 2 occurred: Couldn't read magic bytes from object file
Can anyone please tell me what this error is about?
I’m running gem5 on Ubuntu 18.04.1 LTS
And the fullsystem files: aarch-system-20180409.tar.xz
Any help is appreciated
Thanks
Regards,
Mandi Das
From the terminal
command line: build/ARM/gem5.opt configs/example/fs.py --disk-image=/home/md3kq/fullsysimg/disks/aarch64-ubuntu-trusty-headless.img
--kernel=/home/md3kq/fullsysimg/binaries/vmlinux.vexpress_emm64 –dtb-filename=/home/md3kq/fullsysimg/binaries/vexpress-v2p-ca15-tc1-gem5_dvfs_1cpus.dtb
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
panic: panic condition sz != 2 occurred: Couldn't read magic bytes from object file
Memory Usage: 757604 KBytes
Program aborted at tick 0
--- BEGIN LIBC BACKTRACE ---
build/ARM/gem5.opt(_Z15print_backtracev+0x2c)[0x559eec498b5c]
build/ARM/gem5.opt(_Z12abortHandleri+0x4a)[0x559eec4ae50a]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f56c871d890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f56c737fe97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f56c7381801]
build/ARM/gem5.opt(+0x7331cf)[0x559eebe621cf]
build/ARM/gem5.opt(_Z16createObjectFileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x352)[0x559eec447cc2]
build/ARM/gem5.opt(_ZN6SystemC1EP12SystemParams+0x8ad)[0x559eec4cea4d]
build/ARM/gem5.opt(_ZN9ArmSystemC2EP15ArmSystemParams+0x36)[0x559eec7157d6]
build/ARM/gem5.opt(_ZN14LinuxArmSystemC2EP20LinuxArmSystemParams+0x2f)[0x559eec6e846f]
build/ARM/gem5.opt(_ZN20LinuxArmSystemParams6createEv+0x21)[0x559eec6e9d21]
build/ARM/gem5.opt(+0xbea92a)[0x559eec31992a]
build/ARM/gem5.opt(+0xa8e41b)[0x559eec1bd41b]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ff3)[0x7f56c89d81b3]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f56c89d1029]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ac0)[0x7f56c89d7c80]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6)[0x7f56c89d6db6]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f56c8b09278]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f56c89d1029]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyRun_StringFlags+0x76)[0x7f56c8a74546]
build/ARM/gem5.opt(_Z6m5MainiPPc+0x63)[0x559eec4ad173]
build/ARM/gem5.opt(main+0x33)[0x559eebe05243]
--- END LIBC BACKTRACE ---
Aborted (core dumped)
Sent from Mail for Windows 10
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Loading...