Fix LWP's stack initialization for -s

With -s, LWP initializes thread stacks to track stack use.  It did
that after makecontext(), with disastrous results on systems where
makecontext() writes something to the stack that swapcontext() expects
to find there.  Makes FreeBSD 6.2 crash in swapcontext().

Factor stack allocation out of lwpNewContext() into lwpNewStack().
Move call of lwpStackCheckInit() into lwpNewStack().
This commit is contained in:
Markus Armbruster 2008-02-14 23:47:27 +01:00
parent 40eb78eb74
commit 5c2f7646e1
3 changed files with 33 additions and 27 deletions

View file

@ -73,7 +73,7 @@ struct lwpQueue {
extern int LwpStackGrowsDown;
int lwpNewContext(struct lwpProc *, int);
int lwpNewContext(struct lwpProc *);
void lwpSwitchContext(struct lwpProc *, struct lwpProc *);
void lwpAddTail(struct lwpQueue *, struct lwpProc *);
struct lwpProc *lwpGetFirst(struct lwpQueue *);