ptrace test fails to build on ARM, struct pt_regs undefined

Bug #1580689 reported by Simon McVittie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppArmor
New
Undecided
Unassigned

Bug Description

The ptrace regression test uses struct pt_regs on ARM (and PowerPC), but doesn't appear to include the necessary headers to define that struct:

$ gcc -o ptrace ptrace.c
ptrace.c: In function ‘read_ptrace_registers’:
ptrace.c:58:19: error: storage size of ‘regs’ isn’t known
  ARCH_REGS_STRUCT regs;
                   ^

On ARM, the right one appears to be <asm/ptrace.h>, unless you know better. With the attached patch, it works.

The code path where struct pt_regs is used is if "defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__)", but that struct seems to be pulled in by one of the headers that's already used on both the PowerPCs (possibly <sys/ptrace.h>).

Build-tested on Debian armhf, powerpc, ppc64.

Revision history for this message
Simon McVittie (smcv) wrote :
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.