Sponsored Content
Full Discussion: Process Hanging
Top Forums UNIX for Dummies Questions & Answers Process Hanging Post 302435384 by jramesh1 on Wednesday 7th of July 2010 07:53:57 AM
Old 07-07-2010
Process Hanging

Hi! I have written a program three threads will be created to execute three different Sybase SQLs. so three thread will call a method runQuery.
In run query again we create child process to execute the actuall SQL by connecting to the SQL. When I run the process first three threading working fine. but third thread relate child process is hangin just after fork().

Can somebody let me know the why the child process hangs with lwp_park( truss). is there any clue from below information. Any deadlock? locks?

STRUSS INFO:
Code:
% truss -p 5586
/4: waitid(P_PID, 5590, 0xFEB7B760, WEXITED|WTRAPPED) (sleeping...)
/1: lwp_wait(4, 0xFFBFF7BC) (sleeping...)
% truss -p 5590
lwp_park(0x00000000, 0) (sleeping...)

Here is
parent pid:5586
child pid:5590
PSTACK INFO:
Code:
:pstack 5586
----------------- lwp# 1 / thread# 1 --------------------
ff046458 lwp_wait (4, ffbff7bc)
ff041e40 _thrp_join (4, 0, ffbff84c, 1, ffbff7bc, ff073700) + 34
00024b2c __1cUGenericDataExtractorLextractData6M_i_ (ffbff91c, ffbffab9, 0, 0, 0, 0) + 1dc
00029868 main (2, ffbff9b4, ffbff9c0, 72800, ff091340, 0) + 258
0001e818 _start (0, 0, 0, 0, 0, 0) + 108
----------------- lwp# 4 / thread# 4 --------------------
ff046750 waitid (0, 15d6, feb7b760, 3)
ff039030 waitpid (15d6, feb7b8dc, 0, 0, 48, b) + 60
00023674 __1cLSimpleQdDueryKexecuteSQdDL6MrnJQdDueryInfo__i_ (7ce58, feb7be4c, 7c684, 58640, 72, ff072f18) + 67c
00026b5c __1cOQdDueryProcessorRprocessConfigFile6M_i_ (8bc10, feb7c000, 0, 0, 290f8, 0) + b74
00025c20 __1cOQdDueryProcessorIrunQdDuery6M_i_ (8bc10, 0, 0, 137d4, ff0ea810, 7d470) + 30
00029148 runQuery (8bc10, feb7c000, 0, 0, 290f8, 0) + 50
ff045238 _lwp_start (0, 0, 0, 0, 0, 0)
 
:pstack 5590
ff0452d8 lwp_park (0, 0, 0)
ff03df18 mutex_lock_internal (7ba48, 0, 1, 10, ff06e2f4, 0) + 2cc
0003d6c8 __1cNstream_rmutexLrmutex_lock6M_v_ (73470, 73470, 0, 58640, 72, ff072f18) + 9c
0002ca38 __1cNstream_lockerHdo_lock6M_v_ (feb7b834, 5d795, 0, 0, ff073700, fee41200) + 48
0002c230 __1cNstream_lockerElock6M_v_ (feb7b834, 73470, 0, 58640, 72, ff072f18) + 30
0002b2c8 __1cHostream2l6Mpkc_r0_ (73424, 5d795, 0, 0, ff073700, fee41200) + b8
000232b0 __1cLSimpleQdDueryKexecuteSQdDL6MrnJQdDueryInfo__i_ (7ce58, feb7be4c, 7c684, 58640, 72, ff072f18) + 2b8
00026b5c __1cOQdDueryProcessorRprocessConfigFile6M_i_ (8bc10, feb7c000, 0, 0, 290f8, 0) + b74
00025c20 __1cOQdDueryProcessorIrunQdDuery6M_i_ (8bc10, 0, 0, 137d4, ff0ea810, 7d470) + 30
00029148 runQuery (8bc10, feb7c000, 0, 0, 290f8, 0) + 50
ff045238 _lwp_start (0, 0, 0, 0, 0, 0)


Last edited by pludi; 07-07-2010 at 09:13 AM.. Reason: code tags, please...
 

10 More Discussions You Might Find Interesting

1. Programming

mq_open Hanging

One of my program which uses posix message queues was hanging in mq_open() system call, and after some time, it threw an error "Interrupted system call". I couldnt even unlink that message queue using mq_unlink(), as I have to use mq_open() prior to mq_unlink(). I use SunOS 5.7 Generic_106541-22... (0 Replies)
Discussion started by: Deepa
0 Replies

2. UNIX for Dummies Questions & Answers

how to tell if process is hanging

On Solaris 8.. 28166 user 3693M 2736M sleep 5 0 0:05.38 0.0% PROCESS/4 How can I tell if this process is doing anything or just hanging? (2 Replies)
Discussion started by: dangral
2 Replies

3. UNIX for Dummies Questions & Answers

Hanging commands

Hello, I just tried to run this command: /usr/lib/sendmail -d0.1 -bt < /dev/null | grep -i version Its doing what I want: writing out the sendmail version. But on some machines it writing the version and then exit to the prompt but on others its writing the version but then hangs, I need to... (0 Replies)
Discussion started by: jOOc
0 Replies

4. Solaris

hanging sockets!??!

hi all, i had a program which created a socket on port 7113, but for some reason the program was hunbg and I had to Ctrl+c it. I ran the program for a couple of times and now when I do a netstat -a I see that these sockets are lingering and that might be the reason why my program is not... (1 Reply)
Discussion started by: Naanu
1 Replies

5. UNIX for Dummies Questions & Answers

Hanging port?

