当前位置: 技术问答>linux和unix
求助:double free or corruption (!prev): 0x08d47f20 ***
来源: 互联网 发布时间:2015-12-02
本文导语: 由于研究需要,目前正在对PostgreSQL8.1.2进行线程化。改进后的服务进程首先创建线程池和进程池,然后等待用户的连接请求。可是当我创建数据库的时候,出现下面的错误,实在找不出错误原因,还请高人指点。谢谢...
由于研究需要,目前正在对PostgreSQL8.1.2进行线程化。改进后的服务进程首先创建线程池和进程池,然后等待用户的连接请求。可是当我创建数据库的时候,出现下面的错误,实在找不出错误原因,还请高人指点。谢谢!另:谁知道有什么好的调试工具可以调试多线程程序。
bash-3.00$ LOG: database system was shut down at 2006-06-28 16:00:46 CST
LOG: checkpoint record is at 0/33A6AC
LOG: redo record is at 0/33A6AC; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 565; next OID: 10794
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database "postgres"
createdb test
*** glibc detected *** /usr/local/pgsql/bin/postmaster: double free or corruption (!prev): 0x08d47f20 ***
======= Backtrace: =========
/lib/libc.so.6[0x68f424]
/lib/libc.so.6(__libc_free+0x77)[0x68f95f]
/usr/local/pgsql/bin/postmaster[0x81710f7]
/lib/libpthread.so.0[0x975b80]
/lib/libc.so.6(__clone+0x5e)[0x6f6dee]
======= Memory map: ========
00111000-0011a000 r-xp 00000000 03:0b 287199 /lib/libgcc_s-4.0.0-20050520.so.1
0011a000-0011b000 rwxp 00009000 03:0b 287199 /lib/libgcc_s-4.0.0-20050520.so.1
0060e000-00628000 r-xp 00000000 03:0b 287138 /lib/ld-2.3.5.so
00628000-00629000 r-xp 00019000 03:0b 287138 /lib/ld-2.3.5.so
00629000-0062a000 rwxp 0001a000 03:0b 287138 /lib/ld-2.3.5.so
0062c000-00750000 r-xp 00000000 03:0b 287154 /lib/libc-2.3.5.so
00750000-00752000 r-xp 00124000 03:0b 287154 /lib/libc-2.3.5.so
00752000-00754000 rwxp 00126000 03:0b 287154 /lib/libc-2.3.5.so
00754000-00756000 rwxp 00754000 00:00 0
00758000-0077a000 r-xp 00000000 03:0b 287173 /lib/libm-2.3.5.so
0077a000-0077b000 r-xp 00021000 03:0b 287173 /lib/libm-2.3.5.so
0077b000-0077c000 rwxp 00022000 03:0b 287173 /lib/libm-2.3.5.so
0077e000-00780000 r-xp 00000000 03:0b 287171 /lib/libdl-2.3.5.so
00780000-00781000 r-xp 00001000 03:0b 287171 /lib/libdl-2.3.5.so
00781000-00782000 rwxp 00002000 03:0b 287171 /lib/libdl-2.3.5.so
00784000-00796000 r-xp 00000000 03:0a 1609097 /usr/lib/libz.so.1.2.2.2
00796000-00797000 rwxp 00011000 03:0a 1609097 /usr/lib/libz.so.1.2.2.2
0090b000-0090e000 r-xp 00000000 03:0b 287271 /lib/libtermcap.so.2.0.8
0090e000-0090f000 rwxp 00002000 03:0b 287271 /lib/libtermcap.so.2.0.8
00911000-00938000 r-xp 00000000 03:0a 1607060 /usr/lib/libreadline.so.5.0
00938000-0093c000 rwxp 00027000 03:0a 1607060 /usr/lib/libreadline.so.5.0
0093c000-0093d000 rwxp 0093c000 00:00 0
00970000-0097e000 r-xp 00000000 03:0b 287163 /lib/libpthread-2.3.5.so
0097e000-0097f000 r-xp 0000d000 03:0b 287163 /lib/libpthread-2.3.5.so
0097f000-00980000 rwxp 0000e000 03:0b 287163 /lib/libpthread-2.3.5.so
00980000-00982000 rwxp 00980000 00:00 0
00b95000-00ba4000 r-xp 00000000 03:0b 287201 /lib/libresolv-2.3.5.so
00ba4000-00ba5000 r-xp 0000e000 03:0b 287201 /lib/libresolv-2.3.5.so
00ba5000-00ba6000 rwxp 0000f000 03:0b 287201 /lib/libresolv-2.3.5.so
00ba6000-00ba8000 rwxp 00ba6000 00:00 0
00d7a000-00d83000 r-xp 00000000 03:0b 287189 /lib/libnss_files-2.3.5.so
00d83000-00d84000 r-xp 00008000 03:0b 287189 /lib/libnss_files-2.3.5.so
00d84000-00d85000 rwxp 00009000 03:0b 287189 /lib/libnss_files-2.3.5.so
00de1000-00de2000 r-xp 00de1000 00:00 0
03fd2000-03fe4000 r-xp 00000000 03:0b 287251 /lib/libnsl-2.3.5.so
03fe4000-03fe5000 r-xp 00011000 03:0b 287251 /lib/libnsl-2.3.5.so
03fe5000-03fe6000 rwxp 00012000 03:0b 287251 /lib/libnsl-2.3.5.so
03fe6000-03fe8000 rwxp 03fe6000 00:00 0
04050000-04055000 r-xp 00000000 03:0b 287262 /lib/libcrypt-2.3.5.so
04055000-04056000 r-xp 00004000 03:0b 287262 /lib/libcrypt-2.3.5.so
04056000-04057000 rwxp 00005000 03:0b 287262 /lib/libcrypt-2.3.5.so
04057000-0407e000 rwxp 04057000 00:00 0
08048000-0829d000 r-xp 00000000 03:0a 361395 /usr/local/pgsql/bin/postgres
0829d000-082ae000 rw-p 00255000 03:0a 361395 /usr/local/pgsql/bin/postgres
082ae000-082e9000 rw-p 082ae000 00:00 0
08d41000-08d62000 rw-p 08d41000 00:00 0 [heap]
b4c00000-b4c21000 rw-p b4c00000 00:00 0
b4c21000-b4d00000 ---p b4c21000 00:00 0
b4d98000-b4d99000 ---p b4d98000 00:00 0
b4d99000-b5799000 rw-p b4d99000 00:00 0
b5799000-b579a000 rw-s 00000000 00:07 1376261 /SYSV00000000 (deleted)
b579a000-b579b000 ---p b579a000 00:00 0
b579b000-b619c000 rw-p b579b000 00:00 0
b619c000-b619d000 ---p b619c000 00:00 0
b619d000-b6b9d000 rw-p b619d000 00:00 0
b6b9d000-b6b9e000 ---p b6b9d000 00:00 0
b6b9e000-b759e000 rw-p b6b9e000 00:00 0
b759e000-b7f98000 rw-s 00000000 00:07 1343490 /SYSV0052e2c1 (deleted)
b7f98000-b7f9b000 rw-p b7f98000 00:00 0
b7fa8000-b7fa9000 rw-p b7fa8000 00:00 0
bfd93000-bfda9000 rw-p bfd93000 00:00 0 [stack]
createdb: could not connect to database template1: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
bash-3.00$ LOG: database system was shut down at 2006-06-28 16:00:46 CST
LOG: checkpoint record is at 0/33A6AC
LOG: redo record is at 0/33A6AC; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 565; next OID: 10794
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database "postgres"
createdb test
*** glibc detected *** /usr/local/pgsql/bin/postmaster: double free or corruption (!prev): 0x08d47f20 ***
======= Backtrace: =========
/lib/libc.so.6[0x68f424]
/lib/libc.so.6(__libc_free+0x77)[0x68f95f]
/usr/local/pgsql/bin/postmaster[0x81710f7]
/lib/libpthread.so.0[0x975b80]
/lib/libc.so.6(__clone+0x5e)[0x6f6dee]
======= Memory map: ========
00111000-0011a000 r-xp 00000000 03:0b 287199 /lib/libgcc_s-4.0.0-20050520.so.1
0011a000-0011b000 rwxp 00009000 03:0b 287199 /lib/libgcc_s-4.0.0-20050520.so.1
0060e000-00628000 r-xp 00000000 03:0b 287138 /lib/ld-2.3.5.so
00628000-00629000 r-xp 00019000 03:0b 287138 /lib/ld-2.3.5.so
00629000-0062a000 rwxp 0001a000 03:0b 287138 /lib/ld-2.3.5.so
0062c000-00750000 r-xp 00000000 03:0b 287154 /lib/libc-2.3.5.so
00750000-00752000 r-xp 00124000 03:0b 287154 /lib/libc-2.3.5.so
00752000-00754000 rwxp 00126000 03:0b 287154 /lib/libc-2.3.5.so
00754000-00756000 rwxp 00754000 00:00 0
00758000-0077a000 r-xp 00000000 03:0b 287173 /lib/libm-2.3.5.so
0077a000-0077b000 r-xp 00021000 03:0b 287173 /lib/libm-2.3.5.so
0077b000-0077c000 rwxp 00022000 03:0b 287173 /lib/libm-2.3.5.so
0077e000-00780000 r-xp 00000000 03:0b 287171 /lib/libdl-2.3.5.so
00780000-00781000 r-xp 00001000 03:0b 287171 /lib/libdl-2.3.5.so
00781000-00782000 rwxp 00002000 03:0b 287171 /lib/libdl-2.3.5.so
00784000-00796000 r-xp 00000000 03:0a 1609097 /usr/lib/libz.so.1.2.2.2
00796000-00797000 rwxp 00011000 03:0a 1609097 /usr/lib/libz.so.1.2.2.2
0090b000-0090e000 r-xp 00000000 03:0b 287271 /lib/libtermcap.so.2.0.8
0090e000-0090f000 rwxp 00002000 03:0b 287271 /lib/libtermcap.so.2.0.8
00911000-00938000 r-xp 00000000 03:0a 1607060 /usr/lib/libreadline.so.5.0
00938000-0093c000 rwxp 00027000 03:0a 1607060 /usr/lib/libreadline.so.5.0
0093c000-0093d000 rwxp 0093c000 00:00 0
00970000-0097e000 r-xp 00000000 03:0b 287163 /lib/libpthread-2.3.5.so
0097e000-0097f000 r-xp 0000d000 03:0b 287163 /lib/libpthread-2.3.5.so
0097f000-00980000 rwxp 0000e000 03:0b 287163 /lib/libpthread-2.3.5.so
00980000-00982000 rwxp 00980000 00:00 0
00b95000-00ba4000 r-xp 00000000 03:0b 287201 /lib/libresolv-2.3.5.so
00ba4000-00ba5000 r-xp 0000e000 03:0b 287201 /lib/libresolv-2.3.5.so
00ba5000-00ba6000 rwxp 0000f000 03:0b 287201 /lib/libresolv-2.3.5.so
00ba6000-00ba8000 rwxp 00ba6000 00:00 0
00d7a000-00d83000 r-xp 00000000 03:0b 287189 /lib/libnss_files-2.3.5.so
00d83000-00d84000 r-xp 00008000 03:0b 287189 /lib/libnss_files-2.3.5.so
00d84000-00d85000 rwxp 00009000 03:0b 287189 /lib/libnss_files-2.3.5.so
00de1000-00de2000 r-xp 00de1000 00:00 0
03fd2000-03fe4000 r-xp 00000000 03:0b 287251 /lib/libnsl-2.3.5.so
03fe4000-03fe5000 r-xp 00011000 03:0b 287251 /lib/libnsl-2.3.5.so
03fe5000-03fe6000 rwxp 00012000 03:0b 287251 /lib/libnsl-2.3.5.so
03fe6000-03fe8000 rwxp 03fe6000 00:00 0
04050000-04055000 r-xp 00000000 03:0b 287262 /lib/libcrypt-2.3.5.so
04055000-04056000 r-xp 00004000 03:0b 287262 /lib/libcrypt-2.3.5.so
04056000-04057000 rwxp 00005000 03:0b 287262 /lib/libcrypt-2.3.5.so
04057000-0407e000 rwxp 04057000 00:00 0
08048000-0829d000 r-xp 00000000 03:0a 361395 /usr/local/pgsql/bin/postgres
0829d000-082ae000 rw-p 00255000 03:0a 361395 /usr/local/pgsql/bin/postgres
082ae000-082e9000 rw-p 082ae000 00:00 0
08d41000-08d62000 rw-p 08d41000 00:00 0 [heap]
b4c00000-b4c21000 rw-p b4c00000 00:00 0
b4c21000-b4d00000 ---p b4c21000 00:00 0
b4d98000-b4d99000 ---p b4d98000 00:00 0
b4d99000-b5799000 rw-p b4d99000 00:00 0
b5799000-b579a000 rw-s 00000000 00:07 1376261 /SYSV00000000 (deleted)
b579a000-b579b000 ---p b579a000 00:00 0
b579b000-b619c000 rw-p b579b000 00:00 0
b619c000-b619d000 ---p b619c000 00:00 0
b619d000-b6b9d000 rw-p b619d000 00:00 0
b6b9d000-b6b9e000 ---p b6b9d000 00:00 0
b6b9e000-b759e000 rw-p b6b9e000 00:00 0
b759e000-b7f98000 rw-s 00000000 00:07 1343490 /SYSV0052e2c1 (deleted)
b7f98000-b7f9b000 rw-p b7f98000 00:00 0
b7fa8000-b7fa9000 rw-p b7fa8000 00:00 0
bfd93000-bfda9000 rw-p bfd93000 00:00 0 [stack]
createdb: could not connect to database template1: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
|
没有太好的多线程调试工具。这里有一个http://nptltracetool.sourceforge.net/
可以调试多线程中的一些东西,但需要对线程库先打一个patch.
可以调试多线程中的一些东西,但需要对线程库先打一个patch.
|
内存不足不会出现这种情况,不过你可以用dmesg 看一下有没有内存不足的记录。
另外,double free这种情况还是比较好处理的,你可以自己封装一个函数
void free_ex(void** ptr)
{
if (*ptr == NULL) return;
free(*ptr);
*ptr= NULL;
}
另外,double free这种情况还是比较好处理的,你可以自己封装一个函数
void free_ex(void** ptr)
{
if (*ptr == NULL) return;
free(*ptr);
*ptr= NULL;
}
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。