Oracle 用の ProC プリコンパイラの使用を含む古いソフトウェアをコンパイルしようとしています。
このソフトウェアは、Solaris 10 で Oracle 9 を使用してproc
実行され、実際のコンパイラが .c を .o に変換する前に、ツールを使用して .proc ファイルを .c ファイルに変換します。
.proc ファイルのいずれかに対して proc を実行しようとすると、これが発生します。
# /avacm/nproducts//oracle/source/solaris_2.9/9.2/bin/proc define=__sun define=PRE_COMP code=ansi_c mode=oracle def_sqlcode=yes threads=yes include=/usr/include include=../../../../../include include=../../../../../include/rpcsvc include=../../../../../aam/include include=../../../../../aam/libs/libavaora/include datahost.proc
Pro*C/C++: Release 9.2.0.6.0 - Production on Tue Jul 26 19:06:20 2011
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
System default option values taken from: /avacm/nproducts//oracle/source/solaris_2.9/9.2//precomp/admin/pcscfg.cfg
Segmentation Fault (core dumped)
次に、truss
実際に何が起こっているかを確認します。
# truss -vall -wall -fall /avacm/nproducts//oracle/source/solaris_2.9/9.2/bin/proc define=__sun define=PRE_COMP code=ansi_c mode=oracle def_sqlcode=yes threads=yes include=/usr/include include=../../../../../include include=../../../../../include/rpcsvc include=../../../../../aam/include include=../../../../../aam/libs/libavaora/include datahost.proc
そして、これらは最後の数行です。
15775/1: close(10) = 0
15775/1: open("sys/uio.h", O_RDONLY) Err#2 ENOENT
15775/1: open("/usr/include/sys/uio.h", O_RDONLY) = 10
15775/1: fstat64(10, 0xFFBFB578) = 0
15775/1: d=0x00800000 i=16783 m=0100644 l=1 u=0 g=2 sz=2885
15775/1: at = Jul 26 18:50:45 GMT 2011 [ 1311706245 ]
15775/1: mt = Mar 13 10:41:10 GMT 2009 [ 1236940870 ]
15775/1: ct = May 10 19:03:47 GMT 2011 [ 1305054227 ]
15775/1: bsz=8192 blks=6 fs=ufs
15775/1: brk(0x00A475B0) = 0
15775/1: brk(0x00A495B0) = 0
15775/1: fstat64(10, 0xFFBFB420) = 0
15775/1: d=0x00800000 i=16783 m=0100644 l=1 u=0 g=2 sz=2885
15775/1: at = Jul 26 18:50:45 GMT 2011 [ 1311706245 ]
15775/1: mt = Mar 13 10:41:10 GMT 2009 [ 1236940870 ]
15775/1: ct = May 10 19:03:47 GMT 2011 [ 1305054227 ]
15775/1: bsz=8192 blks=6 fs=ufs
15775/1: ioctl(10, TCGETA, 0xFFBFB504) Err#25 ENOTTY
15775/1: read(10, " / *\t C o p y r i g h t".., 8192) = 2885
15775/1: brk(0x00A495B0) = 0
15775/1: brk(0x00A4B5B0) = 0
15775/1: brk(0x00A4B5B0) = 0
15775/1: brk(0x00A4D5B0) = 0
15775/1: brk(0x00A4D5B0) = 0
15775/1: brk(0x00A4F5B0) = 0
15775/1: read(10, 0x00A45A9C, 8192) = 0
15775/1: llseek(10, 0, SEEK_CUR) = 2885
15775/1: close(10) = 0
15775/1: open("/avacm/nproducts//oracle/source/solaris_2.9/9.2//precomp/mesg/pcpus.msb", O_RDONLY) = 10
15775/1: fcntl(10, F_SETFD, 0x00000001) = 0
15775/1: lseek(10, 0, SEEK_SET) = 0
15775/1: read(10, "1513 "011303\t\t\0\0\0\0".., 256) = 256
15775/1: open("/avacm/nproducts//oracle/source/solaris_2.9/9.2//slax/mesg/pxus.msb", O_RDONLY) Err#2 ENOENT
15775/1: open("/avacm/nproducts//oracle/source/solaris_2.9/9.2//slax/mesg/pxus.msb", O_RDONLY) Err#2 ENOENT
15775/1: close(10) = 0
15775/1: close(9) = 0
15775/1: close(8) = 0
15775/1: open("/avacm/nproducts//oracle/source/solaris_2.9/9.2//precomp/mesg/pcsus.msb", O_RDONLY) = 8
15775/1: fcntl(8, F_SETFD, 0x00000001) = 0
15775/1: lseek(8, 0, SEEK_SET) = 0
15775/1: read(8, "1513 "011303\t\t\0\0\0\0".., 256) = 256
15775/1: Incurred fault #6, FLTBOUNDS %pc = 0x0004CED8
15775/1: siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
15775/1: Received signal #11, SIGSEGV [default]
15775/1: siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
これについて私が理解しているのは、pcsus.msb
ファイルの読み取り中に、一部の文字列処理が失敗し、セグメンテーション違反が発生したことです。
オンラインで見つけたさまざまなpcsus.msb
ファイルを使用してみましたが、さまざまなエラーが発生するものもありましたが、機能しません。
コア ファイルのpstrack
出力もあまり役に立ちません。
# pstack core
core 'core' of 15803: /avacm/nproducts//oracle/source/solaris_2.9/9.2/bin/proc define=__sun
0004ced8 pcs (0, ffbfeae4, 0, 1, ffbfd788, 2) + 37c
00044dfc pc2main (ffbfeb94, ffbff0ac, 1, 0, 544668, fe6ba518) + 1030
00416d70 lpmcall (51bac0, 51f660, 51bb68, c, ffbff780, 51b7a0) + 46c
004129a4 lpmpmai (4, ffbff534, d, ffbff74c, ff000000, 80808080) + 178
0003e688 main (d, ffbff74c, ffbff784, 513c00, ff2a0100, 0) + f0
0003e570 _start (0, 0, 0, 0, 0, 0) + 108
これを修正しようとすることができるポインタはありますか?
ありがとう、ハビエル