Skip to contentSkip to conversation

rainier-bmc machine dumping core with latest qemu

DISCUSSION Ninad Palsule 4 participants 6 messages Feb 8, 2023 – Feb 9, 2023

lore
Share & tools
lore
#0 lore raw

Hello,

I am hitting core dump while running qemu with rainier-bmc machine. I started hitting it after I rebased to latest qemu from master.
Can someone please help?

/home/abc/dev/qemu/build/qemu-system-arm -M rainier-bmc -nographic \
  -kernel ./fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin \
  -dtb ./aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb \
  -initrd ./obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz \
  -drive file=./obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2,if=sd,index=2 \
  -append 'rootwait console=ttyS4,115200n8 root=PARTLABEL=rofs-a'

[  OK  ] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[   45.873184] systemd-journald[156]: Received client request to flush runtime journal.
[   45.932231] systemd-journald[156]: File /var/log/journal/97cd620eaa284caf980533438c7355c4/system.journal corrupted or uncleanly shut down, renaming and replacing.
qemu-system-arm: /home/abc/dev/qemu/block/block-gen.h:43: bdrv_poll_co: Assertion `qemu_get_current_aio_context() == qemu_get_aio_context()' failed.

Thread 3 "qemu-system-arm" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff6896640 (LWP 3898452)]
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737329587776) at ./nptl/pthread_kill.c:44 44  ./nptl/pthread_kill.c: No such file or directory.

#6  0x00007ffff77e8e96 in __GI___assert_fail
    (assertion=assertion@entry=0x55555603e798 "qemu_get_current_aio_context() ==
qemu_get_aio_context()", file=file@entry=0x5555560aef28 "/home/abc/dev/qemu/block/block-gen.h", line=line@entry=43, function=function@entry=0x5555560af080 <__PRETTY_FUNCTION__.9> "bdrv_poll_co") at ./assert/assert.c:101 #7  0x0000555555da91f9 in bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:43
#8  bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:38
#9  bdrv_getlength (bs=<optimized out>) at block/block-gen.c:310
#10 0x0000555555e3558e in handle_aiocb_write_zeroes (opaque=0x7fff419965f0) at ../block/file-posix.c:1741
#11 0x0000555555ef80fd in worker_thread (opaque=opaque@entry=0x5555569e2300) at ../util/thread-pool.c:110
#12 0x0000555555ee3901 in qemu_thread_start (args=<optimized out>) at ../util/qemu-thread-posix.c:505
#13 0x00007ffff7843b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#14 0x00007ffff78d5a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

(gdb) p qemu_aio_context
$1 = (AioContext *) 0x5555568b13d0

---------------------------------------

Reproduction steps:

1. Clone and build qemu from https://github.com/qemu/qemu
2. Download following eBMC images

BLD_VERSION=20230205025034
LINUX_VERSION="6.0.19+git0+67c9407e1f"
wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2
qemu-img resize obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2 16G

3. Run the qemu command as show at the start

#1 lore raw

Cc'ing Emanuele.

Quoted 69 lines · Ninad Palsule

Hello,

I am hitting core dump while running qemu with rainier-bmc machine. I started hitting it after I rebased to latest qemu from master.
Can someone please help?

/home/abc/dev/qemu/build/qemu-system-arm -M rainier-bmc -nographic \
  -kernel
./fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin \
  -dtb
./aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb \
  -initrd ./obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz \
  -drive
file=./obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2,if=sd,index=2 \
  -append 'rootwait console=ttyS4,115200n8 root=PARTLABEL=rofs-a'

[  OK  ] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[   45.873184] systemd-journald[156]: Received client request to flush runtime journal.
[   45.932231] systemd-journald[156]: File /var/log/journal/97cd620eaa284caf980533438c7355c4/system.journal corrupted or uncleanly shut down, renaming and replacing.
qemu-system-arm: /home/abc/dev/qemu/block/block-gen.h:43: bdrv_poll_co: Assertion `qemu_get_current_aio_context() == qemu_get_aio_context()' failed.

