安装ASE15.7时出现glibc detected *** srvbuildres: free(): invalid pointer问题的解决

Sybase ASE V15.7于9月下旬发布,10月上旬才提供开发版下载地址。先在Linux x86_64上体验并测试一把。ASE V15.7已不支持Linux x86和Solaris x86,但是仍然可以用win x86做开发测试用途。

操作系统环境为:CentOS 5.5,内核版本:2.6.18-194.el5 x86_64

一开始使用安装向导创建服务的时候,报错!所有服务均创建失败!

修改安装向导生成的资源文件,已备后面利用srvbuildres创建服务。

首先设置一个能够解决Linux下Segmentation fault错误的环境变量: LD_POINTER_GUARD=0

在sybase用户环境下,执行下面的命令创建主服务时,

[sybase@centos5 ASE-15_0]$ srvbuildres -r ./sqlsrv.res 

报错:

Warning: You have selected '8k' as the logical page size for the Adaptive
Server. If you plan to load dump from another database, make sure this logical
page size matches the size of the source database. The default logical page
size in previous Adaptive Server versions was 2KB.
Port number '5000' is being reserved or currently in use by a running server.
Building Adaptive Server 'CENTOS5':
Writing entry into directory services...
*** glibc detected *** srvbuildres: free(): invalid pointer: 0x00000000183f8160 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3d9f07230f]
/lib64/libc.so.6(cfree+0x4b)[0x3d9f07276b]
srvbuildres(intl_iocsfclose+0x1d)[0x518b3d]
srvbuildres(dict_unload+0x553)[0x4b4573]
srvbuildres(iface_close+0x9)[0x4b0109]
srvbuildres(drv_close+0x54)[0x4ad494]
srvbuildres(dcl__sess_drop+0x24)[0x4ade34]
srvbuildres(dscp_sess_close+0x7f)[0x43eb3c]
srvbuildres(add_ifile_entry+0x152)[0x43fb3e]
srvbuildres[0x42e2be]
srvbuildres(build_server+0x19a)[0x42f5a8]
srvbuildres(process_resource_file+0x1438)[0x42aafc]
srvbuildres(main+0x2ab)[0x429583]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3d9f01d994]
srvbuildres[0x429229]
======= Memory map: ========
00400000-0056b000 r-xp 00000000 fd:01 7005567                            /home/sybase/ASE-15_0/bin/srvbuildres
0076a000-007a4000 rw-p 0016a000 fd:01 7005567                            /home/sybase/ASE-15_0/bin/srvbuildres
007a4000-007b1000 rw-p 007a4000 00:00 0
183b8000-1845a000 rw-p 183b8000 00:00 0                                  [heap]
3d9ec00000-3d9ec1c000 r-xp 00000000 fd:00 1637126                        /lib64/ld-2.5.so
3d9ee1b000-3d9ee1c000 r--p 0001b000 fd:00 1637126                        /lib64/ld-2.5.so
3d9ee1c000-3d9ee1d000 rw-p 0001c000 fd:00 1637126                        /lib64/ld-2.5.so
3d9f000000-3d9f14e000 r-xp 00000000 fd:00 1637127                        /lib64/libc-2.5.so
3d9f14e000-3d9f34d000 ---p 0014e000 fd:00 1637127                        /lib64/libc-2.5.so
3d9f34d000-3d9f351000 r--p 0014d000 fd:00 1637127                        /lib64/libc-2.5.so
3d9f351000-3d9f352000 rw-p 00151000 fd:00 1637127                        /lib64/libc-2.5.so
3d9f352000-3d9f357000 rw-p 3d9f352000 00:00 0
3d9f400000-3d9f482000 r-xp 00000000 fd:00 1637132                        /lib64/libm-2.5.so
3d9f482000-3d9f681000 ---p 00082000 fd:00 1637132                        /lib64/libm-2.5.so
3d9f681000-3d9f682000 r--p 00081000 fd:00 1637132                        /lib64/libm-2.5.so
3d9f682000-3d9f683000 rw-p 00082000 fd:00 1637132                        /lib64/libm-2.5.so
3d9f800000-3d9f802000 r-xp 00000000 fd:00 1637133                        /lib64/libdl-2.5.so
3d9f802000-3d9fa02000 ---p 00002000 fd:00 1637133                        /lib64/libdl-2.5.so
3d9fa02000-3d9fa03000 r--p 00002000 fd:00 1637133                        /lib64/libdl-2.5.so
3d9fa03000-3d9fa04000 rw-p 00003000 fd:00 1637133                        /lib64/libdl-2.5.so
3daf600000-3daf60d000 r-xp 00000000 fd:00 1637143                        /lib64/libgcc_s-4.1.2-20080825.so.1
3daf60d000-3daf80d000 ---p 0000d000 fd:00 1637143                        /lib64/libgcc_s-4.1.2-20080825.so.1
3daf80d000-3daf80e000 rw-p 0000d000 fd:00 1637143                        /lib64/libgcc_s-4.1.2-20080825.so.1
2ae8d39bf000-2ae8d39c1000 rw-p 2ae8d39bf000 00:00 0
2ae8d39d7000-2ae8d39da000 rw-p 2ae8d39d7000 00:00 0
2ae8d39f1000-2ae8d39fb000 r-xp 00000000 fd:00 1636827                    /lib64/libnss_files-2.5.so
2ae8d39fb000-2ae8d3bfa000 ---p 0000a000 fd:00 1636827                    /lib64/libnss_files-2.5.so
2ae8d3bfa000-2ae8d3bfb000 r--p 00009000 fd:00 1636827                    /lib64/libnss_files-2.5.so
2ae8d3bfb000-2ae8d3bfc000 rw-p 0000a000 fd:00 1636827                    /lib64/libnss_files-2.5.so
7fff80ded000-7fff80e15000 rw-p 7ffffffd7000 00:00 0                      [stack]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0                  [vdso]
Aborted

