Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!gatech!ncsuvx!ece-csc!jnh From: jnh@ece-csc.UUCP (Joseph Nathan Hall) Newsgroups: comp.os.vms Subject: Re: VMS C version 2.3 optimize bug? Message-ID: <3618@ece-csc.UUCP> Date: 29 May 88 07:22:26 GMT References: <2099@ucdavis.ucdavis.edu> <2101@ucdavis.ucdavis.edu> Reply-To: jnh@ece-csc.UUCP (Joseph Nathan Hall) Organization: North Carolina State University, Raleigh, NC Lines: 34 In article <2101@ucdavis.ucdavis.edu> hildum@iris.ucdavis.edu (Eric Hildum) writes: >I am current using VAX/VMS C version 2.3-024. Several of my programs >dynamically allocate space ... >... I have no trouble when I compile the >programs /NOOPTIMIZE, but get access violations when I compile >/OPTIMIZE... It is my experience, and the experience of a couple other programmers working here, that malloc() and the optimizer are not compatible in general in VAX C. I had some truly strange problems with what should have been perfectly- functional code. A module would crash and dump ("access violation") for no apparent reason. I'd track down the suspect line of code, insert a printf or two for debugging purposes, recompile (optimizer on), and the module would either work flawlessly or would crash at a later line. It seems that somehow a stack pointer got corrupted, and it was never clear to me how malloc() was associated with this, except that I've never observed this problem in any code that didn't use malloc(). Things were so screwed up that the debugger choked (non-symbolic stack dump) whenever I tried to use it to examine one of these glitches. I never got around to looking at the machine code, though I probably will one day when I've got time to play with this at length. Everything, of course, works peachy with the optimizer off. /NOOPT has, unfortunately, become SOP in most of my (heavily malloc()-oriented) work. -- v v sssss|| joseph hall || 201-1D Hampton Lee Court v v s s || jnh@ece-csc.ncsu.edu (Internet) || Cary, NC 27511 v sss || the opinions expressed herein are not necessarily those of my -----------|| employer, north carolina state university . . . . . . . . . . .