- 论坛徽章:
- 0
|
问题:难道fgets函数也死锁,系统上线后出现过几次这类问题。 暂未解决,只能kill掉读取进程。
环境:HP-UX 安腾 64。
数据文件:放在共享存储上,不在本机硬盘上。
描述:两个并发进程进入文件拆分函数,读取同一待拆分文件,然后就没有下文,僵在里面。
错误跟踪日志如下:
--进程A,GDB堆栈信息
xxxx@/home/db/xxxx> gdb xxxxFileLoad 20166
HP gdb 6.2 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3.
Copyright 1986 - 2011 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 6.2 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Attaching to program: /home/db/xxxx/xxxxbatch/bin/xxxxFileLoad, process 20166
warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program;
stepping over longjmp calls will not work as expected.
Please set the kernel variable "shlib_debug_enable" to 1 to enable the shared library debugging
warning: Load module /home/db/oracle/product/10.2.0/lib/libnnz10.so has been stripped.
Debugging information is not available.
0xc00000000054a490:0 in _read_sys+0x30 () from /usr/lib/hpux64/libc.so.1
(gdb) bt
#0 0xc00000000054a490:0 in _read_sys+0x30 () from /usr/lib/hpux64/libc.so.1
#1 0xc00000000055ed80:0 in read+0xe0 () from /usr/lib/hpux64/libc.so.1
#2 0xc000000000527a20:0 in _filbuf+0x190 () from /usr/lib/hpux64/libc.so.1
#3 0xc00000000053a0d0:0 in __fgets_unlocked+0x1f0 () from /usr/lib/hpux64/libc.so.1
#4 0xc00000000053a3e0:0 in fgets+0x140 () from /usr/lib/hpux64/libc.so.1
#5 0x4000000000030320:0 in g_GetFSegment () at p_file.c:301 文件拆分函数:这一行就是 fgets(),其读取缓存大小为一次读取 400K。
#6 0x4000000000006130:0 in InsxxxxFile () at xxxxFileLoad.pc:1060
#7 0x4000000000005380:0 in main () at xxxxFileLoad.pc:107
(gdb) quit
The program is running. Quit anyway (and detach it)? (y or n) y
Detaching from program: /home/db/xxxx/xxxxbatch/bin/xxxxFileLoad, process 20166
--进程B,GDB堆栈信息
xxxx@/home/db/xxxx> gdb xxxxFileLoad 20167
HP gdb 6.2 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3.
Copyright 1986 - 2011 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 6.2 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Attaching to program: /home/db/xxxx/xxxxbatch/bin/xxxxFileLoad, process 20167
warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program;
stepping over longjmp calls will not work as expected.
Please set the kernel variable "shlib_debug_enable" to 1 to enable the shared library debugging
warning: Load module /home/db/oracle/product/10.2.0/lib/libnnz10.so has been stripped.
Debugging information is not available.
0xc00000000054a490:0 in _read_sys+0x30 () from /usr/lib/hpux64/libc.so.1
(gdb) bt
#0 0xc00000000054a490:0 in _read_sys+0x30 () from /usr/lib/hpux64/libc.so.1
#1 0xc00000000055ed80:0 in read+0xe0 () from /usr/lib/hpux64/libc.so.1
#2 0xc000000000527a20:0 in _filbuf+0x190 () from /usr/lib/hpux64/libc.so.1
#3 0xc00000000053a0d0:0 in __fgets_unlocked+0x1f0 () from /usr/lib/hpux64/libc.so.1
#4 0xc00000000053a3e0:0 in fgets+0x140 () from /usr/lib/hpux64/libc.so.1
#5 0x4000000000030320:0 in g_GetFSegment () at p_file.c:301 文件拆分函数:这一行就是 fgets(),其读取缓存大小为一次读取 400K。
#6 0x4000000000006130:0 in InsxxxxFile () at xxxxFileLoad.pc:1060
#7 0x4000000000005380:0 in main () at xxxxFileLoad.pc:107
(gdb) quit
The program is running. Quit anyway (and detach it)? (y or n) y
Detaching from program: /home/db/xxxx/xxxxbatch/bin/xxxxFileLoad, process 20167
请教一下可能是什么原因导致此类问题随机产生。 |
|