主要是这句错误:*** glibc detected *** srvbuildres: free(): invalid pointer: 0x00000000183f8160 ***

原因可能有:重新释放已经释放的存储空间等。

解决方法:

设置环境变量MALLOC_CHECK_=1以使得glibc跳过检查冲突时遇到的错误。可以参考linux的man malloc结果中NOTES部分的信息。

关于环境变量MALLOC_CHECK_,不同的值代表的含义:

0 -- Do not generate an error message, and do not kill the program
1 -- Generate an error message, but do not kill the program
2 -- Do not generate an error message, but kill the program
3 -- Generate an error message and kill the program

命令如下:

MALLOC_CHECK_=1 srvbuildres -r ./sqlsrv.res

[sybase@centos5 ASE-15_0]$ MALLOC_CHECK_=1 srvbuildres -r ./sqlsrv.res
malloc: using debugging hooks
Warning: You have selected '8k' as the logical page size for the Adaptive
Server. If you plan to load dump from another database, make sure this logical
page size matches the size of the source database. The default logical page
size in previous Adaptive Server versions was 2KB.
Building Adaptive Server 'CENTOS5':
Writing entry into directory services...
*** glibc detected *** srvbuildres: free(): invalid pointer: 0x000000000b022f50 ***
Directory services entry complete.
Building master device...
malloc: using debugging hooks
malloc: using debugging hooks
Master device complete.
Writing RUN_CENTOS5 file...
RUN_CENTOS5 file complete.
Starting server...
malloc: using debugging hooks
malloc: using debugging hooks
Server started.
Building sysprocs device and sybsystemprocs database...
sysprocs device and sybsystemprocs database created.
Running installmaster script to install system stored procedures...
installmaster: 10% complete.
installmaster: 20% complete.
installmaster: 30% complete.
installmaster: 40% complete.
installmaster: 50% complete.
installmaster: 60% complete.
installmaster: 70% complete.
installmaster: 80% complete.
installmaster: 90% complete.
installmaster: 100% complete.
installmaster script complete.
Creating two-phase commit database...
Two phase commit database complete.
Extending tempdb database ...
Extending tempdb database complete.
Installing common character sets (Code Page 437, Code Page 850, ISO Latin-1,
Macintosh and HP Roman-8)...
Character sets installed.
Setting server name in Adaptive Server...
malloc: using debugging hooks
malloc: using debugging hooks
Server name added.
Server 'CENTOS5' was successfully created.

