[OpenAFS-devel] LWP--stackpointer malloc() being weird on System/390

Adam Thornton adam@fsf.net
Wed, 3 Jan 2001 11:04:09 -0600


This is all from src/lwp/lwp.c. OpenAFS 1.0.1, with Neale Ferguson's
S/390 patches.

(with debugging turned on (in process.c too) and a couple additional
trace messages, and I also removed the redeclaration of MAXINT,
although that didn't change the behavior):

***LWP (0x437778): Entered LWP_InitializeProcessSupport
***LWP (0x437778): Entered LWP_CreateProcess
***LWP (0x437778): Initialized Stackpointer...
Stack pointer after malloc: 0x40114008
***LWP (0x437778): Entered Initialize_Stack
After Initialize_Stack Stackpointer: 0x40114008 Stacksize: 0x30000
***LWP (0x437778): Entered Initialize_PCB
savecontext
(0) 0x4370f0   (1) 0x437910   (2) 0x437778   (3) 0x30000   (4) 0x401d18   
(5) 0x1   (6) 0xc010f3c8   (7) 0x80420a68   (8) 0x80420aea   (9) 0x7ffff080   
***LWP (0x437910): Entered Create_Process_Part2
savecontext
(0) 0x4370f0   (1) 0x437910   (2) 0x0   (3) 0x4377d8   (4) 0x401d18   
(5) 0x1   (6) 0xc010f3c8   (7) 0x80420a68   (8) 0x80420aea   (9) 0x7fffefb8   
stackcheck = 66051: stack = 66051 
topstack = 0x401d18: stackptr = 0x40114008: stacksize = 0x30000
Wed Jan  3 10:58:35 2001 LWP: stack overflow in process IO MANAGER!
Aborted


So what it looks like is that malloc() for stackptr is returning
something that is shifted left 8 bits from what it should be.  The
question is, why is that happening?  Does anyone have any ideas?
Should I go the AIX route and try using alloca() to fake out the
memory management?

Adam