This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21813] New: dead lock for ftime and strftime in multhithread C program
- From: "sitthisc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 May 2005 07:54:41 -0000
- Subject: [Bug c/21813] New: dead lock for ftime and strftime in multhithread C program
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When I use a ftime function in a multhithread program, sometime it will stop and
all thread that use this function will wait for a mutex lock. The information from
GDB are following:-
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/64/libnsl.so.1...done.
Loaded symbols for /usr/lib/64/libnsl.so.1
Reading symbols from /usr/lib/64/libsocket.so.1...done.
Loaded symbols for /usr/lib/64/libsocket.so.1
Reading symbols from /usr/lib/64/libthread.so.1...done.
Loaded symbols for /usr/lib/64/libthread.so.1
Reading symbols from /usr/lib/64/librt.so.1...done.
Loaded symbols for /usr/lib/64/librt.so.1
Reading symbols from /usr/lib/64/libm.so.1...done.
Loaded symbols for /usr/lib/64/libm.so.1
Reading symbols from /usr/lib/64/libc.so.1...done.
Loaded symbols for /usr/lib/64/libc.so.1
Reading symbols from /usr/lib/64/libdl.so.1...done.
Loaded symbols for /usr/lib/64/libdl.so.1
Reading symbols from /usr/lib/64/libmp.so.2...done.
Loaded symbols for /usr/lib/64/libmp.so.2
Reading symbols from /usr/lib/64/libaio.so.1...done.
Loaded symbols for /usr/lib/64/libaio.so.1
Reading symbols from /usr/lib/64/libmd5.so.1...done.
Loaded symbols for /usr/lib/64/libmd5.so.1
Loaded symbols for /usr/platform/SUNW,Sun-Fire-280R/lib/sparcv9/libc_psr.so.1
Reading symbols from /usr/lib/64/nss_files.so.1...done.
Loaded symbols for /usr/lib/64/nss_files.so.1
#0 0xffffffff3f618928 in __lwp_park () from /usr/lib/64/libthread.so.1
(gdb) up
#1 0xffffffff3f614544 in mutex_lock_queue () from /usr/lib/64/libthread.so.1
(gdb) up
#2 0xffffffff3f614f80 in slow_lock () from /usr/lib/64/libthread.so.1
(gdb) up
#3 0xffffffff3f05c000 in _ltzset () from /usr/lib/64/libc.so.1
(gdb) up
#4 0xffffffff3f04213c in ftime () from /usr/lib/64/libc.so.1
(gdb) up
#5 0x00000001000086e4 in GetTime (str=0xffffffff7ffff611 "",
fmt=0x100032810 "%Y%m%d%H", sec=0) at util.h:62
62 ftime(&tt);
Do anybody have any Idea for solve this problem? Thank you.
Note. I'm develope a program in solaris9 with GCC 3.3.2
--
Summary: dead lock for ftime and strftime in multhithread C
program
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sitthisc at gmail dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21813