Thread 3 "qemu-system-arm" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff6896640 (LWP 3898452)]
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737329587776) at ./nptl/pthread_kill.c:44 44  ./nptl/pthread_kill.c: No such file or directory.

#6  0x00007ffff77e8e96 in __GI___assert_fail
    (assertion=assertion@entry=0x55555603e798
"qemu_get_current_aio_context() ==
qemu_get_aio_context()", file=file@entry=0x5555560aef28 "/home/abc/dev/qemu/block/block-gen.h", line=line@entry=43, function=function@entry=0x5555560af080 <__PRETTY_FUNCTION__.9> "bdrv_poll_co") at ./assert/assert.c:101 #7  0x0000555555da91f9 in bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:43
#8  bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:38
#9  bdrv_getlength (bs=<optimized out>) at block/block-gen.c:310
#10 0x0000555555e3558e in handle_aiocb_write_zeroes (opaque=0x7fff419965f0) at ../block/file-posix.c:1741
#11 0x0000555555ef80fd in worker_thread (opaque=opaque@entry=0x5555569e2300) at ../util/thread-pool.c:110
#12 0x0000555555ee3901 in qemu_thread_start (args=<optimized out>) at ../util/qemu-thread-posix.c:505
#13 0x00007ffff7843b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#14 0x00007ffff78d5a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

(gdb) p qemu_aio_context
$1 = (AioContext *) 0x5555568b13d0

---------------------------------------

Reproduction steps:

1. Clone and build qemu from https://github.com/qemu/qemu
2. Download following eBMC images

BLD_VERSION=20230205025034
LINUX_VERSION="6.0.19+git0+67c9407e1f"
wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2
qemu-img resize obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2 16G

3. Run the qemu command as show at the start

#2 lore raw

Adding Kevin too.

I can't reproduce your issue. I tried the exact steps showed in your mail, both with BLD_VERSION=20230205025034 (not anymore latest compose) and BLD_VERSION=20230209025037 (currently latest), and the VM boots till the login screen.

Talking with Kevin it looks like handle_aiocb_write_zeroes() should not use bdrv_getlength() but rather raw_co_getlength().
Could you try replacing it in block/file-posix.c line 1741 and rebuild and see if it works?

Thank you,
Emanuele

Am 08/02/2023 um 15:56 schrieb Philippe Mathieu-Daudé:

Quoted 96 lines

Cc'ing Emanuele.

Quoted 92 lines · Ninad Palsule

Hello,

I am hitting core dump while running qemu with rainier-bmc machine. I started
hitting it after I rebased to latest qemu from master.
Can someone please help?

/home/abc/dev/qemu/build/qemu-system-arm -M rainier-bmc -nographic \
   -kernel ./fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin \
   -dtb ./aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb \
   -initrd ./obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz \
   -drive file=./obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2,if=sd,index=2 \
   -append 'rootwait console=ttyS4,115200n8 root=PARTLABEL=rofs-a'

[  OK  ] Started Journal Service.
          Starting Flush Journal to Persistent Storage...
[   45.873184] systemd-journald[156]: Received client request to flush runtime journal.
[   45.932231] systemd-journald[156]: File /var/log/journal/97cd620eaa284caf980533438c7355c4/system.journal corrupted or uncleanly shut down, renaming and replacing.
qemu-system-arm: /home/abc/dev/qemu/block/block-gen.h:43:
bdrv_poll_co: Assertion `qemu_get_current_aio_context() == qemu_get_aio_context()' failed.

Thread 3 "qemu-system-arm" received signal SIGABRT, Aborted. [Switching to Thread 0x7ffff6896640 (LWP 3898452)] __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737329587776) at ./nptl/pthread_kill.c:44 44  ./nptl/pthread_kill.c: No such file or directory.

#6  0x00007ffff77e8e96 in __GI___assert_fail (assertion=assertion@entry=0x55555603e798 "qemu_get_current_aio_context() == qemu_get_aio_context()", file=file@entry=0x5555560aef28 "/home/abc/dev/qemu/block/block-gen.h", line=line@entry=43, function=function@entry=0x5555560af080 <__PRETTY_FUNCTION__.9> "bdrv_poll_co") at ./assert/assert.c:101
#7  0x0000555555da91f9 in bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:43
#8  bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:38
#9  bdrv_getlength (bs=<optimized out>) at block/block-gen.c:310 #10 0x0000555555e3558e in handle_aiocb_write_zeroes (opaque=0x7fff419965f0) at ../block/file-posix.c:1741
#11 0x0000555555ef80fd in worker_thread (opaque=opaque@entry=0x5555569e2300) at ../util/thread-pool.c:110 #12 0x0000555555ee3901 in qemu_thread_start (args=<optimized out>) at ../util/qemu-thread-posix.c:505
#13 0x00007ffff7843b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#14 0x00007ffff78d5a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

(gdb) p qemu_aio_context
$1 = (AioContext *) 0x5555568b13d0

---------------------------------------

Reproduction steps:

1. Clone and build qemu from https://github.com/qemu/qemu
2. Download following eBMC images

BLD_VERSION=20230205025034
LINUX_VERSION="6.0.19+git0+67c9407e1f"
wget
https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz

wget
https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb

wget
https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin

wget
https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2
qemu-img resize obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2 16G

3. Run the qemu command as show at the start

#3 lore raw

Hi Emanuele,

Quoted 11 lines · Emanuele Giuseppe Esposito

Adding Kevin too.

I can't reproduce your issue. I tried the exact steps showed in your mail, both with BLD_VERSION=20230205025034 (not anymore latest compose) and BLD_VERSION=20230209025037 (currently latest), and the VM boots till the login screen.

Talking with Kevin it looks like handle_aiocb_write_zeroes() should not use bdrv_getlength() but rather raw_co_getlength().
Could you try replacing it in block/file-posix.c line 1741 and rebuild and see if it works?

Yes, I built it using raw_co_getlength() and now I am not hitting the abort.

Thanks for your time.

Quoted 100 lines

Thank you,
Emanuele

Am 08/02/2023 um 15:56 schrieb Philippe Mathieu-Daudé:

Quoted 95 lines

Cc'ing Emanuele.

Quoted 92 lines · Ninad Palsule

Hello,

I am hitting core dump while running qemu with rainier-bmc machine. I started
hitting it after I rebased to latest qemu from master.
Can someone please help?

/home/abc/dev/qemu/build/qemu-system-arm -M rainier-bmc -nographic \
   -kernel
./fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin \
   -dtb
./aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb \
   -initrd
./obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz \
   -drive
file=./obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2,if=sd,index=2 \
   -append 'rootwait console=ttyS4,115200n8 root=PARTLABEL=rofs-a'

[  OK  ] Started Journal Service.
          Starting Flush Journal to Persistent Storage...
[   45.873184] systemd-journald[156]: Received client request to flush runtime journal.
[   45.932231] systemd-journald[156]: File /var/log/journal/97cd620eaa284caf980533438c7355c4/system.journal corrupted or uncleanly shut down, renaming and replacing.
qemu-system-arm: /home/abc/dev/qemu/block/block-gen.h:43:
bdrv_poll_co: Assertion `qemu_get_current_aio_context() == qemu_get_aio_context()' failed.

Thread 3 "qemu-system-arm" received signal SIGABRT, Aborted. [Switching to Thread 0x7ffff6896640 (LWP 3898452)] __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737329587776) at ./nptl/pthread_kill.c:44 44  ./nptl/pthread_kill.c: No such file or directory.

