By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,007 Members | 1,248 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,007 IT Pros & Developers. It's quick & easy.

Calling sqleintr or exit causes program (linux) to hang (due to deadlock by pthread)

P: n/a
Hi all,
I have a program written in C with embeded SQL. Following are the
configuration:

DB2/LINUX 8.1.5
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

My problems are as following

CASE 1:

In DB2's documentation, it is stated that sqleintr is safe to call in a
signal handler. When my program is executing a SQL, it receives an
interrupt. In the signal handler for the interrupt, it calls sqleintr()
to stop the SQL and call exit() to exit the program. Sometime the
program will hang when calling sqleintr because of pthread in DB2
cannot accquire a lock and the program goes into a deadlock (from the
gdb dump ). I guest the lock is accquire somewhere during the excution
of the SQL before the signal and it is not yet released.

CASE 2:
Same as above but the program sometime hang when calling exit(). From
the gdb dump, exit() will call some clean up functions in DB2 and the
cleanup function itself goes into a dead lock as well.

For your information, I need to exit the program after the signal
handler is called.

Does anyone encounter this problem before? I have search around at the
DB2 documnetation but still can't find related information. Please
help.

Thanks.

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.