Skip to content

Commit dddf10a

Browse files
[Tizen] QEMU coredump extraction (project-chip#38686)
* QEMU coredump extraction * Restyled by prettier-markdown * Fix misspell * Fix misspell --------- Co-authored-by: Restyled.io <[email protected]>
1 parent 7c2d0ea commit dddf10a

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
129 : [Telink] Update Docker image (Zephyr update)
1+
130 : [Tizen] QEMU coredump extraction

integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ RUN set -x \
165165
| guestfish --rw -a $TIZEN_IOT_IMAGE_ROOT -m /dev/sda upload - $SYSTEMD_UNIT_9P_MOUNT : \
166166
ln-sf $SYSTEMD_UNIT_9P_MOUNT $SYSTEMD_REQUIRES_LOCAL_FS : \
167167
mkdir /mnt/chip \
168+
# Setup crash manager
169+
&& guestfish --rw -a $TIZEN_IOT_IMAGE_ROOT -m /dev/sda download /etc/crash-manager.conf crash-manager.conf \
170+
&& sed -i 's|# CrashRootPath=/usr/opt/share/crash/|CrashRootPath=/mnt/chip/|g' crash-manager.conf \
171+
&& guestfish --rw -a $TIZEN_IOT_IMAGE_ROOT -m /dev/sda upload crash-manager.conf /etc/crash-manager.conf \
168172
# Setup auto-login for root user
169173
&& SYSTEMD_UNIT_SERIAL_GETTY=$SYSTEMD_SYSTEM/[email protected] \
170174
&& virt-edit $TIZEN_IOT_IMAGE_ROOT -e \

src/test_driver/tizen/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,26 @@ Then, use the run command and add the `rootshell` keyword to kernel arguments
7272
passed to QEMU (the string after the `-append` option). This will run QEMU, but
7373
instead of running the test, it will drop you to the shell. From there, you can
7474
run the test manually by typing `/mnt/chip/runner.sh`.
75+
76+
## Analyzing core dumps
77+
78+
In order for GDB to work correctly, same sysroot as is present on QEMU must be
79+
provided.
80+
81+
- Create sysroot directory
82+
- Mount `/opt/tizen-sdk/iot-rootfs.img`
83+
- Copy `/usr` from the mounted image to your sysroot directory
84+
- Fix potentially broken symlinks in the libraries as needed
85+
86+
Core dumps are generated in the `dump` directory as a zip archive file. After
87+
extracting it the core dump should be extracted from tar archive file.
88+
89+
Set GDB config
90+
91+
```
92+
set auto-load safe-path /
93+
set sysroot /path/to/sysroot/
94+
```
95+
96+
And then run `gdb-multiarch` specifying `.coredump` file extracted before, your
97+
GDB config file if present and lastly the executable.

third_party/tizen/tizen_qemu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def whereis(binary_name):
113113
# Add directory sharing.
114114
qemu_args += [
115115
'-virtfs',
116-
'local,path=%s,mount_tag=host0,security_model=none' % args.share
116+
'local,path=%s,mount_tag=host0,security_model=mapped-xattr' % args.share
117117
]
118118

119119
if args.virtio_net:

0 commit comments

Comments
 (0)