This is the mail archive of the glibc-bugs@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]

[Bug libc/4662] New: setjmp doesn't specify __attribute__((returns_twice))


Working recently on ARM i found my this pointer was being corrupted in a method
containing a setjmp.

When exiting the setjmp via the longjmp the this pointer had been incremented.

There was quite a lot of code between where the setjmp and the longjmp were
called, and the this pointer wasn't used for the tail end of that code. Gcc was
clobbering the this pointer when it went out of use, incrementing it to refer to
a member variable.

That behaviour should be prevented with __attribute__((returns_twice)) in the
headers, likewise for vfork, but returns_twice doesn't seem to be specified
anywhere in glibc (cvs.)

I can try and put a test case together, I refrained so far because I'm a little
busy and it seems obvious that the flag needs to be specified. (and perhaps
implemented in gcc too?..)

-- 
           Summary: setjmp doesn't specify __attribute__((returns_twice))
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: bugzilla at ryancocks dot net
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=4662

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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