home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / minix / 5262 < prev    next >
Encoding:
Text File  |  1993-01-25  |  4.3 KB  |  100 lines

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