我正在调试内存泄漏的程序。启用“check -memuse”时出现以下错误:
Write to unallocated (wua) on thread 1:
Attempting to write 8 bytes at address 0xffffffff79f001d0
t@1 (l@1) stopped in _private_pthread_atfork at 0xffffffff5bd4ce28
当我发出 Where 命令时:
current thread: t@1
=>[1] _private_pthread_atfork(0xffffffff64d565ac, 0xffffffff64d5660c, 0xffffffff64d565dc, 0xffffffff79f001c0, 0xffffffff64eb6a50, 0xffffffff5bf4a360), at 0xffffffff5bd4ce28
[2] _init(0x0, 0x0, 0xffffffff7f73cdf8, 0xffffffff7f617c5c, 0xffffffff5bdd6908, 0xffffffff6a700200), at 0xffffffff64d9e2d8
[3] call_init(0xffffffff79d02670, 0x1, 0x10020204, 0xffffffff64d9e2d0, 0x80, 0xffffffff77e01d18), at 0xffffffff7f617c64
[4] setup(0x21441, 0xffffffff7f73c278, 0xffffffff7f73c4a4, 0x25000, 0x0, 0x0), at 0xffffffff7f616f50
[5] _setup(0xffffffff7f638f8c, 0x1401c0, 0x0, 0xffffffff7ffff578, 0x2, 0xffffffffffffffff), at 0xffffffff7f6297f4
[6] _rt_boot(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xffffffff7f608028
我可以追溯到代码中发生此错误的位置吗?您能否提供一些帮助以追溯到源头?
更多信息
这是一个 proC 过程。在 10g 上编译时,它工作正常。提供的二进制文件正在加载 Oracle 10g 库。但是当用 11g 编译时会出现错误。在调试过程中,我在以下代码中发现了 10g 内存泄漏:
EXEC SQL CONNECT :Userid;
oraca.orastxtf = ORASTFANY;
(dbx) showleaks
Checking for memory leaks...
Actual leaks report (actual leaks: 1 total size: 1112 bytes)
Total Num of Leaked Allocation call stack
Size Blocks Block
Address
========== ====== =========== =======================================
1112 1 0x1003231c8 _nss_XbyY_buf_alloc < get_pwbuf < _getpwuid < sigunmu < kpueaudi < kpugskey < kpu8lgn < kpuauthxa
Possible leaks report (possible leaks: 0 total size: 0 bytes)
在 11g 调试相同代码期间,我得到以下内存泄漏:
(dbx) showleaks
Checking for memory leaks...
Actual leaks report (actual leaks: 4 total size: 25816 bytes)
Total Num of Leaked Allocation call stack
Size Blocks Block
Address
========== ====== =========== =======================================
16384 1 0x1002c9b88 calloc < slts_tls_getaddr < sltsqKeyAdd < sltskys < dbgc_tls_ini < dbgc_find_diagctx < kpeDbgInitDBGC < nlstddt_do_alter_trace
8280 1 0x1002c7b08 calloc < slts_tls_getaddr < sltsqKeyAdd < sltskys < dbgc_tls_ini < dbgc_find_diagctx < kpeDbgInitDBGC < nlstddt_do_alter_trace
1112 1 0x10038b7e8 _nss_XbyY_buf_alloc < get_pwbuf < _getpwuid < sigunmu < siugunmu < kpugskey < kpu8lgn < kpuauthxa
40 1 0x10028f658 sltsqKeyAdd < sltskys < dbgc_tls_ini < dbgc_find_diagctx < kpeDbgInitDBGC < nlstddt_do_alter_trace < nlstdggo < nlstdgg
任何人都可以有这样的问题吗?