home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / coherent / 3764 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  1.6 KB

  1. Path: sparky!uunet!gossip.pyramid.com!olivea!bu.edu!news.bbn.com!mips2!bubba!sje
  2. From: sje@xylos.ma30.bull.com (Steven J. Edwards)
  3. Newsgroups: comp.os.coherent
  4. Subject: Re: Bug in Coherent 4.0 Compiler
  5. Message-ID: <SJE.92Aug17114818@xylos.ma30.bull.com>
  6. Date: 17 Aug 92 15:48:18 GMT
  7. References: <1992Aug17.133350.7012@miles.com>
  8. Sender: news@mips2.ma30.bull.com (Usenet News Manager)
  9. Reply-To: sje@xylos.ma30.bull.com
  10. Distribution: usa
  11. Organization: Bull HN, Worldwide Information Systems, Billerica, Mass., USA
  12. Lines: 27
  13. In-Reply-To: geis@miles.com's message of 17 Aug 92 13:33:50 GMT
  14.  
  15. > -------------------------------------- cut here ------------------------
  16. > char *string = "Hello World\n";
  17. >
  18. > main()
  19. > {
  20. > char **pp;
  21. >
  22. > *pp = string;
  23. > printf("%s", *pp);
  24. > }
  25. > -------------------------------------- and here ------------------------
  26. >
  27. > This program bombs my system and dumps the core. I have tried this 
  28. > on other UNIX systems and even dos and it works just fine...
  29. >
  30. > How can this get corrected? Do we have to wait until 4.1????
  31.  
  32. It's a bug in your code.  The value of variable pp is undefined at the
  33. time it is dereferenced in the statement "*pp = string".  That
  34. assignment is either trashing four bytes somewhere or trying to write
  35. outside the data segment.  It is not a problem with Coherent.
  36.  
  37.  [The above opinions expressed are my own; not necessarily held by others.]
  38.       == Steven J. Edwards           Bull HN Information Systems Inc. ==
  39.       == (508) 294-3484              300 Concord Road         MS 820A ==
  40.       == sje@xylos.ma30.bull.com     Billerica, MA 01821          USA ==
  41. "That Government which Governs the Least, Governs Best." -- Thomas Jefferson
  42.