[Bug libc/2482] New: When sending signal to my applications, some of the core routines such as malloc,free, fclose,fopen hangs

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2482] New: When sending signal to my applications, some of the core routines such as malloc,free, fclose,fopen hangs

yangyibiao at hust dot edu.cn
Hi,

I have a multithreaded application and I send a SIGUSR2 signal to let it know
it should terminate. In the code I have which terminates it after the signal
handler terminated by a call to longjmp, I do calls to malloc, free, fclose,
fopen. Very often my application deadlock in those routines.

Is this a bug, or am I not doing something right with the handling of signals?

I'm using RedHat 7.1 on a dual processor. The version of glibc I have is 2.1.92.

Thanks,
Manu

--
           Summary: When sending signal to my applications, some of the core
                    routines such as malloc,free, fclose,fopen hangs
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: manus at eiffel dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=2482

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2482] When sending signal to my applications, some of the core routines such as malloc,free, fclose,fopen hangs

yangyibiao at hust dot edu.cn

------- Additional Comments From decimal at us dot ibm dot com  2006-03-24 16:36 -------
That is a staggeringly old version of Linux and glibc.
This bugzilla is not the place for distro specific problems or ancient bugs.
You will have to work with the distro specific mailing lists or bugzillas to
address this problem if they are willing or you can reproduce on a recent
version of Linux and glibc.

--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=2482

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2482] When sending signal to my applications, some of the core routines such as malloc,free, fclose,fopen hangs

yangyibiao at hust dot edu.cn
In reply to this post by yangyibiao at hust dot edu.cn

------- Additional Comments From manus at eiffel dot com  2006-03-24 16:39 -------
I realize that I was not clear by `deadlock'. When the application deadlocks,
there is only 2 threads running, one is mine the other one is a polling thread
which I did not create.

Here is the trace I have for the locked thread:

(gdb) info threads
  2 Thread 2049 (LWP 25161)  0x40ff6268 in __poll (fds=0x91031ac, nfds=1,
timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63
  1 Thread 1024 (LWP 25157)  0x40f459b6 in __sigsuspend (set=0xbfffe540)
at ../sysdeps/unix/sysv/linux/sigsuspend.c:45

(gdb) thread 1
[Switching to thread 1 (Thread 1024 (LWP 25157))]#0  0x40f459b6 in __sigsuspend
(set=0xbfffe540)  at ../sysdeps/unix/sysv/linux/sigsuspend.c:45
45 in ../sysdeps/unix/sysv/linux/sigsuspend.c

(gdb) bt
#0  0x40f459b6 in __sigsuspend (set=0xbfffe540)
at ../sysdeps/unix/sysv/linux/sigsuspend.c:45
#1  0x40f09d45 in __pthread_wait_for_restart_signal (self=0x40f135a0) at
pthread.c:978
#2  0x40f0b95b in __pthread_lock (lock=0x912a068, self=0x40f135a0) at
restart.h:34
#3  0x40f07fdd in __pthread_mutex_lock (mutex=0x912a058) at mutex.c:109
#4  0x40f0aeaf in __flockfile (stream=0x9129fc0) at lockfile.c:39
#5  0x40f8ff01 in _IO_un_link (fp=0x9129fc0) at genops.c:75
#6  0x40f8523f in _IO_new_fclose (fp=0x9129fc0) at iofclose.c:58

Regards,
Manu

--


http://sourceware.org/bugzilla/show_bug.cgi?id=2482

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2482] When sending signal to my applications, some of the core routines such as malloc,free, fclose,fopen hangs

yangyibiao at hust dot edu.cn
In reply to this post by yangyibiao at hust dot edu.cn

------- Additional Comments From manus at eiffel dot com  2006-03-24 16:40 -------
My last post and your post crossed each other. I'll be glad to report it in the
right forum, but I haven't been able to find the right place to raise this
issue. Do you have any pointers?

Thanks,
Manu

--


http://sourceware.org/bugzilla/show_bug.cgi?id=2482

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2482] When sending signal to my applications, some of the core routines such as malloc,free, fclose,fopen hangs

yangyibiao at hust dot edu.cn
In reply to this post by yangyibiao at hust dot edu.cn

------- Additional Comments From decimal at us dot ibm dot com  2006-03-24 16:43 -------
http://www.fedoralegacy.org/ perhaps but really you should give up and upgrade.

--


http://sourceware.org/bugzilla/show_bug.cgi?id=2482

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2482] When sending signal to my applications, some of the core routines such as malloc,free, fclose,fopen hangs

yangyibiao at hust dot edu.cn
In reply to this post by yangyibiao at hust dot edu.cn

------- Additional Comments From jakub at redhat dot com  2006-03-24 16:47 -------
Additionally, what you are describing is a clear violation of POSIX standard.
Please read
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03
, especially the list of async-signal-safe functions.


--


http://sourceware.org/bugzilla/show_bug.cgi?id=2482

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.