glibc检测到内存映射双重释放或损坏错误

时间:2017-07-08 18:58:23

标签: linux unix

当我们在新的重新格式化的Red Hat Linux环境中运行特定的Pro * C批处理时,我遇到了错误。

提交的主题 - 开始线程跟踪

  

*检测到glibc * / oretail / RMS / batch / oracle / proc / bin / stkvar:double free或corruption(!prev):   0x000000000107a110 ***

     

======= Backtrace:=========

     

/lib64/libc.so.6 [0x3c34275f3e]
  /lib64/libc.so.6[0x3c34278dd0]
  /lib64/libc.so.6(fclose+0x14d)[0x3c3426648d]
  / oretail / RMS /批次/ ORACLE的/ proc / bin中/ stkvar [0x406086]
  / oretail / RMS /批次/ ORACLE的/ proc / bin中/ stkvar [0x412466]
  /lib64/libc.so.6(__libc_start_main+0xfd)[0x3c3421ed1d]
  / oretail / RMS / batch / oracle / proc / bin / stkvar [0x403099]

     

=======记忆图:========

     

00400000-00435000 r-xp 00000000 fd:44 399301
  / oretail / RMS /批号/ ORACLE的/ proc /斌/ stkvar
  00635000-00638000 rw-p 00035000 fd:44 399301
  / oretail / RMS /批号/ ORACLE的/ proc /斌/ stkvar
  00638000-0063b000 rw-p 00000000 00:00 0
  00fad000-0111e000 rw-p 00000000 00:00 0 [堆]
  334c600000-334c601000 r-xp 00000000 fd:2a 1898 /lib64/libaio.so.1.0.1
  334c601000-334c800000 --- p 00001000 fd:2a 1898 /lib64/libaio.so.1.0.1
  334c800000-334c801000 rw-p 00000000 fd:2a 1898 /lib64/libaio.so.1.0.1
  3c33e00000-3c33e20000 r-xp 00000000 fd:2a 163 /lib64/ld-2.12.so
  3c3401f000-3c34021000 r - p 0001f000 fd:2a 163 /lib64/ld-2.12.so
  3c34021000-3c34022000 rw-p 00021000 fd:2a 163 /lib64/ld-2.12.so
  3c34022000-3c34023000 rw-p 00000000 00:00 0
  3c34200000-3c3438a000 r-xp 00000000 fd:2a 165 /lib64/libc-2.12.so
  3c3438a000-3c3458a000 --- p 0018a000 fd:2a 165 /lib64/libc-2.12.so
  3c3458a000-3c3458e000 r - p 0018a000 fd:2a 165 /lib64/libc-2.12.so
  3c3458e000-3c34590000 rw-p 0018e000 fd:2a 165 /lib64/libc-2.12.so
  3c34590000-3c34594000 rw-p 00000000 00:00 0
  3c34600000-3c34602000 r-xp 00000000 fd:2a 272 /lib64/libdl-2.12.so
  3c34602000-3c34802000 --- p 00002000 fd:2a 272 /lib64/libdl-2.12.so
  3c34802000-3c34803000 r - p 00002000 fd:2a 272 /lib64/libdl-2.12.so
  3c34803000-3c34804000 rw-p 00003000 fd:2a 272 /lib64/libdl-2.12.so
  3c34a00000-3c34a17000 r-xp 00000000 fd:2a 251
  /lib64/libpthread-2.12.so
  3c34a17000-3c34c17000 --- p 00017000 fd:2a 251
  /lib64/libpthread-2.12.so
  3c34c17000-3c34c18000 r - p 00017000 fd:2a 251
  /lib64/libpthread-2.12.so
  3c34c18000-3c34c19000 rw-p 00018000 fd:2a 251
  /lib64/libpthread-2.12.so
  3c34c19000-3c34c1d000 rw-p 00000000 00:00 0
  3c35200000-3c35283000 r-xp 00000000 fd:2a 5727 /lib64/libm-2.12.so
  3c35283000-3c35482000 --- p 00083000 fd:2a 5727 /lib64/libm-2.12.so
  3c35482000-3c35483000 r - p 00082000 fd:2a 5727 /lib64/libm-2.12.so
  3c35483000-3c35484000 rw-p 00083000 fd:2a 5727 /lib64/libm-2.12.so
  3c35a00000-3c35a0a000 r-xp 00000000 fd:3e 1147 /usr/lib64/libnuma.so.1
  3c35a0a000-3c35c0a000 --- p 0000a000 fd:3e 1147 /usr/lib64/libnuma.so.1
  3c35c0a000-3c35c0b000 rw-p 0000a000 fd:3e 1147 /usr/lib64/libnuma.so.1
  3c36a00000-3c36a16000 r-xp 00000000 fd:2a 862 /lib64/libnsl-2.12.so
  3c36a16000-3c36c15000 --- p 00016000 fd:2a 862 /lib64/libnsl-2.12.so
  3c36c15000-3c36c16000 r - p 00015000 fd:2a 862 /lib64/libnsl-2.12.so
  3c36c16000-3c36c17000 rw-p 00016000 fd:2a 862 /lib64/libnsl-2.12.so
  3c36c17000-3c36c19000 rw-p 00000000 00:00 0
  7fd96bdea000-7fd96be00000 r-xp 00000000 fd:2a 623
  /lib64/libgcc_s-4.4.7-20120601.so.1
  7fd96be00000-7fd96bfff000 --- p 00016000 fd:2a 623
  /lib64/libgcc_s-4.4.7-20120601.so.1
  7fd96bfff000-7fd96c000000 rw-p 00015000 fd:2a 623
  /lib64/libgcc_s-4.4.7-20120601.so.1
  7fd96c000000-7fd96c021000 rw-p 00000000 00:00 0
  7fd96c021000-7fd970000000 --- p 00000000 00:00 0
  7fd97010d000-7fd9701c3000 rw-p 00000000 00:00 0
  7fd9701c3000-7fd9701cd000 r-xp 00000000 fd:34 144503
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libnque11.so
  7fd9701cd000-7fd9702cc000 --- p 0000a000 fd:34 144503
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libnque11.so
  7fd9702cc000-7fd9702cd000 rw-p 00009000 fd:34 144503
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libnque11.so
  7fd9702cd000-7fd9702ef000 rw-p 00000000 00:00 0
  7fd9702ef000-7fd9703b1000 r - p 00000000 fd:34 3029503
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/oracore/zoneinfo/timezlrg_14.dat
  7fd9703b1000-7fd9703be000 r-xp 00000000 fd:2a 5768
  /lib64/libnss_files-2.12.so
  7fd9703be000-7fd9705bd000 --- p 0000d000 fd:2a 5768
  /lib64/libnss_files-2.12.so
  7fd9705bd000-7fd9705be000 r - p 0000c000 fd:2a 5768
  /lib64/libnss_files-2.12.so
  7fd9705be000-7fd9705bf000 rw-p 0000d000 fd:2a 5768
  /lib64/libnss_files-2.12.so
  7fd9705bf000-7fd9705e6000 rw-p 00000000 00:00 0
  7fd9705e6000-7fd970870000 r-xp 00000000 fd:34 144340
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libnnz11.so
  7fd970870000-7fd970970000 --- p 0028a000 fd:34 144340
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libnnz11.so
  7fd970970000-7fd9709b2000 rw-p 0028a000 fd:34 144340
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libnnz11.so
  7fd9709b2000-7fd9709b6000 rw-p 00000000 00:00 0
  7fd9709c4000-7fd9709c5000 rw-p 00000000 00:00 0
  7fd9709c5000-7fd97304a000 r-xp 00000000 fd:34 137700
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libclntsh.so.11.1
  7fd97304a000-7fd973249000 --- p 02685000 fd:34 137700
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libclntsh.so.11.1
  7fd973249000-7fd97340e000 rw-p 02684000 fd:34 137700
  /app/oracle/db/product/11.2.0.4/dbhome_MOM2_1/lib/libclntsh.so.11.1
  7fd97340e000-7fd973437000 rw-p 00000000 00:00 0
  7fff2d49c000-7fff2d4b5000 rw-p 00000000 00:00 0 [堆栈]
  7fff2d4fc000-7fff2d4fd000 r-xp 00000000 00:00 0 [vdso]
  ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

