From: SMTP%"diewald@virrus.zko.dec.com" 28-OCT-1994 09:34:06.60 To: EVERHART CC: Subj: Re: DECC program failing in ctype.h From: diewald@virrus.zko.dec.com (Jeff Diewald) X-Newsgroups: comp.os.vms Subject: Re: DECC program failing in ctype.h Date: 28 Oct 1994 12:56:35 GMT Organization: Digital Equipment Corporation Lines: 73 Distribution: world Message-ID: <38qse3$j3k$1@usenet.pa.dec.com> Reply-To: diewald@virrus.zko.dec.com (Jeff Diewald) NNTP-Posting-Host: virrus.zko.dec.com X-Newsreader: mxrn 6.18-9 To: Info-VAX@Mvb.Saic.Com X-Gateway-Source-Info: USENET In article <27OCT199417384338@seqvax.caltech.edu>, mathog@seqvax.caltech.edu (David Mathog) writes: |>Has anybody else seen a C program that fails *inside* ctype.h with an |>'Insufficient privilege or object protection violation'??? This is before |>the first line of the program itself. Supposedly this software runs on |>various Unix platforms correctly. |> |>The program and various libraries it needs were compiled with DEC C4.0 (VMS |>6.1/AXP) on a 2100 A500MP with : |> |> $ cc /standard=ANSI89/nolist/noop/prefix=all - |> /include=([],[-.INCLUDE])/define=(DCC4DW12) |> |>There were a couple of warnings about int functions not having "return" in |>them, but at this point in the program, none of them have executed. |> David, This is *highly* suspect. It's possible that you went through one or more of these routines and got some uninitialized value as a result. Take a look at places that initialize static data as well - are they doing something unexpected? (This is a much more common problem in C++, where all sorts of things can happen before the first line of "executable" code is reached.) |> |>When it blew the first time I recompiled the program (but not the libraries) |>with /DEBUG and ran it again. The debugger came up with the pointer on |>"static" in the following fragment of ctype.h |> |>static int __iscntrl (int __c) |>{ |> /* Check explicitly for EOF */ |> return __c < 0 ? 0 : __ctype [__c & 0xFF] & _C; |>} |> From the debugger log you provided, it's not clear if this is an abridged log or not. However, in my experience with these kinds of problems, it's almost always a bogus value being passed down the call chain to the library routine. I'd suggest that you do a SET BREAK/EXCEPTION I'd also suggest a breakpoint on each of the routines that gave you warning messages, just to be absolutely certain they don't get called. Then run to the exception. Use the call stack menu to go up the call stack and see just what's being passed into the called routine. I bet you find garbage somewhere along the way. |>Here's the debugger log (by the way, the DW/Motif 1.2 debugger is really |>nice!), on the first step the pointer moved to the "return" line and it |>did not move from there on subsequent steps: |> |> OpenVMS Alpha AXP DEBUG Version V6.1-000 |> |>Language is C, module set to TESTOBJ |>DBG> step |>stepped to TESTOBJ\__iscntrl\%LINE 1071 |>DBG> step |>No source line for address 84D87AD8 for display in Source View Thanks for the kudo on the debugger - I'll pass it along to the team. From the trace, it's clear you've jumped into hyperspace for some reason. Use the algorithm above to figure out how you got there. ----------------------------------------------------------------------------- Jeff Diewald EASYNET: VIRRUS::DIEWALD DECladebug group INTERNET: diewald@virrus.zko.dec.com Digital Equipment Corp. Note: I don't read every article in this group. If you have debugger questions, I may be able to get you an answer. You're much more likely to get an answer if you put "Debug" somewhere in your subject line.