#6  0x00007ffff77e8e96 in __GI___assert_fail
     (assertion=assertion@entry=0x55555603e798
"qemu_get_current_aio_context() == qemu_get_aio_context()", file=file@entry=0x5555560aef28 "/home/abc/dev/qemu/block/block-gen.h", line=line@entry=43, function=function@entry=0x5555560af080 <__PRETTY_FUNCTION__.9> "bdrv_poll_co") at ./assert/assert.c:101
#7  0x0000555555da91f9 in bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:43
#8  bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:38
#9  bdrv_getlength (bs=<optimized out>) at block/block-gen.c:310 #10 0x0000555555e3558e in handle_aiocb_write_zeroes (opaque=0x7fff419965f0) at ../block/file-posix.c:1741
#11 0x0000555555ef80fd in worker_thread (opaque=opaque@entry=0x5555569e2300) at ../util/thread-pool.c:110 #12 0x0000555555ee3901 in qemu_thread_start (args=<optimized out>) at ../util/qemu-thread-posix.c:505
#13 0x00007ffff7843b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#14 0x00007ffff78d5a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

(gdb) p qemu_aio_context
$1 = (AioContext *) 0x5555568b13d0

---------------------------------------

Reproduction steps:

1. Clone and build qemu from https://github.com/qemu/qemu
2. Download following eBMC images