这来自以下代码:

int restart_cat(FILE ** cat_fp, char *temp_file_name, char * final_file_name)
{
   char cat_string[255];
   char *function = "restart_cat";

   if (fclose(*cat_fp) != 0)
   {
      sprintf(err_data,"unable to close file %s",temp_file_name);
      WRITE_ERROR(RET_FILE_ERR,function,"none",err_data);
      return(-1);
   }

   sprintf(cat_string,"cat %s >> %s", temp_File_name, final_file_name);
   if ( system(cat_string) != 0 )*/
   {
      sprintf(err_data,"unable to concatenate temporary file, %s, to final file, %s",
              temp_file_name, final_file_name);
      WRITE_ERROR(RET_FILE_ERR,function,"none",err_data);
      return(-1);
   }

   if ((*cat_fp = fopen(temp_file_name, "w")) == NULL)
   {
      sprintf(err_data,"unable to open file %s",temp_file_name);
      WRITE_ERROR(RET_FILE_ERR,function,"none",err_data);
      return(-1);
   }

   return(0);

}  /* end restart_cat */

当我按照下面的评论时,它可以正常工作。

sprintf(cat_string,"cat %s >> %s", temp_File_name, final_file_name);
   if ( system(cat_string) != 0 )*/
   {
      sprintf(err_data,"unable to concatenate temporary file, %s, to final file, %s",
              temp_file_name, final_file_name);
      WRITE_ERROR(RET_FILE_ERR,function,"none",err_data);
      return(-1);
   }

为什么它在Unix环境中表现良好时表现得这样?

0 个答案:

没有答案