On Mon, May 6, 2013 at 11:58 AM, Lionel Cons
<[email protected]> wrote:
> On 23 April 2013 22:58, Roland Mainz <[email protected]> wrote:
>> On Tue, Apr 23, 2013 at 6:36 PM, ольга крыжановская
>> <[email protected]> wrote:
>>> Michal, I can reproduce the bug on Suse 12.3 with a 64bit
>>> ast-ksh.2013-04-22 in PATH to run iffe. What crashes is this:
>>>
>>> + /bin/cp dbm.req
>>> /home/test001/work/ast_ksh_20130422/build_32bit_plain/arch/linux.i386-64/lib/lib/dbm
>>> + mamake -C lib/libast -k install
>>> probing C language processor
>>> /home/test001/work/ast_ksh_20130422/build_32bit_plain/arch/linux.i386-64/bin/cc
>>> for mam information
>>> + iffe -v -X ast -X std -c 'cc -D_BLD_DLL -fPIC -D_BLD_ast -O2    '
>>> run 
>>> /home/test001/work/ast_ksh_20130422/build_32bit_plain/src/lib/libast/features/standards
>>> iffe: cc -D_BLD_DLL -fPIC -D_BLD_ast -O2 -c ./suse35823.c
>>> iffe: line 38: 35827: Memory fault
>>> iffe: cc: core dump or fatal interruption -- results inconclusive
>>> mamake [lib/libast]: *** exit code 11 making FEATURE/standards
>>>
>>> package make was called through
>>> CC='gcc -m32' /bin/ksh ./bin/package make 2>&1 | tee -a buildlog.log
>>
>> I took a look at Olga's crash... the stack trace is different from
>> Michals and only happens for ast-open builds but not if the same
>> sources are build with ast-ksh... then I rebuild the tree to test
>> something else and... erm... the bug is... gone (which means I don't
>> have a stack trace either... still digging...).
>>
>> My guess is that there is a sporadic issue somewhere in the build
>> system for ast-open (but not ast-ksh) which causes these "glitches"
>> (Michal's issue may be a seperate one...) ...
[snip]

Here is a variation of the crash, sampled with
ast-ksh.2013-05-03+patches as SHELL running "iffe.sh" under
VMALLOC_OPTIONS=abort control ... and I patched "iffe.sh" to generate
core dumps for me:
-- snip --
--- src/cmd/INIT/iffe.sh 2013-03-06 17:33:17.000000000 +0100
+++ src/cmd/INIT/iffe.sh        2013-05-15 12:20:36.812053010 +0200
@@ -1,3 +1,4 @@
+ulimit -c unlimited
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
@@ -1290,8 +1291,8 @@
 case $debug in
 2)     core=
        ;;
-*)     if      (ulimit -c 0) >/dev/null 2>&1
-       then    ulimit -c 0
+*)     if      ( true ) >/dev/null 2>&1
+       then    true
                core=
        else    core="core core.??*"
        fi
-- snip --

The stack trace looks like this:
-- snip --
Core was generated by `cc -c ./suse17842.c
st_ksh_20130503/build_iffedebug/arch/linux. me/test001/work'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000004288f3 in fcfopen (f=0x7f9ab79e0ed0) at
/home/test001/work/ast_ksh_20130503/build_i386_64bit_debug/src/cmd/ksh93/sh/fcin.c:64
64                      *_Fcin.fclast = 0;
(gdb) where
#0  0x00000000004288f3 in fcfopen (f=0x7f9ab79e0ed0) at
/home/test001/work/ast_ksh_20130503/build_i386_64bit_debug/src/cmd/ksh93/sh/fcin.c:64
#1  0x0000000000460a90 in sh_parse (shp=0x7fa420 <sh>,
iop=0x7f9ab79e0ed0, flag=0) at
/home/test001/work/ast_ksh_20130503/build_i386_64bit_debug/src/cmd/ksh93/sh/parse.c:364
#2  0x000000000040efce in exfile (shp=0x7fa420 <sh>,
iop=0x7f9ab79e0ed0, fno=10) at
/home/test001/work/ast_ksh_20130503/build_i386_64bit_debug/src/cmd/ksh93/sh/main.c:570
#3  0x000000000040e2fc in sh_main (ac=3, av=0x7fffbbe4acd8,
userinit=0x0) at
/home/test001/work/ast_ksh_20130503/build_i386_64bit_debug/src/cmd/ksh93/sh/main.c:360
#4  0x000000000040d4b1 in main (argc=3, argv=0x7fffbbe4acd8) at
/home/test001/work/ast_ksh_20130503/build_i386_64bit_debug/src/cmd/ksh93/sh/pmain.c:45
(gdb) print _Fcin
$1 = {_fcfile = 0x7f9ab79e0ed0, fcbuff = 0x0, fclast = 0x10000
<Address 0x10000 out of bounds>, fcptr = 0x0, fcchar = 0 '\000', fclen
= 1, fcfun = 0x43fa76 <lex_advance>,
  context = 0x7f9ab7a9cbc0, fcleft = 0, fcoff = -1}
(gdb) print _Fcin.fclast
$2 = (unsigned char *) 0x10000 <Address 0x10000 out of bounds>
(gdb) print buff
$3 = 0x0
-- snip --

The matching code in src/cmd/ksh93/sh/fcin.c around line 64 looks like this:
-- snip --
    57          n = sfvalue(f);
    58          fcrestore(&save);
    59          sfread(f,buff,0);
    60          _Fcin.fcoff = sftell(f);;
    61          buff = (char*)sfreserve(f,SF_UNBOUND,SF_LOCKR);
    62          _Fcin.fclast = (_Fcin.fcptr=_Fcin.fcbuff=(unsigned
char*)buff)+n;
    63          if(sffileno(f) >= 0)
    64                  *_Fcin.fclast = 0;
    65          return(n);
    66  }
-- snip --

The issue is that |buff = (char*)sfreserve(f,SF_UNBOUND,SF_LOCKR);|
returns |NULL| and the remainder of the code doesn't expect that (but
I don't know why this happens or why this happens only sporadically...
;-( ) ...

More data from the code dump:
-- snip --
(gdb) print f
$2 = (Sfio_t *) 0x7f9ab79e0ed0
(gdb) print *f
$3 = {_next = 0x7f9ab7a7c070 "int i =
1;\nN\nDS_MAX\nTERATIONS\nast_ksh_20130503/build_iffedebug/src/lib/libast/comp/conf.tab\n",
  _endw = 0x7f9ab7a7c070 "int i =
1;\nN\nDS_MAX\nTERATIONS\nast_ksh_20130503/build_iffedebug/src/lib/libast/comp/conf.tab\n",
  _endr = 0x7f9ab7a7c070 "int i =
1;\nN\nDS_MAX\nTERATIONS\nast_ksh_20130503/build_iffedebug/src/lib/libast/comp/conf.tab\n",
_endb = 0x7f9ab7a8c070 "", _push = 0x0, _flags = 2,
  _file = 10, _data = 0x7f9ab7a7c070 "int i =
1;\nN\nDS_MAX\nTERATIONS\nast_ksh_20130503/build_iffedebug/src/lib/libast/comp/conf.tab\n",
_size = 65536, _val = -1}
-- snip --

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to