BLD_VERSION=20230205025034
LINUX_VERSION="6.0.19+git0+67c9407e1f"
wget
https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz

wget
https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb

wget
https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin

wget
https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2
qemu-img resize obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2 16G

3. Run the qemu command as show at the start

#4 lore raw
In reply to Ninad Palsule

Hello Ninad,

Quoted 6 lines · Ninad Palsule

Hello,

I am hitting core dump while running qemu with rainier-bmc machine. I started hitting it after I rebased to latest qemu from master.
Can someone please help?

Quoted 6 lines

/home/abc/dev/qemu/build/qemu-system-arm -M rainier-bmc -nographic \
  -kernel ./fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin \
  -dtb ./aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb \
  -initrd ./obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz \
  -drive file=./obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2,if=sd,index=2 \
  -append 'rootwait console=ttyS4,115200n8 root=PARTLABEL=rofs-a'

Rainier systems usually boot from eMMC Are you using mainline QEMU or a branch with eMMC support ?

C.

Quoted 52 lines

[  OK  ] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[   45.873184] systemd-journald[156]: Received client request to flush runtime journal.
[   45.932231] systemd-journald[156]: File /var/log/journal/97cd620eaa284caf980533438c7355c4/system.journal corrupted or uncleanly shut down, renaming and replacing.
qemu-system-arm: /home/abc/dev/qemu/block/block-gen.h:43: bdrv_poll_co: Assertion `qemu_get_current_aio_context() == qemu_get_aio_context()' failed.

Thread 3 "qemu-system-arm" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff6896640 (LWP 3898452)]
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737329587776) at ./nptl/pthread_kill.c:44 44  ./nptl/pthread_kill.c: No such file or directory.

#6  0x00007ffff77e8e96 in __GI___assert_fail
    (assertion=assertion@entry=0x55555603e798 "qemu_get_current_aio_context() ==
qemu_get_aio_context()", file=file@entry=0x5555560aef28 "/home/abc/dev/qemu/block/block-gen.h", line=line@entry=43, function=function@entry=0x5555560af080 <__PRETTY_FUNCTION__.9> "bdrv_poll_co") at ./assert/assert.c:101 #7  0x0000555555da91f9 in bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:43
#8  bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:38
#9  bdrv_getlength (bs=<optimized out>) at block/block-gen.c:310
#10 0x0000555555e3558e in handle_aiocb_write_zeroes (opaque=0x7fff419965f0) at ../block/file-posix.c:1741
#11 0x0000555555ef80fd in worker_thread (opaque=opaque@entry=0x5555569e2300) at ../util/thread-pool.c:110
#12 0x0000555555ee3901 in qemu_thread_start (args=<optimized out>) at ../util/qemu-thread-posix.c:505
#13 0x00007ffff7843b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#14 0x00007ffff78d5a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

(gdb) p qemu_aio_context
$1 = (AioContext *) 0x5555568b13d0

---------------------------------------

Reproduction steps:

1. Clone and build qemu from https://github.com/qemu/qemu
2. Download following eBMC images

BLD_VERSION=20230205025034
LINUX_VERSION="6.0.19+git0+67c9407e1f"
wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2
qemu-img resize obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2 16G

3. Run the qemu command as show at the start

#5 lore raw

Hi Cedric

Quoted 16 lines · Cédric Le Goater

Hello Ninad,

Quoted 6 lines · Ninad Palsule

Hello,

I am hitting core dump while running qemu with rainier-bmc machine. I started hitting it after I rebased to latest qemu from master.
Can someone please help?

Quoted 6 lines

/home/abc/dev/qemu/build/qemu-system-arm -M rainier-bmc -nographic \
   -kernel ./fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin \
   -dtb ./aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb \
   -initrd ./obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz \
   -drive file=./obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2,if=sd,index=2 \
   -append 'rootwait console=ttyS4,115200n8 root=PARTLABEL=rofs-a'

Quoted 2 lines

Rainier systems usually boot from eMMC Are you using mainline QEMU or a branch with eMMC support ?

I am using QEMU from the mainline with upstream BMC. I think eMMC is not supported in the mainline yet.

Quoted 57 lines

C.

Quoted 52 lines

[  OK  ] Started Journal Service.
          Starting Flush Journal to Persistent Storage...
[   45.873184] systemd-journald[156]: Received client request to flush runtime journal.
[   45.932231] systemd-journald[156]: File /var/log/journal/97cd620eaa284caf980533438c7355c4/system.journal corrupted or uncleanly shut down, renaming and replacing.
qemu-system-arm: /home/abc/dev/qemu/block/block-gen.h:43: bdrv_poll_co: Assertion `qemu_get_current_aio_context() == qemu_get_aio_context()' failed.

