A From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM"  9-AUG-1993 09:10:23.94  To:	EVERHART CC:	4 Subj:	Re: Is there a VAXC/VAXCRTL bug-list anywhere?  % X-Newsgroups: comp.os.vms,vmsnet.misc 7 Subject: Re: Is there a VAXC/VAXCRTL bug-list anywhere? . Message-Id: <5AUG199318275445@eql.caltech.edu>) From: rankin@eql.caltech.edu (Pat Rankin)  Date: 5 Aug 1993 18:27 PDT Distribution: world 0 Organization: California Institute of Technology Keywords: VAXCRTL bugs" Nntp-Posting-Host: eql.caltech.edu% News-Software: VAX/VMS VNEWS 1.41     
 Lines: 191 To: Info-VAX@kl.sri.com  X-Gateway-Source-Info: USENET   F In newsgroup vmsnet.misc, article <1993Aug5.094238.15264@cs.umb.edu>,\2  mzraly@ra.cs.umb.edu (Michael S. Zraly) writes...F > I've seen bunches of reports about how VAXC didn't quite get this orC > that feature right -- e.g. the access() and qsort() routines, the F > curses library, etc.  Has anybody collected a list of these problemsE > (perhaps with fixes or workarounds) and made it publicly available?   H      I've posted this VAXCRTL bug list a time or two in the past, but itH has had some minor revision since the last time.  I haven't attempted toG update it since V6.0 came out, so some of the problems which are listed H as still present in the field test version might be fixed by now.  ThereG are also a couple of really obscure file I/O bugs that I've encountered H under V5.5-2 which I haven't tried to produce a sensible condensed entryI for, and also some T6.0 bugs I didn't add.  The V6.0 Release Notes manual F has a long list of things which are fixed and/or different in DECC$SHRH versus VAXCRTL, and the V5.5-2 Release Notes listed lots of other thingsI (predominantly floating point related) that aren't on this list.  Some of H these bugs haven't been retested under V5.5-2 or later due to the effort/ required to reproduce the failure conditions...   $ 		Pat Rankin, rankin@eql.caltech.edu   -----< vaxcrtl-bugs.txt >-----  A      Known problems with VMS's C run-time library, VAXCRTL, still A present in VMS V5.5-1.  [Fixes for many are finally appearing...]   G qsort   -- once you sort something with size that's a multiple of 4 and G            longword aligned, trying to sort something else which is not G            a multiple of 4 or not longword aligned will risk corrupting H            the data since exchanges will move the wrong number of bytes.1            [this is known to affect GNU C on VMS]      {fixed in 5.5-2}  E strncat -- trying to copy M bytes out of a string of length M+N where H            N is greater than or equal to 65535 will result in it gettingG            stuck in an infinite loop.  [this affects gcc-cpp, the GNU C I            pre-processor; size and current contents of destination buffer             make no difference]     {fixed in 5.5-2}  H realloc -- if the first argument is NULL, the results are unpredictable.H            A pair of registers are left uninitialized in that case, thenE            they're used to try to copy the contents of the old memory E            block into the newly allocated one.  ACCVIO or silent data I            corruption is possible; benign if register R5 happens to be 0.      {fixed in 6.0}  K VAXC$REALLOC_OPT -- returns garbage (whatever happens to be in register R0) +            when the first argument is NULL.      {fixed in 6.0}  F sbrk    -- allocates one page too many if requested amount is an exact!            multiple of 512 bytes.   J puts("") -- will output one byte of junk (duplicated from previous output)D            if--and only if--writing to a terminal.  The problem onlyH            occurs when an empty string is passed and only affects outputL            to terminal devices, not disk files, mailboxes, &c.  Work-around:E            #define puts(foo) (fputs((foo),stdout),fputc('\n',stdout))      {fixed in 6.0}  J getenv("PATH") -- if there's a logical name or symbol called PATH defined,J            its value will be used instead of the current directory [that'sI            documented]; however, it won't be properly '\0' terminated and I            the internal value of one of the other environment values will 0            end up implicitly concatenated to it.     {fixed in 6.0}  G getenv("TERM") -- returns "unknown" for VT420, even though VT400_Series H            has been supported by VMS since V5.4.  Work-around: keep your$            terminal in VT320 mode...     {fixed in 6.0}  F raise   -- missing from VAXCRTL even though it's been documented sinceG            VMS V4.6 and VAX C V2.3; work-around:  #define raise gsignal      {fixed in 6.0}  I setbuf/setvbuf -- end-of-file not always set properly for stream_lf files I            (and probably the other two stream formats) if a buffer larger G            than 512 is used.  [CSC may have a patch available for this] 2     {5.5-2 release notes state that this is fixed}  I open(...,O_WRONLY|O_CREAT|O_TRUNC,...) -- if a new version of an existing H            file is created [which is how O_TRUNC is documented to work],H            the modification and expiration dates of the old file will beC            updated even though it isn't really touched, and the new G            version of the file will inherit the old one's creation date J            instead of the current date [this could be argued as a feature,F            but it occurs as an accidental side-effect of the RMS callsB            used and is inconsistent with other VMS file behavior].     {fixed in 6.0}  H access, chmod, chown -- each calls a common internal file-access routineG            which uses SYS$PARSE and SYS$SEARCH to obtain info about the I            file.  No cleanup processing is done; if the filename contains D            a searchlist, resources consumed by RMS are not released.I            Eventually all open/access-related I/O operations can fail due H            to exhaustion of some resource (CHANNELCNT or FILLM perhaps).     {fixed in 6.0}G         -- Also, the parsing and searching erroneously allows wildcards <            in the filename.  [bug still present in T6.0-5J9]  H *printf("%g") -- chooses %e format instead of %f for values in the rangeH            of 1e-2 to 1e-4, contrary to both the documentation (%f would6            give shorter result) and the ANSI standard.     {fixed in 6.0}  J *printf("%.*f") -- if the argument specifying field precision is negative,D            an ACCVIO can occur, sometimes with an improperly handledD            condition's stack dump.  %.*e and %.*g are also affected.I     {fixed in 6.0, sort of; negative precision ignored, not error return} D         -- precision close to or larger than 512 will likely ACCVIO.D            [problem actually worse under T6.0-5J9; large values willE            ACCVIO, but "medium" values will result in garbage output]   F strtoul -- unreliable; contents of register R0 at time it's called can)            cause ACCVIO or wrong results.      {fixed in 5.5-2}  F strtod, strtol, strtoul -- not safe with non-ASCII data; each uses theJ            _ctype_[] array to skip over leading whitespace, but charactersH            with their 8th bit set result in out-of-bounds access to thatI            array, risking ACCVIO (extremely unlikely in this case) or bad F            results (when 8-bit characters get mistaken for whitespace,@            resulting in an inappropriate non-zero return value).     {fixed in 6.0}  I _CTYPE_ -- the character type macros in <ctype.h> only handle args in the J            range 0 thru 127, when -1 thru 255 (EOF plus 0 thru 255) shouldG            be supported.  The toupper() and tolower() library functions I            handle 0 to 255 correctly [for ASCII, not the ISO Latin or DEC E            Multinational character sets], but change EOF (-1) to 255. J            [6.0 appears to have all the required `ctype' library routines]  H chdir   -- the optional [undocumented/unsupported?] second argument (forE            requesting a change that persists after the program exits) H            does not not work; it correctly calls lib$set_logical insteadE            of sys$crelnm in order to create a supervisor mode logical I            definition for sys$disk, but the constructed arguments are bad9E            and it fails with an invalid string descriptor status; theiJ            result is that the directory component of the default directoryG            ends up changed, but the device component remains unchanged.aG            [Under T6.0-5J9, it falsely claims successful completion but12            still fails to set the default device.]  I sys_errlist[] -- this publicly accessible array of error message text hascI            only 35+1 elements, but the size reported in the correspondingXG            sys_nerr variable claims that it has 65+1, resulting in risk H            of ACCVIO in programs that rely on it.  The internal array ofJ            messages used by strerror() actually does have all 65 elements.B     {fixed in 6.0, sort of; sys_nerr is set to the truncated size}  H VAXC$ESTABLISH -- requires that the caller set aside the longword at theG            top of the _caller's_ stack frame (at address @FP-4) for itscF            private use.  This is handled automatically by VAX C and isC            documented (paraphrased:  "only use it from VAX C, as it I            relies on an allocation on the run-time stack") but is easy toeG            overlook.  Failure to provide this ``hidden local variable'' G            can result in an access violation inside VAXCRTL's conditionhC            handling code when dealing with any condition other than H            C$_LONGJMP, at the time it tries to invoke the user-specifiedK            handler.  [GNU CC deals with this situation correctly in versiondG            2.2 and up for gcc 2.x and version 1.41 and up for gcc 1.x.] *     {not a bug, just a potential "gotcha"}  D strerror -- if the first argument is EVMSERR and the optional secondI            argument is omitted, it will return a null pointer rather thancF            something sensible like "VMS-specific error".  [However, it2            does not ACCVIO as previously claimed.])     {not a bug; could/should be improved}t  F execvp   -- concatenates "VAXC$PATH:" with caller's file_name argumentH            and passes that on to execve(); however, it does not properlyI            '\0' terminate the constructed filename string so intermittent 8            strange errors from LIB$SPAWN() are possible.  K mktime   -- present in both vaxcrtl.olb and vaxcrtl.exe, but not documentedoH strftime -- also not documented, present in vaxcrtl.olb but inaccessibleH            from vaxcrtl.exe.  [Both functions appear to work correctly.]  > setlocale, localeconv -- locale support not [yet?] implementedD mb*, wc* -- multi-byte/wide-character support not [yet?] implemented         Older bugs of note:   L difftime -- subtracts smaller arg from larger rather than first from second.     {fixed in 5.4-3}   -----<eof>-----   