- 論壇徽章:
- 0
|
問題:難道fgets函數(shù)也死鎖,系統(tǒng)上線后出現(xiàn)過幾次這類問題。 暫未解決,只能kill掉讀取進程。
環(huán)境:HP-UX 安騰 64。
數(shù)據(jù)文件:放在共享存儲上,不在本機硬盤上。
描述:兩個并發(fā)進程進入文件拆分函數(shù),讀取同一待拆分文件,然后就沒有下文,僵在里面。
錯誤跟蹤日志如下:
--進程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 文件拆分函數(shù):這一行就是 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 文件拆分函數(shù):這一行就是 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
請教一下可能是什么原因?qū)е麓祟悊栴}隨機產(chǎn)生。 |
|