Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in QEMU monitor #165

Open
huhrenfeldt opened this issue Sep 13, 2021 · 0 comments
Open

Crash in QEMU monitor #165

huhrenfeldt opened this issue Sep 13, 2021 · 0 comments

Comments

@huhrenfeldt
Copy link

There seems to be a problem in the QEMU monitor code related to dumping the registers.

Using Cheribuild (commit ID: 32fb272f387ce94d2c3332c64a6619009854089c) I built and ran CheriBSD like:

./cheribuild.py --include-dependencies run-riscv64-purecap

During CheriBSD bootup, I hit CTRL-A CTRL-C to bring up the qemu monitor. Here "info registers" often causes a crash (but not 100% consistent):

qemu-system-riscv64cheri: ../../qemu/target/cheri-common/cpu_cheri.h:179: target_ulong PC_ADDR(CPUArchState *): Assertion `pc_is_current(env)' failed.

Thread 1 "qemu-system-ris" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtrace
#0  0x00007ffff5575fb7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff5577921 in __GI_abort () at abort.c:79
#2  0x00007ffff556748a in __assert_fail_base (fmt=0x7ffff56ee750 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xd47f77 "pc_is_current(env)", file=file@entry=0xd47e6b "../../qemu/target/cheri-common/cpu_cheri.h", line=line@entry=179, function=function@entry=0xd47f8a "target_ulong PC_ADDR(CPUArchState *)") at assert.c:92
#3  0x00007ffff5567502 in __GI___assert_fail (assertion=0xd47f77 "pc_is_current(env)", file=0xd47e6b "../../qemu/target/cheri-common/cpu_cheri.h", line=179, function=0xd47f8a "target_ulong PC_ADDR(CPUArchState *)") at assert.c:101
#4  0x00000000006d3fff in PC_ADDR (env=0x142c9a0) at ../../qemu/target/cheri-common/cpu_cheri.h:179
#5  0x00000000006d866a in riscv_cpu_dump_state (cs=0x1422b20, f=0x0, flags=131072) at ../../qemu/target/riscv/cpu.c:260
#6  0x00000000005669b1 in cpu_dump_state (cpu=0x1422b20, f=0x0, flags=131072) at ../../qemu/hw/core/cpu.c:233
#7  0x0000000000818a21 in hmp_info_registers (mon=0x1415c30, qdict=0x2063df0) at ../../qemu/monitor/misc.c:330
#8  0x000000000041cb89 in handle_hmp_command (mon=0x1415c30, cmdline=0x141ffbe "") at ../../qemu/monitor/hmp.c:1100
#9  0x000000000041c405 in monitor_command_cb (opaque=0x1415c30, cmdline=0x141ffb0 "info registers", readline_opaque=0x0) at ../../qemu/monitor/hmp.c:47
#10 0x0000000000ad872a in readline_handle_byte (rs=0x141ffb0, ch=13) at ../../qemu/util/readline.c:408
#11 0x000000000041e97c in monitor_read (opaque=0x1415c30, buf=0x7fffffffc990 "\r\315\377\377\377\177", size=1) at ../../qemu/monitor/hmp.c:1340
#12 0x0000000000a3f31d in mux_chr_read (opaque=0x13e9e40, buf=0x7fffffffc990 "\r\315\377\377\377\177", size=1) at ../../qemu/chardev/char-mux.c:228
#13 0x0000000000a402b2 in qemu_chr_be_write_impl (s=0x1359f40, buf=0x7fffffffc990 "\r\315\377\377\377\177", len=1) at ../../qemu/chardev/char.c:201
#14 0x0000000000a40328 in qemu_chr_be_write (s=0x1359f40, buf=0x7fffffffc990 "\r\315\377\377\377\177", len=1) at ../../qemu/chardev/char.c:213
#15 0x0000000000a44c0f in fd_chr_read (chan=0x137bfa0, cond=G_IO_IN, opaque=0x1359f40) at ../../qemu/chardev/char-fd.c:68
#16 0x0000000000a2618b in qio_channel_fd_source_dispatch (source=0x24ecf20, callback=0xa44ae0 <fd_chr_read>, user_data=0x1359f40)
    at ../../qemu/io/channel-watch.c:84
#17 0x00007ffff72703a5 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x0000000000ac70fc in glib_pollfds_poll () at ../../qemu/util/main-loop.c:221
#19 0x0000000000ac6ad8 in os_host_main_loop_wait (timeout=7626668) at ../../qemu/util/main-loop.c:244
#20 0x0000000000ac69b3 in main_loop_wait (nonblocking=0) at ../../qemu/util/main-loop.c:520
#21 0x00000000008e11d4 in qemu_main_loop () at ../../qemu/softmmu/vl.c:1732

#22 0x000000000040e9ef in main (argc=20, argv=0x7fffffffdc58, envp=0x7fffffffdd00) at ../../qemu/softmmu/main.c:50
arichardson added a commit that referenced this issue Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant