Sponsored Content
Top Forums Programming C++ application halts at popen system call Post 302323220 by Amiya Rath on Friday 5th of June 2009 08:17:16 PM
Old 06-05-2009
C++ application halts at popen system call

Hi All,
My application gets hang at the popen statement in Soalris 5.8. While debugging I found that it halts at _lwp_sema_wait. After googling I have added /usr/lib/lwp in the LD_LIBRARY_PATH and now it halts at lwp_park. Please help me what I need to do to solve this issue. The application runs fine in AIX and other solaris box.
The dbx, pstack and truss output are as below.
Dbx
====================================================================================
81 fp=popen(command,”r”);
(dbx 1) where
current thread: t@1
=>[1] _lwp_sema_wait(0xb51b8, 0x0, 0x0, 0x0, 0x0, 0x2), at 0xfeb9f8bc
[2] _park(0xb51b8, 0xff0bc000, 0x0, 0xb50f0, 0x23154, 0x0), at 0xff0996f4
[3] _swtch(0xb50f0, 0xb50f0, 0xff0bc000, 0x5, 0x1000, 0x0), at 0xff0993bc
[4] _mutex_adaptive_lock(0xff0c7864, 0x4c00, 0x1000, 0xfffeffff, 0x1, 0x4d58), at 0xff09adc8
[5] _cmutex_lock(0xfebc0608, 0xff0bc000, 0xff0bc000, 0xfeb41da0, 0xfebc0438, 0x0), at 0xff09aadc
[6] malloc(0xc, 0x27cac, 0xb4040, 0xfebc0430, 0xb4050, 0x10), at 0xfeb41da0
[7] _insert_nolock(0x0, 0x6, 0xfebbc008, 0x2711, 0x40, 0x40), at 0xfeb94394
[8] popen(0xb4040, 0x6, 0x2711, 0x5, 0xffbe8744, 0x38), at 0xfeb9423c
[9] zcxeval(0xffbe8844, 0xffbe8614, 0xffbe872c, 0xfefeec9c, 0x0, 0x2), at 0xfee503f8
[10] openfile(0xffbe89d8, 0x1, 0xffbe8ac4, 0x0, 0xb, 0x0), at 0xfedb1508
[11] ypmbacktrace(0xb, 0xfecaa358, 0x0, 0x0, 0x0, 0x0), at 0xfedb04a4
[12] error_handler(0xb, 0xffbe9020, 0xffbe8d68, 0x0, 0x0, 0x0), at 0xfecaa570
[13] __sighndlr(0xb, 0xffbe9020, 0xffbe8d68, 0xfecaa358, 0xb5198, 0xb5188), at 0xff0ab218
---- called from signal handler with signal 11 (SIGSEGV) ------
[14] _free_unlocked(), at 0xfeb42c8c
[15] free(0xc300000, 0x0, 0x0, 0xfeb91fe4, 0x36, 0x0), at 0xfeb42c3c
[16] SPIBase::~SPIBase(0xffbea79c, 0x0, 0xfebbfc78, 0xfebbfc78, 0x0, 0x0), at 0xff2d5308
[17] SPIFiles::~SPIFiles(0xffbea79c, 0x2, 0x1, 0x1, 0x7c53c, 0x40000000), at 0xff2da8ec
[18] Load_Band_Struct::~Load_Band_Struct(0xffbea79c, 0x2, 0x7d074, 0x0, 0x0, 0xffbe9f9a), at 0x362a0
[19] main_code(0x0, 0x0, 0xffbe9fde, 0x7c6b8, 0xffbed8c1, 0x7c6bc), at 0x346e8
[20] ycx_init_term(0x1, 0x0, 0x2ddd0, 0x3, 0xffbeec2c, 0x0), at 0xfeca9b58
[21] ycxonxp(0x2ddd0, 0x3, 0xffbeec2c, 0x67adc, 0x0, 0x0), at 0x36a10
[22] main(0x3, 0xffbeec2c, 0xffbeec3c, 0x7c400, 0x0, 0x0), at 0x2dd8c

Pstack output
====================================================================================
----------------- lwp# 1 / thread# 1 --------------------
feb9f8bc lwp_sema_wait (b51b8)
ff0996f4 _park (b51b8, ff0bc000, 0, b50f0, 23154, 0) + 114
ff0993bc _swtch (b50f0, b50f0, ff0bc000, 5, 1000, 0) + 424
ff09adc8 _mutex_adaptive_lock (ff0c7864, 4c00, 1000, fffeffff, 1, 4d58) + 160
ff09aadc _cmutex_lock (febc0608, ff0bc000, ff0bc000, feb41da0, febc0438, 0) + 84
feb41da0 malloc (c, 27cac, b4040, febc0430, b4050, 10) + 18
feb94394 _insert_nolock (0, 6, febbc008, 2711, 40, 40) + 3c
feb9423c popen (b4040, 6, 2711, 5, ffbe8744, 38) + 264
fee503f8 __0FHzcxevalR6HYsgstrdRC6HYsgstrd (ffbe8844, ffbe8614, ffbe872c, fefeec9c, 0, 2) + 90
fedb1508 __0FIopenfileRP6EFILEUc (ffbe89d8, 1, ffbe8ac4, 0, b, 0) + 258
fedb04a4 __0FMypmbacktracev (b, fecaa358, 0, 0, 0, 0) + 3c
fecaa570 __0FNerror_handleri (b, ffbe9020, ffbe8d68, 0, 0, 0) + 218
ff0ab218 __sighndlr (b, ffbe9020, ffbe8d68, fecaa358, b5198, b5188) + c
ff0a821c sigacthandler (b, b50f0, 0, 0, 0, ff0bc000) + 708
--- called from signal handler with signal 11 (SIGSEGV) ---
feb42c8c _free_unlocked (c300000, febbc008, c300000, febbc008, 148ea0, 0) + 40
feb42c3c free (c300000, 0, 0, feb91fe4, 36, 0) + 20
ff2d5308 __0oHSPIBasedtv (ffbea79c, 0, febbfc78, febbfc78, 0, 0) + b0
ff2da8ec __0oISPIFilesdtv (ffbea79c, 2, 1, 1, 7c53c, 40000000) + 84
000362a0 __0oQLoad_Band_Structdtv (ffbea79c, 2, 7d074, 0, 0, ffbe9f9a) + 50
000346e8 __0FJmain_codeRC6HYsgstrd (0, 0, ffbe9fde, 7c6b8, ffbed8c1, 7c6bc) + 6918
feca9b58 __0FNycx_init_termUcPFv_iPFRC6HYsgstrd_iiPPc (1, 0, 2ddd0, 3, ffbeec2c, 0) + 4d8
00036a10 __0FHycxonxpPFRC6HYsgstrd_iiPPc (2ddd0, 3, ffbeec2c, 67adc, 0, 0) + 88
0002dd8c main (3, ffbeec2c, ffbeec3c, 7c400, 0, 0) + 7c
0002dbc4 _start (0, 0, 0, 0, 0, 0) + dc
----------------- lwp# 2 / thread# 2 --------------------
feb9f20c signotifywait ()
ff09e980 _dynamiclwps (ff0bc000, ff3de0c4, ff3813f8, ff381b78, 2f, 7efefeff) + 24
ff0a1c90 thr_yield (0, 0, 0, 0, 0, 0) + 8c
----------------- lwp# 3 --------------------------------
feb9cdb0 door (0, 0, 0, 0, ff045d38, 4)
ff0a687c _sc_door_func (4, ff0bc000, ff0bd678, 3, ff0bc000, 1) + 6c
ff09a380 _lwp_start (ff045d98, 0, 6000, ffbee534, 0, 0) + 18
ff0a1c90 thr_yield (0, 0, 0, 0, 0, 0) + 8c
----------------- lwp# 4 --------------------------------
ff0a92fc lwp_cond_wait (ff0c34f0, ff0c3500, ff0bcd88)
ff098cdc _age (3e, ff0bcd74, ff0bc000, 3, ff0bc000, 1) + 74
ff09a380 _lwp_start (fe60bd98, 0, 0, 0, 0, 0) + 18
ff0a1c90 thr_yield (0, 0, 0, 0, 0, 0) + 8c
----------------- lwp# 5 / thread# 4 --------------------
feb9f8bc lwp_sema_wait (ff0c30a8)
ff0a6b74 _tdb_agent (ff0c34d0, ff0c2e48, 0, 1, 0, fe60bd98) + 50
ff0a1c90 thr_yield (0, 0, 0, 0, 0, 0) + 8c
-------------------------- thread# 3 --------------------
ff09d9e0 _reap_wait (ff0c0988, 1e8fc, 0, ff0bc000, 0, 0) + 38
ff09d738 _reaper (ff0bce08, ff0c2710, ff0c0988, ff0bcde0, 1, fe400000) + 38
ff0ab11c _thread_start (0, 0, 0, 0, 0, 0) + 40
truss -p 10000
====================================================================================
lwp_sema_wait(0x000B51B8) (sleeping...)
signotifywait() (sleeping...)
door_return(0x00000000, 0, 0x00000000, 0) (sleeping...)
lwp_cond_wait(0xFF0C34F0, 0xFF0C3500, 0xFF0BCD88) (sleeping...)
lwp_sema_wait(0xFF0C30A8) (sleeping...)

