[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

8589.0. "sendsig: can't grow stack?" by CHEFS::DAVIDSONS () Sun Jan 26 1997 04:13

When a single threaded C++ program is linked -threads (required by a
library it uses) the following happens:

- parent (4419) forks child (4831)
- child immediatly calls gethostbyname(3), never returns!
- child receives signal 11 (segmentation violation) repeatedly
- child grows to ~33MB RSS
- child terminates because it can't grow stack

Any ideas how to debug/solve this?
     
Thanks,
	Stuart.
    
(environment: DU 3.2D-1, C++ 5.1, lazy swap, 96MB RAM, 192MB swap 25% used)
    

*** increase limits in parent shell

limit -h datasize unlimited
limit -h stacksize unlimited
limit -h memoryuse unlimited
limit -h addressspace unlimited
limit datasize unlimited
limit stacksize unlimited
limit memoryuse unlimited
limit addressspace unlimited

*** confirm limits increased in parent process

(dbx) set $pid=4419
(dbx) px thread.stack.uthread.utask.uu_rlimit[2].rlim_max
0x7fffffffffffffff
(dbx) px thread.stack.uthread.utask.uu_rlimit[2].rlim_cur
0x40000000
(dbx) px thread.stack.uthread.utask.uu_rlimit[3].rlim_max
0x7fffffffffffffff
(dbx) px thread.stack.uthread.utask.uu_rlimit[3].rlim_cur
0x2000000
(dbx) px thread.stack.uthread.utask.uu_rlimit[7].rlim_max
0x4000000000
(dbx) px thread.stack.uthread.utask.uu_rlimit[7].rlim_cur
0x4000000000
(dbx) px vm_tune.vt_maxvas
0x4000000000
    
# ps -o sig,sigmask,sigcatch,wchan -p 4419
 PENDING  BLOCKED   CAUGHT WCHAN
       0        0      efa socket

# ps -o sig,sigmask,sigcatch,wchan -p 4831
 PENDING  BLOCKED   CAUGHT WCHAN
       0        0      afa pg_wait

*** trace (freeware tool) o/p (last 2 lines repeated until child terminates)

Tracing process /proc/04831
[4831]: stat ("/etc/svc.conf", 0x3ffc0099478) = 0 [ , <8.3075.12323 -rwxr-xr-x
1
 bin bin 2045 854114780,789580057,789580057> ]
[4831]: open ("/etc/hosts", O_RDONLY, 0666) = 12
[4831]: SIGNAL [11 SIGSEGV]
[4831]: sigprocmask (3, 0x0, 0x0) = 1024
[4831]: SIGNAL [11 SIGSEGV]
[4831]: sigprocmask (3, 0x0, 0x0) = 1024

*** (the param's to sigprocmask from within gethostbyname doen't look valid)

*** child terminates

sendsig: can't grow stack, pid 4831, proc cm6.playback.nss, sig 11, pc
0x3ff8056
fefc
    
                            
T.RTitleUserPersonal
Name
DateLines
8589.1COL01::LINNARTZMon Jan 27 1997 06:234
    you should apply patch OSFXXX-00106. 
    
    This should solve your problem
     Pit
8589.2where's the patch?CHEFS::DAVIDSONSMon Jan 27 1997 13:077
    I checked guru::patches/osf/v3.2de1/README but could not find
    patch 00106.
    
    Can you give me a pointer?
    
    Thanks,
    	Stuart.
8589.3SMURF::MENNERit&#039;s just a box of Pax..Mon Jan 27 1997 13:201
    "patch 106" is for the V4.0* stream.
8589.4Possible conflict? How's it built?WTFN::SCALESDespair is appropriate and inevitable.Tue Jan 28 1997 13:479
It's possible that your "single-threaded" application is running into conflict
with threads from some library that you're using.  

.0> When a single threaded C++ program is linked -threads

Could you post the exact compile and link command(s)?


				Webb
8589.5single threadCHEFS::DAVIDSONSTue Jan 28 1997 14:034
    OK, I'll post the compile & link commands but 'ps -m' shows only
    one thread.
     
    Stuart.
8589.6No threads no conflict....WTFN::SCALESDespair is appropriate and inevitable.Tue Jan 28 1997 14:489
.5> only one thread.

Oh.  Nevermind, then.

If the argument that you're passing to gethostbyname(3) looks OK, then I'd
suspect it was QAR time (or something similar).


				Webb
8589.7Thanks, I'll QAR it.CHEFS::DAVIDSONSWed Jan 29 1997 13:261
    
8589.8recursive SEGV?CHEFS::DAVIDSONSWed Jan 29 1997 13:358
    What's the 'recursive SEGV problem' mentioned in note 8587?
    (looks like my problem)
    
    How does this happen?
    How can I debug it?
    
    Thanks,
    	Stuart.
8589.9Stating the obvious?WTFN::SCALESDespair is appropriate and inevitable.Wed Jan 29 1997 18:2918
.8> What's the 'recursive SEGV problem' mentioned in note 8587?

A recursive SEGV results when the attempt to handle a SEGV results in another
SEGV.
    
.8> How does this happen?

Generally, it's the result of a bug in a signal handler routine.  It can also
result if data on which a signal handler routine depends becomes corrupted.

.8> How can I debug it?

Running the program under a debugger (such as Ladebug) is usually a good
technique.  The debugger can stop the program when the first SEGV occurs, which
may give you a good idea of what's going on...


				Webb