home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!rpi!batcomputer!cornell!rochester!udel!sbcs.sunysb.edu!csws10.ic.sunysb.edu!rhorn
- From: rhorn@csws10.ic.sunysb.edu (Robert Horn)
- Subject: Re: Fix : ThinkC app won't run standalone (bug in smart link!?)
- Message-ID: <1992Dec17.214202.12978@sbcs.sunysb.edu>
- Sender: usenet@sbcs.sunysb.edu (Usenet poster)
- Nntp-Posting-Host: csws10.ic.sunysb.edu
- Organization: State University of New York at Stony Brook
- References: <steve.herman-161292132205@128.158.4.199> <1992Dec16.215017.16222@usl.edu> <1992Dec17.143701.19170@sernews.raleigh.ibm.com>
- Date: Thu, 17 Dec 1992 21:42:02 GMT
- Lines: 52
-
- In article <1992Dec17.143701.19170@sernews.raleigh.ibm.com> crg@rocky.raleigh.ibm.com (Chuck Grissom) writes:
- >In article <1992Dec16.215017.16222@usl.edu>, pvl1779@usl.edu (Leach Phuong V) writes:
- >|>
- >|> First thanks to those who responded.
- >|>
- >|> The problem seems to be in the linker. I turned the "smart link" option
- >|> off when building the application, and it runs fine now.
- >|>
- >|> The app was crashing on a sprintf() call. Earlier calls worked fine, but
- >|> at some point in the program, sprintf() got stepped on and no longer
- >|> worked. It seems to me that the "smart" linker has a possible bug.
- >|> Does this seem like a reasonable assumption to you?
- >|>
- >|> Go figure,
- >|> Robb
- >
- >Well, bugs in the linker are possible...but...many, many times I have heard
- >a C programmer claim that the bug in his program must be due to a compiler bug
- >only to find after further debugging that it's in his code after all. As for
- >me, I assume every bug is MINE unless I can point to the exact problem in the
- >compiler/linker. If it is such a problem, you should be able to reproduce it
- >with very simple code. Otherwise, keep looking for those pointer errors!
- >
- >Chuck
-
- Recently I was writing an 'XTCL' for Alpha (my shareware fee will be sent just
- as soon as I find a job (I can no longer use the excuse that I'm a starving
- college student) :), and using sprintf compiled with 4 byte ints and
- A4 addressing and the beastie was periodicly crashing (I forget what
- the exact sequence of events was, but it was reproducable) in sprintf
- (actually, it would hang for a while, then crash...). I eventually wrote
- my own sprintf routine (at least, as much of sprintf as I was using), and
- the 'XTCL' worked perfectly fine (or at least hasn't crashed yet).
-
- I assumed at the time that I was just doing something mindbogglingly
- stupid (so mindbogglingly stupid that I would never see it), but it's
- also possible that there is a subtle bug in sprintf, which might be causing
- the problems above as well. (No, I haven't traced through the entirety
- of sprintf using MacsBug, but I did check my parameters on the way
- into the routine, and they seemed perfectly fine (no dereferenced
- handles, (locked or unlocked), the result string was long enough
- for the sprintfed stuff and all that), and my_min_sprintf worked,
- so I wouldn't rule out a bug in sprintf).
-
- Robb (an entirely different Robb than any other Robb mentioned
- previously in this post)
-
-
-
- --
- rhorn@ic.sunysb.edu Never choose a college because it has a duckpond.
- $@` Send me hate mail, I love it.
-