gdb fails in arm chroot

Bug #535533 reported by Chris Halse Rogers
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu-linaro (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

Binary package hint: qemu-kvm

GDB fails to catch SIGSEGV in an arm chroot. This is because ptrace is unimplemented at the moment, and is apparently technically difficult to implement.

This is a tracking bug for other unwary travellers attempting to debug SIGSEGVs in arm chroots.

ProblemType: Bug
Architecture: amd64
Date: Wed Mar 10 17:18:12 2010
DistroRelease: Ubuntu 10.04
Package: qemu-kvm-extras-static 0.12.3-0ubuntu11
ProcEnviron:
 LANGUAGE=en_AU:en_GB:en
 PATH=(custom, user)
 LANG=en_AU.utf8
 SHELL=/bin/zsh
ProcVersionSignature: Ubuntu 2.6.32-15.22-generic
SourcePackage: qemu-kvm
Uname: Linux 2.6.32-15-generic x86_64

Revision history for this message
Chris Halse Rogers (raof) wrote :
Revision history for this message
Thierry Carrez (ttx) wrote :

Not linked to qemu-kvm ? Tentatively reaffecting to gdb, please revert to qemu-kvm with extra information if necessary.

affects: qemu-kvm (Ubuntu) → gdb (Ubuntu)
Matthias Klose (doko)
tags: added: armel
Paul Larson (pwlars)
Changed in gdb (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Steve Langasek (vorlon) wrote :

From the original bug description, this is an emulated arm chroot on x86 and gdb is failing because ptrace is not implemented /in qemu/.

I don't know if this is still an issue with qemu-linaro; we should retest.

affects: gdb (Ubuntu) → qemu-linaro (Ubuntu)
tags: added: arm-porting-queue
Revision history for this message
Loïc Minier (lool) wrote :

I don't think qemu supports ptrace, and it might or might not be hard to implement, Peter would be in a better position to comment

However the usual way to gdb with qemu's linux-user emulation is explained in http://lists.linaro.org/pipermail/linaro-dev/2011-January/002022.html and doesn't require qemu to implement ptrace

Revision history for this message
Peter Maydell (pmaydell) wrote :

I think implementing ptrace in user mode qemu would be remarkably tricky. You'd have to somehow identify that the process you were trying to attach to was really another user-mode qemu process and not a native binary, and then you'd need to establish communication with it over some channel, so you could implement the ptrace syscalls by asking the other qemu to do things for you. There are undoubtedly some really nasty edge cases, like what happens if you try to attach and the other qemu is sat in a blocking syscall, making sure the "gdb forks and execs the binary to debug" case works properly, and so on.

In short, it's a lot of effort for a remarkably small gain, when you can just attach a cross-gdb to qemu directly as Loic suggests.

Loïc Minier (lool)
Changed in qemu-linaro (Ubuntu):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.