Thanks in advance for help and suggestions.
Reagrds
Amy
 

10 More Discussions You Might Find Interesting

1. Programming

Formatted piping popen() system call

Facingproblem in writing a c code that sorts a given string using piping popen() system call.. the question reads write a c program inclusive of all error conditions that sorts the given string of arrays as{"bravo","sit","class"}using formatted piping popen() system call (1 Reply)
Discussion started by: toughguy2handle
1 Replies

2. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

3. Programming

c system call

How the c compiler differentiates the system calls and function calls? (1 Reply)
Discussion started by: rangaswamy
1 Replies

4. AIX

system() in a c++ program halts in AIX 5.3

system() in a c++ program halts in AIX 5.3, though the corresponding binary working fine in AIX 5.2 and lower version. I am executing a script using system in a c++ program. the script has the execute permission by all. (0 Replies)
Discussion started by: Amiya Rath
0 Replies

5. Programming

C:system call

Hi I'm studing the system call. I've written a small program that return the time spent in doing some operations. Now I'd like to write one that return the time spent in user mode of a process. I'm reading that i should use the tms struct: clock_t times(struct tms *buf); struct tms {... (2 Replies)
Discussion started by: Dedalus
2 Replies

6. Programming

socket system call can not succedd right after application crash.

hello all, I have developed a server application in C for ulinux kernel 2.6.It works very fine; creating a socket, binding it to a port, listening for incoming sockets and accepting them ,all finish without any error. But there is a problem regarding application crash.After an intentionally... (1 Reply)
Discussion started by: Sedighzadeh
1 Replies

7. Programming

question about system and popen in C

in man system it talks about SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored. Does this signal stuff also happen in popen command? (even though man popen says nothing about signals) also if I am not using wait(&status) and I am using waitpid(pid, NULL, 0) how would... (1 Reply)
Discussion started by: omega666
1 Replies

8. Programming

need help with system call

hi everyone i wrote a system call and compiled the kernel succesfully... my system call is in a file in the kernel folder named my_syscall1.c (kernel/my_syscall1.c) the header file for this system call i added it in the folder include like this include/my_syscall1/my_syscall1.h my problem is... (2 Replies)
Discussion started by: demis87
2 Replies

9. Shell Programming and Scripting

system call

Trying to figure out a load issue with a webserver. I have traced a php script and noticed the following connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XX.XX.XX.XX")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000035> poll(, 1, 2000) = 1 () <0.000120>... (5 Replies)
Discussion started by: rajan007
5 Replies

10. OS X (Apple)

Applescript application call problem...

Hi all... I am trying to create a shell project purely for this Macbook Pro. I do NOT want to use SOX as the sampling _source_ but Quicktime instead, the idea being that NO third party installs will be needed. The code below works fine except the commented out Applescript line does not do... (2 Replies)
Discussion started by: wisecracker
2 Replies
All times are GMT -4. The time now is 12:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy