[comp.sys.sun] lwp library infinite loop?

paul@uunet.uu.net (Paul Nordstrom) (10/08/90)

I have been having a problem that I believe has to do with my use of the
lightweight process library.  I have a server program with a main thread
that accepts socket connections, spins off a thread to talk to the user at
the other end, and waits for the next connection.  If a user thread
detects an error with its socket connection (e.g. the user's application
dies), it releases any resources it has acquired, and terminates itself
with lwp_destroy.  Most of the time, this seems to work just fine.
However, on rare occasion (say, one time out of 30), when a thread
terminates, the entire process goes into an infinite loop.  To further
complicate the issue, if I send the process a -TERM, the process continues
on as if there had never been a problem!!  Under normal operation, -TERM
will terminate the process, i.e. I am not catching the signal
intentionally.  My first question is the following:  Has anyone ever seen
this kind of behavior before?  Know of a fix?

My second question is related, sort of.  One time I was running the
program under my debugger when the loop occurred.  I thought, AHA!, I'll
just break out and see where I am.  Unfortunately, all I got was the
instruction address, then my debugger crashed.  So, my second question is
regarding the availability of a program that will produce a load map of a
program.  ld has a flag for requesting a load map, but the map is so
primitive as to be totally useless--no addresses!  So, how can one find
out in what module a particular instruction address might be found?

Possibly relevant details:
SunOS 4.0.1
3/60, 12MB
application compiled with Oregon C++ Ver. 2.0.2

Any ideas, anyone?   Post or mail, I read these groups.  Thanks in advance
for any help.

Paul Nordstrom
Gill & Co., L.P.
uunet!gill!paul