the TLS pointer, therefore wrecking the pthread environement.
Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.
We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.
While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)
Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64
Approved by core@
one. The implementation doesn't provide an async-safe sem_post and can't
without a lot of work on the pthread primitives.
Remove bogus time out requirement in test case, it should have been
a "known failure" if anything.
PR port-powerpc/44387.
XXX the ugly sleep at the end is because ATF will mark an un-triggered
race condition (ie, the test passes unexpectedly) as a test failure otherwise.
- The use.fs property is gone.
- Mark the tests/fs/t_create:attrs test as broken when using the default
unprivileged-user:_atf setting. This probably deserves a fix somehow
but I'm not sure at this point.
as an xfail everywhere and, while doing so, make the test longer so that
we trigger the failure all the time -- of course, being a race this may
still happen but the chances should be pretty low.
that does. The former works all the time but the latter gets consistently
stuck on amd64. Mark the latter as an expected timeout (should be a "race
condition" test, but atf does not have such a thing yet[1]).
This clears the test failures, at least, under anita running NetBSD/i386.
From pooka@: this could well be because calling sem_post(3) from a signal
handler can't possibly do the right thing with the pthread implementation.
However, according to signal(7), sem_post(3) is signal-async safe...
While here, program alarms using a timeout shorter than 1 second to speed
up the execution of the tests.
1: Good thing is I finally understand what a "race condition" test looks
like, I believe.
Initial work from the GSoC 2008 project by Lukasz Strzygowski.
I think that this, together with the previous conversion of librt, obsoletes
the tests in the semaphore/ directory. Will investigate later.