home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!rpi!batcomputer!munnari.oz.au!ariel.ucs.unimelb.EDU.AU!werple.apana.org.au!hal9000!monty!newton
- From: newton@monty.apana.org.au (Mark Newton)
- Newsgroups: comp.os.minix
- Distribution: world
- Subject: Re: ACK ANSI Compiler
- References: <1993Jan21.075806.29635@philce.ce.philips.nl>
- Message-ID: <93012418390@monty.apana.org.au>
- Organization: APANA South Australia - State mail hub
- Date: Sun, 24 Jan 93 03:13:40 +1030
- Lines: 82
-
- meulenbr@ce.philips.nl (Frans Meulenbroeks) writes:
- > newton@monty.apana.org.au (Mark Newton) writes:
- > [...]
- > >The 68000 ACK compiler has bugs - BAD bugs. [...]
- >
- > ...
- >
- > I challenge you to send a bug list to the net to prove your statement!
-
- Oh dear. He wants me to enumerate them <sigh>
-
- A large number of MINIX programs which wouldn't work with the ACK
- compiler have compiled flawlessly on my system (and a number of other
- 68000 MINIX systems which I am acquainted with) with c68.
-
- I'm not talking about programs that came with the MINIX distribution;
- they'd be expected to work properly when compiled with ACK. But, third
- party packages like Minicom 1.2, FvK's UUCP, Nethack 1.2e, the curses
- package on plains, and parts of Elm 2.4 wouldn't work correctly with
- ACK on any of the Amiga MINIX systems I know. And fixing them was as
- simple as unarchiving the sources and recompiling them with c68.
-
- When I say "they didn't work correctly," I don't mean that they'd just
- dump core and squirt an error message onto the console. I mean that
- they'd crash the entire machine and necessitate a reboot.
-
- The most common kind of constructs which would cause such crashes were
- operations on strings declared with constant initializers:
-
- char *foo = "this will crash my computer when I use strcpy() on it!";
-
- (no, it wouldn't do it in every situation; it was most insidious, and
- spending time with debuggers to work out the exact sequence of instructions
- that would cause a crash didn't do a whole lot of good for this little
- black duck. I've never claimed to be an assembly language guru anyway
- :-)
-
- I spent many an evening going through errant sources and changing them
- to something like this:
-
- char foo[size_of_the_damned_string];
- strcpy(foo, "this will not crash my computer...");
-
- to prevent lockups.
-
- (not to mention the lockups that bar = time() would cause when time()
- would try to write its current timer value to a pointer argument that
- hadn't been supplied - bar = time(NULL) was the simple fix for that.
- bar = time() doesn't crash at all when c68 is used over the same source
- code).
-
- Now, I acknowledge that the problem was as much with the kernel as with
- the compiler, but all of those hassles dried up the instant I stopped
- using ACK and switched to c68. Magic, eh? Now my system stays up for
- days on end without problems, even when I'm doing heavy development work.
-
- Even now, if I accidentally type "cc" instead of "cc68" to compile
- something I've been working on, and run it without realizing it, crashes
- occur. Compile it with c68 and bingo! Flawless operation.
-
- Everyone who's been in this newsgroup for more than a few months knows
- that the K&R ACK compiler had bugs, and the 680x0 version was worse than
- the Intel version. As far as I can tell, the only reason it isn't talked
- about much these days is because all the people who know what has been
- causing their system crashes for all these years have switched over to
- c68. I'm not sure if the Walker brothers realize what a godsend that
- compiler has been to me and every other MINIX user I know.
-
- End of diatribe.
-
- For corrobative purposes, could anyone out there running stock-standard
- v1.5.10.1 or 1.5.10.2 Amiga MINIX please try an experiment for me? ftp
- the curses package from plains (I _think_ it's on plains!), compile it
- up, and try to run the demo that comes with it. I'd recommend that you
- type "sync" before you try it out; The system won't stay alive for long
- enough to flush your buffer cache :-)
-
- Then rebuild it with c68 v4.x and run the demo again. Magic!
-
- (then compile your kernel with it - does the 30k decrease in size
- surprise you?)
-
- - mark
-
- --------------------------------------------------------------------
- Self-control: The ability to eat newton@monty.apana.org.au
- only one peanut. Mark Newton
- --------------------------------------------------------------------
-