Solved

I can't solve the "sigsuspend" problem.

Posted on 2004-04-26
8
982 Views
Last Modified: 2008-02-01
My thread progream is running on solarlis 2.8
It uses msgrcv and mutex_lock functiion.
By the way, it is halted by sigsuspend.
I can't find the reason.

when the event is occurred, the process state which is monitored by truss, is as follows.

sigsuspend(0xFFAE6AC8)          (sleeping...)
signotifywait()                 (sleeping...)
lwp_cond_wait(0xFF275548, 0xFF275558, 0xFF26EDB0) (sleeping...)
door_return(0x00000000, 0, 0x00000000, 0) (sleeping...)

please help me!!!


0
Comment
Question by:hypark7
8 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10916343
Hi hypark7,

Are you sure you do not have any sigsuspend call in your code ...

if you are sure, then may be mutex_lock or some other function that needs to sleep for an event is calling sigsuspend

Sunnycoder
0
 
LVL 3

Expert Comment

by:norsethomas
ID: 10918608

hypark7,

please have a look at the output of the pstack command, i.e.

/usr/proc/bin/pstack pid

where pid is the process id of your process.  Which of the threads
executes the sigsuspend?

Usually the signotifywait() mentioned above is executed by the ASLWP
(the Asynchroneous Signals LWP).

Thomas
0
 

Author Comment

by:hypark7
ID: 10924052
Thank's for Sunnycoder & Thomas.

The additional comment is as follows.

I'm sure that I don't have any sigsuspend call in my code, and the "sigsuspend" event happened few and far between.  
I can't find the situation in a test system.

In my case, the deadlock state which is caused by mutex_lock is as follows, and I solved the problem.

lwp_mutex_lock(0xFF0D0000)      (sleeping...)
signotifywait()                 (sleeping...)
lwp_cond_wait(0xFF385548, 0xFF385558, 0xFF37EDB0) (sleeping...)
door_return(0x00000000, 0, 0x00000000, 0) (sleeping...)

or

lwp_sema_wait(0x00072168)       (sleeping...)
signotifywait()                 (sleeping...)
lwp_cond_wait(0xFF2734E8, 0xFF2734F8, 0xFF26CD80) (sleeping...)
door_return(0x00000000, 0, 0x00000000, 0) (sleeping...)

Which kind of function may cause the "sigsuspend" situation?

Moreover, the system is on service.

so, when it happened, I must kill the process and restart it instantly.

please, help me!!
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 3

Accepted Solution

by:
norsethomas earned 500 total points
ID: 10925726

> so, when it happened, I must kill the process and restart it instantly.

well, do a pstack before you kill it ;-)

sigsuspend might be called from any library function, even from within
the ASLWP; therefore we need the correct thread stack.

The sigsuspend might also be called from the ASLWP when it calls
one of your signal handlers ... Do you have signal handlers in your
code? If yes, how did you set them up (signal() or sigaction() ?)
What do they do? Do you use any kind of sync primitives inside
the handlers?

Thomas
0
 

Author Comment

by:hypark7
ID: 10935025
Thank's for Thomas.

If the "sigsuspend" event happens, I will do a pstack before I kill it.
But it happened once during 2~3 days within 10 same systems.
I hope to solve the problem by pstack.

I don't have any signal handlers in my code.

I  will give 50% point to you right now, and I will give another 50% point after I solve the problem.

Thanks!!!

0
 
LVL 9

Expert Comment

by:ankuratvb
ID: 10967478
0
 
LVL 3

Expert Comment

by:norsethomas
ID: 10978111

I'm sure, hypark7 hasn't forgotten to link -lthread
or -lpthread. Am I right?

Thomas
0
 

Author Comment

by:hypark7
ID: 10983180
Thank's Thomas!!

But, I did link -lthread.

By the way, I deleted the code "usleep" which is located after several mutex fuction(mutex_lock & mutex_unlock) calls.

The "sigsuspend" problem has not happend for about 6 days after delete.

I hope not to happen the "sigsuspend" problem.

I will give all pts to Thomas, Thank's.





0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Which checksum is this? 7 144
How to align numbers in C using the %d 2 98
First character of input string truncated with scanf 3 99
Unable to start eclipse ? 17 142
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question