创建备份、XP、JS服务时,类似的命令为:

MALLOC_CHECK_=1 srvbuildres -r ./bsrv.res

MALLOC_CHECK_=1 srvbuildres -r ./xp.res

MALLOC_CHECK_=1 srvbuildres -r ./js.res

使用MALLOC_CHECK_=1后虽然还会报glibc invalid pointer的错误,但是最终成功创建了Sybase服务。测试ASE15.7的时候没有遇到类似的错误。

参考:glibc detected free(): invalid pointer

关于变量MALLOC_CHECK_的取值:

0 -- Do not generate an error message, and do not kill the program
1 -- Generate an error message, but do not kill the program
2 -- Do not generate an error message, but kill the program
3 -- Generate an error message and kill the program

另外,也可以在终端像设置其它环境变量一样设置: export MALLOC_CHECK_=1 或者 setenv MALLOC_CHECK_ 1

  • 本文链接地址:https://www.dbainfo.net/install-ase15-7-glibc-detected-srvbuildres-free-invalid-pointer.htm
  • 本文为dbainfo个人原创,请在尊重作者劳动成果的前提下进行转载;
  • 转载务必注明原始出处 : Sybase数据库技术,数据库恢复专家
  • 对《安装ASE15.7时出现glibc detected *** srvbuildres: free(): invalid pointer问题的解决》有何疑问或见解,请在本文下方发表;
  • 对网站还有其他问题或建议,请提交在留言板,谢谢!
    1. htsing
      2011-12-31 09:56:10

      centos 6.2&&5.7
      执行MALLOC_CHECK_=1 srvbuildres -r ./sqlsrv.res ,问题依旧
      -bash-4.1$ MALLOC_CHECK=1 srvbuildres -r ./sqlsrv.rs
      Building Adaptive Server ‘centos5′:
      Writing entry into directory services…
      *** glibc detected *** srvbuildres: free(): invalid pointer: 0x0000000001df5160 ***
      ======= Backtrace: =========
      /lib64/libc.so.6[0x33ac4750c6]
      srvbuildres(intl_iocsfclose+0x1d)[0x518b3d]
      srvbuildres(dict_unload+0×553)[0x4b4573]
      srvbuildres(iface_close+0×9)[0x4b0109]
      srvbuildres(drv_close+0×54)[0x4ad494]
      srvbuildres(dcl__sess_drop+0×24)[0x4ade34]
      srvbuildres(dscp_sess_close+0x7f)[0x43eb3c]
      srvbuildres(add_ifile_entry+0×152)[0x43fb3e]
      srvbuildres[0x42e2be]
      srvbuildres(build_server+0x19a)[0x42f5a8]
      srvbuildres(process_resource_file+0×1438)[0x42aafc]
      srvbuildres(main+0x2ab)[0x429583]
      /lib64/libc.so.6(__libc_start_main+0xfd)[0x33ac41ecdd]
      srvbuildres[0x429229]
      ======= Memory map: ========
      00400000-0056b000 r-xp 00000000 08:01 3956383 /home/sybase/ASE-15_0/bin/srvbuildres
      0076a000-007a4000 rw-p 0016a000 08:01 3956383 /home/sybase/ASE-15_0/bin/srvbuildres
      007a4000-007b1000 rw-p 00000000 00:00 0
      01db5000-01e57000 rw-p 00000000 00:00 0 [heap]
      33abc00000-33abc20000 r-xp 00000000 08:01 2359421 /lib64/ld-2.12.so
      33abe1f000-33abe20000 r–p 0001f000 08:01 2359421 /lib64/ld-2.12.so
      33abe20000-33abe21000 rw-p 00020000 08:01 2359421 /lib64/ld-2.12.so
      33abe21000-33abe22000 rw-p 00000000 00:00 0
      33ac400000-33ac597000 r-xp 00000000 08:01 2359425 /lib64/libc-2.12.so
      33ac597000-33ac797000 —p 00197000 08:01 2359425 /lib64/libc-2.12.so
      33ac797000-33ac79b000 r–p 00197000 08:01 2359425 /lib64/libc-2.12.so
      33ac79b000-33ac79c000 rw-p 0019b000 08:01 2359425 /lib64/libc-2.12.so
      33ac79c000-33ac7a1000 rw-p 00000000 00:00 0
      33ac800000-33ac802000 r-xp 00000000 08:01 2374227 /lib64/libdl-2.12.so
      33ac802000-33aca02000 —p 00002000 08:01 2374227 /lib64/libdl-2.12.so
      33aca02000-33aca03000 r–p 00002000 08:01 2374227 /lib64/libdl-2.12.so
      33aca03000-33aca04000 rw-p 00003000 08:01 2374227 /lib64/libdl-2.12.so
      33ad000000-33ad083000 r-xp 00000000 08:01 2359427 /lib64/libm-2.12.so
      33ad083000-33ad282000 —p 00083000 08:01 2359427 /lib64/libm-2.12.so
      33ad282000-33ad283000 r–p 00082000 08:01 2359427 /lib64/libm-2.12.so
      33ad283000-33ad284000 rw-p 00083000 08:01 2359427 /lib64/libm-2.12.so
      33ae000000-33ae016000 r-xp 00000000 08:01 2359419 /lib64/libresolv-2.12.so
      33ae016000-33ae216000 —p 00016000 08:01 2359419 /lib64/libresolv-2.12.so
      33ae216000-33ae217000 r–p 00016000 08:01 2359419 /lib64/libresolv-2.12.so
      33ae217000-33ae218000 rw-p 00017000 08:01 2359419 /lib64/libresolv-2.12.so
      33ae218000-33ae21a000 rw-p 00000000 00:00 0
      33b2800000-33b2816000 r-xp 00000000 08:01 2374839 /lib64/libgcc_s-4.4.6-20110824.so.1
      33b2816000-33b2a15000 —p 00016000 08:01 2374839 /lib64/libgcc_s-4.4.6-20110824.so.1
      33b2a15000-33b2a16000 rw-p 00015000 08:01 2374839 /lib64/libgcc_s-4.4.6-20110824.so.1
      7f02fa6a7000-7f02fa6ac000 r-xp 00000000 08:01 2359324 /lib64/libnss_dns-2.12.so
      7f02fa6ac000-7f02fa8ab000 —p 00005000 08:01 2359324 /lib64/libnss_dns-2.12.so
      7f02fa8ab000-7f02fa8ac000 r–p 00004000 08:01 2359324 /lib64/libnss_dns-2.12.so
      7f02fa8ac000-7f02fa8ad000 rw-p 00005000 08:01 2359324 /lib64/libnss_dns-2.12.so
      7f02fa8ad000-7f02fa8b9000 r-xp 00000000 08:01 2359326 /lib64/libnss_files-2.12.so
      7f02fa8b9000-7f02faab9000 —p 0000c000 08:01 2359326 /lib64/libnss_files-2.12.so
      7f02faab9000-7f02faaba000 r–p 0000c000 08:01 2359326 /lib64/libnss_files-2.12.so
      7f02faaba000-7f02faabb000 rw-p 0000d000 08:01 2359326 /lib64/libnss_files-2.12.so
      7f02faaf0000-7f02faaf4000 rw-p 00000000 00:00 0
      7f02fab27000-7f02fab2a000 rw-p 00000000 00:00 0
      7fff54afa000-7fff54b21000 rw-p 00000000 00:00 0 [stack]
      7fff54b9d000-7fff54b9e000 r-xp 00000000 00:00 0 [vdso]
      ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
      已放弃 (core dumped)

      • dbainfo
        2012-01-01 18:26:36

        试试:MALLOC_CHECK_=0

    2. dbainfo
      2012-04-29 22:56:08

      sybase newsgroup上的一个帖子中也遇到了相同的问题,是ASE 15.7 – 64 bits on a RedHat 5.7( 2.6.18-274.3.1.el5)
      请参考:http://nntp-archive.sybase.com/nntp-archive/action/article/%3C4e934ec6$1@forums-1-dub%3E

    :wink: :twisted: :roll: :oops: :mrgreen: :lol: :idea: :evil: :cry: :arrow: :?: :-| :-x :-o :-P :-D :-? :) :( :!: 8-O 8)