[OpenAFS-devel] Resending: Issue with pthreads lib and XSTAT_CM

Sumeet Ahuja sahuja@real.com
Wed, 18 Apr 2001 17:16:02 -0700


Hello

We are considering using AFS and I was involved in doing some small 
prorotypes using libadmin and xstat. 

Everyting compiles fine and works great till the point I reach xstat_cm_init.
As soon as xstat_cm_init is called there is 
Segmentation Fault and core dump. 

(Debug output of LWP module and xstat_cm module looks like)
[xstat_cm_Init] Asking for 1 collection(s): 2 
[xstat_cm_Init] Initializing Rx on port 0 
savecontext 
(0) 0x80ba0b0 (1) 0x2 (2) 0x2 (3) 0xbffff0dc (4) 0xbffff0c4 
(5) 0x807af56 (6) 0x0 (7) 0x0 (8) 0x0 (9) 0x0 
Returning to 
(0) 0x80ba0b0 (1) 0x2 (2) 0x2 (3) 0xbffff0dc (4) 0xbffff0c4 
(5) 0x807af56 (6) 0x0 (7) 0x0 (8) 0x0 (9) 0x0 
savecontext 
(0) 0x80ba0b0 (1) 0x2 (2) 0x2 (3) 0xbffff0dc (4) 0xbffff0c4 
(5) 0x807af56 (6) 0x0 (7) 0x0 (8) 0x0 (9) 0x0 
savecontext 
(0) 0x80ba0b0 (1) 0x2 (2) 0x2 (3) 0xbffff0d0 (4) 0xbffff0b8 
(5) 0x807af56 (6) 0x0 (7) 0x0 (8) 0x0 (9) 0x0 
Returning to 
(0) 0x80ba0b0 (1) 0x2 (2) 0x2 (3) 0xbffff0d0 (4) 0xbffff0b8 
(5) 0x807af56 (6) 0x0 (7) 0x0 (8) 0x0 (9) 0x0 
savecontext 
(0) 0x80ba0b0 (1) 0x2 (2) 0x2 (3) 0xbffff0d0 (4) 0xbffff0b8 
(5) 0x807af56 (6) 0x0 (7) 0x0 (8) 0x0 (9) 0x0 

(** My comments : Now in LWP_CreateProcess and doing  savecontext **) 
savecontext 
(0) 0x80ba348 (1) 0xc000 (2) 0x80ba218 (3) 0xbffff1cc (4) 0xbffff1b4 
(5) 0x807af56 (6) 0x0 (7) 0x0 (8) 0x0 (9) 0x0 
Segmentation fault (core dumped)

REASON its failing is that I'm linking with pthreads lib 
(This is required by my app as well as libafsadminutil.a, libclientadmin.a)

WORKAROUND: 
It works fine if we do not link with libpthread.a 
(and other portions of our code are commented out)

Thats not possible b'coz the other modules which I'm linking with 
(bosAdmin, vosAdmin, clientAdmin) need pthreads lib, otherwise 
we end up with compile errors 
("undefined reference to '(***all pthread ....fns****)')

Just for verifying I linked xstat_cm_test also with pthreads lib and that 
too failed with same results.

Does that mean that I can't provide one application that does both the 
monitioring and configuration (using libadmin and xstat). 
Or am I missing something here.

Would appreciate your comments.
Thanks 
Sumeet