This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] mips: Fix store/load gp registers to/from ucontext_t
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Gordana Cmiljanovic <Gordana dot Cmiljanovic at imgtec dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Wed, 17 May 2017 15:11:29 +0000
- Subject: Re: [PATCH] mips: Fix store/load gp registers to/from ucontext_t
- Authentication-results: sourceware.org; auth=none
- References: <655B60FB9854204DB1D72C498A631BB6013C7191E7@BADAG02.ba.imgtec.org>
On Wed, 17 May 2017, Gordana Cmiljanovic wrote:
> More details, not to be included in the commit message:
>
> get/set/make/swap context implementations for MIPS O32
> incorrectly assume general purpose registers are 32bit
> but they are defined as 64bit in mcontext_t structure, as per:
>
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/mips/sys/ucontext.h;h=f766dacd205f49a479f17b19df476a8103f55a2e;hb=refs/heads/master#l35
> and
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/mips/sys/ucontext.h;h=f766dacd205f49a479f17b19df476a8103f55a2e;hb=refs/heads/master#l68
>
> This leads to incorrect general purpose register values.
Is this a user-visible bug (for which a testcase could be written, in
which case one should be added and a bug filed in Bugzilla)? Or is it not
user-visible because the functions are consistent with each other (hence
all the existing tests passing), just not with the intended structure
layout, and calling setcontext with a context from a signal handler has
unspecified results anyway?
--
Joseph S. Myers
joseph@codesourcery.com