Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

aarch64's cpu_setmcontext doesn't handle _UC_SETSTACK -- is this a bug?



Hi,

I'm debugging a golang issue where lwps in 64-bit mode seem to
sometimes escape their signal stack and run on the main lwp stack,
despite SS_ONSTACK being set.

Comparing the 32-bit and 64-bit versions of cpu_setmcontext() and
sendsig_siginfo() I have found differences in how _UC_SETSTACK is
handled.

cpu_setmcontext:
https://nxr.netbsd.org/xref/src/sys/arch/aarch64/aarch64/cpu_machdep.c#198
https://nxr.netbsd.org/xref/src/sys/arch/arm/arm/sig_machdep.c?r=1.51#265

send_siginfo:
https://nxr.netbsd.org/xref/src/sys/arch/arm/arm/sig_machdep.c?r=1.51#113
https://nxr.netbsd.org/xref/src/sys/arch/aarch64/aarch64/sig_machdep.c?r=1.4#71

It seems that aarch64's implementation doesn't handle these flags.
I wonder if this is a bug or by design?
It looks like it could cause problems for userland programs that make
extensive use of setucontext(2).

Kind regards,
-Tobias


Home | Main Index | Thread Index | Old Index