Thread 3 "qemu-system-arm" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff6896640 (LWP 3898452)]
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737329587776) at ./nptl/pthread_kill.c:44 44  ./nptl/pthread_kill.c: No such file or directory.

#6  0x00007ffff77e8e96 in __GI___assert_fail
     (assertion=assertion@entry=0x55555603e798 "qemu_get_current_aio_context() ==
qemu_get_aio_context()", file=file@entry=0x5555560aef28 "/home/abc/dev/qemu/block/block-gen.h", line=line@entry=43, function=function@entry=0x5555560af080 <__PRETTY_FUNCTION__.9> "bdrv_poll_co") at ./assert/assert.c:101 #7  0x0000555555da91f9 in bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:43
#8  bdrv_poll_co (s=0x7ffff68957f0) at /home/abc/dev/qemu/block/block-gen.h:38
#9  bdrv_getlength (bs=<optimized out>) at block/block-gen.c:310
#10 0x0000555555e3558e in handle_aiocb_write_zeroes (opaque=0x7fff419965f0) at ../block/file-posix.c:1741
#11 0x0000555555ef80fd in worker_thread (opaque=opaque@entry=0x5555569e2300) at ../util/thread-pool.c:110
#12 0x0000555555ee3901 in qemu_thread_start (args=<optimized out>) at ../util/qemu-thread-posix.c:505
#13 0x00007ffff7843b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#14 0x00007ffff78d5a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

(gdb) p qemu_aio_context
$1 = (AioContext *) 0x5555568b13d0

---------------------------------------

Reproduction steps:

1. Clone and build qemu from https://github.com/qemu/qemu
2. Download following eBMC images

BLD_VERSION=20230205025034
LINUX_VERSION="6.0.19+git0+67c9407e1f"
wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-initramfs-p10bmc-${BLD_VERSION}.rootfs.cpio.xz

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/aspeed-bmc-ibm-rainier--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.dtb

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/fitImage-linux.bin--${LINUX_VERSION}-r0-p10bmc-${BLD_VERSION}.bin

wget https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=p10bmc/lastStableBuild/artifact/openbmc/build/tmp/deploy/images/p10bmc/obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2
qemu-img resize obmc-phosphor-image-p10bmc-${BLD_VERSION}.rootfs.wic.qcow2 16G

3. Run the qemu command as show at the start