[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] `exit' statement issue

From: Denis Shirokov
Subject: [bug-gawk] `exit' statement issue
Date: Tue, 28 May 2013 01:12:21 +0300

Hi Arnold, Eli.

This is bug report about `exit' statement.

Unfortunately the gawk script source isn't simply. But I cannot
reproduce it in other way:
The source is attached as _main.gwk

In the source see function test_uid:

func    test_uid( p,i) {

        _conl("_fclass uid: " _getuid(_fclass)); _drawuid(_fclass)
        _conl("_classys uid: " _getuid(_classys))_drawuid(_classys)
        for ( i=1; i<82; i++ )          _conl(i ": " _getuid(_fclass))          
#<---- you
see that _getuid() function is called 81 times; but at the 82nd time
the internal script failure occurred - this is normal
func    _getuid(p) {
        if ( p in _UIDOBL )     { for ( _tptr in _UIDOBLV[_getuida0=_UIDOBL[p]]
)       { delete _UIDOBLV[_getuida0][_tptr]; _CLASSPTR[_tptr]=p; return
_tptr } }
        return _tptr }

func    _getuid_i0(p,UL,UH)     { if ( ""==_tptr=UL[_UIDCNTL[p]] )      { for (
_tptr in UH )   { delete UH[_tptr]; return (_UIDCNTH[p]=_tptr)
(_UIDCNTL[p]=UL[""]) }
        _fatal("out of UID") }          # <---- here is failure handler 
function call
at 82nd time
        return _UIDCNTH[p] (_UIDCNTL[p]=_tptr) }

func    _fatal(t,d, A) {
        if ( _ERRLOG_FF ) {
                A["TYPE"]="FATAL"; A["TEXT"]=t
                _log(A,d) }
        if ( !d )       exit }                          # <---- here is the 
crash moment


I see the same issue in gawk 3.17b that i was used before gawk 4.0.0

Hope this can help.

Denis Shirokov

Attachment: _MAIN.GWK
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]