This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix mcontext_t sigcontext namespace (bug 21457)


On 06/27/2017 07:41 AM, Joseph Myers wrote:
> On Mon, 26 Jun 2017, Zack Weinberg wrote:
> 
>> I'm concerned that this may be a step too far in the direction of POSIX
>> conformance at the expense of existing code: specifically, existing code
>> that assumes that struct sigcontext and mcontext_t are "compatible"
>> types (in the C-standardese sense), not just structures with the same
>> set of members.  The most _obvious_ ways this would show up are passing
>> 'mcontext_t *' values to functions taking 'struct sigcontext *'
>> arguments, or using structure assignment to copy between the two, both
>> of which should cause compile failures; but there could be other
>> problems (aliasing, perhaps), that only show up at runtime.
> 
> Any such assumptions would already not work on x86_64 / x86, where 
> mcontext_t is not struct sigcontext.  For that reason, I don't think such 
> issues are particularly likely, especially any that don't show up at 
> compile time.

I agree with Joseph. At first glance it looks like they are not compatible 
on sh5, mips, sparc, m68k, x86/x86_64, nios2, s390/s390x, and power.

On hppa, ia64, arm, alpha, aarch64, and tile, they do have a
`typedef struct sigcontext mcontext_t;` which would make this work.

That's a 50/50 chance of it working.

I would cleanup bug 21457.

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]