[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

could use some help debugging an unexpected emulator exit

From: Andrew Boie
Subject: could use some help debugging an unexpected emulator exit
Date: Wed, 22 Jan 2020 10:09:04 -0800

I'm working on the x86-64 port of a microcontroller RTOS
(https://www.zephyrproject.org/ if anyone's interested) and am running
into a situation where QEMU appears to be suddenly exiting without
printing any debug information. What I'm pretty sure is happening is a
triple fault, I've seen other situations where QEMU just quits when a
triple fault happens, or I have programmed bad page tables, etc.

What I'd like is some advice for dumping out the register state when
something like this happens. I did manage to reproduce this under GDB
and got the following stack trace with QEMU 4.2.0. My knowledge of
QEMU's internals is poor, but it looks like we've got a write to a
NULL address:

Thread 3 "qemu-system-x86" hit Breakpoint 1, __GI_exit (status=1) at exit.c:138
138    exit.c: No such file or directory.
(gdb) bt
#0  0x00007ffff52a1d40 in __GI_exit (status=1) at exit.c:138
#1  0x0000555555aa5eb3 in debug_exit_write
    (opaque=<optimized out>, addr=<optimized out>, val=<optimized
out>, width=<optimized out>)
    at hw/misc/debugexit.c:35
#2  0x000055555589313b in memory_region_write_accessor
    (mr=mr@entry=0x5555565ac490, addr=0,
value=value@entry=0x7fffe8c07e98, size=size@entry=4, shift=)
    at /home/apboie/Downloads/qemu-4.2.0/memory.c:483
#3  0x0000555555890e1e in access_with_adjusted_size
    (addr=addr@entry=0, value=value@entry=0x7fffe8c07e98,
size=size@entry=4, access_size_min=<optimi=
    0x555555893010 <memory_region_write_accessor>, mr=0x5555565ac490, attrs=...)
    at /home/apboie/Downloads/qemu-4.2.0/memory.c:544
#4  0x00005555558953f3 in memory_region_dispatch_write
    (mr=mr@entry=0x5555565ac490, addr=0, data=<optimized out>,
    data@entry=0, op=op@entry=MO_32, attrs=attrs@entry=...)
    at /home/apboie/Downloads/qemu-4.2.0/memory.c:1475
#5  0x00005555558464bf in address_space_stl_internal
    (endian=DEVICE_NATIVE_ENDIAN, result=0x0, attrs=..., val=0,
addr=<optimized out>, as=<optimized 2
#6  0x00005555558464bf in address_space_stl
    (as=<optimized out>, addr=<optimized out>, val=0, attrs=..., result=0x0)
    at /home/apboie/Downloads/qemu-4.2.0/memory_ldst.inc.c:346
#7  0x00007fffe8cfe461 in code_gen_buffer ()
#8  0x00005555558bf29c in cpu_tb_exec
    (itb=<optimized out>, cpu=0x7fffe8cfe380 <code_gen_buffer+987987>)
    at /home/apboie/Downloads/qemu-4.2.0/accel/tcg/cpu-exec.c:172
#9  0x00005555558bf29c in cpu_loop_exec_tb
    (tb_exit=<synthetic pointer>, last_tb=<synthetic pointer>,
tb=<optimized out>, cpu=0x7fffe8cfe388
#10 0x00005555558bf29c in cpu_exec (cpu=cpu@entry=0x55555666a620)
    at /home/apboie/Downloads/qemu-4.2.0/accel/tcg/cpu-exec.c:731
#11 0x0000555555885c10 in tcg_cpu_exec (cpu=0x55555666a620)
    at /home/apboie/Downloads/qemu-4.2.0/cpus.c:1473
#12 0x0000555555888134 in qemu_tcg_cpu_thread_fn (arg=arg@entry=0x55555666a620)
    at /home/apboie/Downloads/qemu-4.2.0/cpus.c:1781
#13 0x0000555555cf2a83 in qemu_thread_start (args=<optimized out>) at
#14 0x00007ffff5452669 in start_thread (arg=<optimized out>) at
#15 0x00007ffff537a323 in clone () at

Any help appreciated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]