Ok, this question my be different. I can ping our unix box, but when we I to access the webpage I cant. To access the webpage I type http://ipaddress:some port. How do I check if a port is hanging and how would I un hang it. Sorry if question doesnt make sense. (1 Reply)
Discussion started by: NycUnxer
1 Replies

6. UNIX for Advanced & Expert Users

can hanging perl process wipe out a directory?

Hi, This weekend i left a perl script running , I was running it in a remote machine. The machine seems to have been rebooted during the weekend. When i got back on monday the entire directory containing the script was wiped out. The process had been aborted. Nobody has access to the directory... (2 Replies)
Discussion started by: aboxilica
2 Replies

7. Linux

Script to simulate hanging process

I want to create a script to simulate a process that hangs to test a java application. My java app executes a system command, which can also be executing scripts, etc. Any ideas on such a script? The java code is: Runtime rt = Runtime.getRuntime(); Process p = rt.exec("sh... (4 Replies)
Discussion started by: brendan76
4 Replies

8. Shell Programming and Scripting

Script is hanging

Hello, I have the following shell script and when i execute, it keeps hanging and nothing happens Please let me know. Requirement is to read data from file and pass it to the sql and create files as shown. code /******** #!/bin/sh while read user.dat do echo "user = $1 email =... (1 Reply)
Discussion started by: rakeshsr12
1 Replies

9. Shell Programming and Scripting

nslookup hanging

Hey folks. Long time lurker, first time poster. I'm a bit of a newbie at "coding" (obviously, scripting is a teensy bit different than coding) and I've run into a problem that I just can't seem to get around. I'm going through a list of servers to check their name, IP, reverse-NSLOOKUP name and... (2 Replies)
Discussion started by: Bearwhale
2 Replies

10. Shell Programming and Scripting

sed hanging

/bin/sed -n '$q;5633653,0 p' lfile lfile is a log file that is being updated several times a second. so, the command above figures out the line number it wants in the lfile and then proceeds to output all lines from that line number to the end of the file. the problem is, the end of the... (2 Replies)
Discussion started by: SkySmart
2 Replies
waitpid(3C)						   Standard C Library Functions 					       waitpid(3C)

NAME
waitpid - wait for child process to change state SYNOPSIS
#include <sys/types.h> #include <sys/wait.h> pid_t waitpid(pid_t pid, int *stat_loc, int options); DESCRIPTION
The waitpid() function will suspend execution of the calling thread until status information for one of its terminated child processes is available, or until delivery of a signal whose action is either to execute a signal-catching function or to terminate the process. If more than one thread is suspended in waitpid(), wait(3C), or waitid(2) awaiting termination of the same process, exactly one thread will return the process status at the time of the target process termination. If status information is available prior to the call to waitpid(), return will be immediate. The pid argument specifies a set of child processes for which status is requested, as follows: o If pid is equal to (pid_t)-1, status is requested for any child process. If pid is greater than (pid_t)0, it specifies the process ID of the child process for which status is requested. o If pid is equal to (pid_t)0 status is requested for any child process whose process group ID is equal to that of the calling process. o If pid is less than (pid_t)-1, status is requested for any child process whose process group ID is equal to the absolute value of pid. One instance of a SIGCHLD signal is queued for each child process whose status has changed. If waitpid() returns because the status of a child process is available, and WNOWAIT was not specified in options, any pending SIGCHLD signal associated with the process ID of that child process is discarded. Any other pending SIGCHLD signals remain pending. If the calling process has SA_NOCLDWAIT set or has SIGCHLD set to SIG_IGN and the process has no unwaited children that were transformed into zombie processes, it will block until all of its children terminate, and waitpid() will fail and set errno to ECHILD. If waitpid() returns because the status of a child process is available, then that status may be evaluated with the macros defined by wait.h(3HEAD) If the calling process had specified a non-zero value of stat_loc, the status of the child process will be stored in the location pointed to by stat_loc. The options argument is constructed from the bitwise-inclusive OR of zero or more of the following flags, defined in the header <sys/wait.h>: WCONTINUED The status of any continued child process specified by pid, whose status has not been reported since it continued, is also reported to the calling process. WNOHANG The waitpid() function will not suspend execution of the calling process if status is not immediately available for one of the child processes specified by pid. WNOWAIT Keep the process whose status is returned in stat_loc in a waitable state. The process may be waited for again with identi- cal results. WUNTRACED The status of any child processes specified by pid that are stopped, and whose status has not yet been reported since they stopped, is also reported to the calling process. WSTOPPED is a synonym for WUNTRACED. RETURN VALUES
If waitpid() returns because the status of a child process is available, it returns a value equal to the process ID of the child process for which status is reported. If waitpid() returns due to the delivery of a signal to the calling process, -1 is returned and errno is set to EINTR. If waitpid() was invoked with WNOHANG set in options, it has at least one child process specified by pid for which status is not available, and status is not available for any process specified by pid, then 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The waitpid() function will fail if: ECHILD The process or process group specified by pid does not exist or is not a child of the calling process or can never be in the states specified by options. EINTR The waitpid() function was interrupted due to the receipt of a signal sent by the calling process. EINVAL An invalid value was specified for options. USAGE
With options equal to 0 and pid equal to (pid_t)-1, waitpid() is identical to wait(3C). The waitpid() function is implemented as a call to the more general waitid(2) function. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ SEE ALSO
intro(2), exec(2), exit(2), fork(2), pause(2), sigaction(2), ptrace(3C), signal(3C), siginfo.h(3HEAD), wait(3C), waitpid(3C), wait.h(3HEAD), attributes(5), standards(5) SunOS 5.10 19 Jun 2003 waitpid(3C)
All times are GMT -4. The time now is 05:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy