[RFC PATCH v2 2/2] s390: Add SFrame support for s390 64-bit (s390x) architecture

Jens Remus jremus@linux.ibm.com
Fri Jul 18 15:41:27 GMT 2025


On 27.06.2025 15:38, Jens Remus wrote:
> Generation of SFrame stack trace information is supported on s390 64-bit
> (s390x) architecture.  Enable stack tracing using SFrame on s390 64-bit
> too.

> Add support to unwind SP, FP, and RA from (RT) signal frames on s390
> 64-bit (s390x).  Add support to detect outermost frame on s390 64-bit
> (s390x).

> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/uw-sigframe.h b/sysdeps/unix/sysv/linux/s390/s390-64/uw-sigframe.h

> +#define MD_DETECT_OUTERMOST_FRAME s390_detect_outermost_frame
> +
> +static _Unwind_Reason_Code
> +s390_detect_outermost_frame (frame *frame)
> +{
> +  const char *pc = (const char *) frame->pc;
> +
> +  /* Outermost frame's PC points to the unreachable invalid instruction
> +     0x0000 in _start.  */
> +  if (pc[0] == 0x00 && pc[1] == 0x00)
> +    return _URC_END_OF_STACK;

Stefan brought up, that this test is flawed, as it only works for Glibc
_start and none of the other instances that have cfi_undefined (r14):

clone, clone3, and makecontext

> +
> +  return _URC_NO_REASON;
> +}

Indu, Claudiu,
looks like s390 64-bit (s390x) support for backtracing using SFrame
requires SFrame to represent .cfi_undefined <RA>, as previously
discussed elsewhere.  I'll send a Binutils patch.

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@de.ibm.com

IBM

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/



More information about the Libc-alpha mailing list