home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!ornl!rsg1.er.usgs.gov!darwin.sura.net!news.udel.edu!chopin.udel.edu!kurisuto
- From: kurisuto@chopin.udel.edu (Sean J. Crist)
- Subject: Problem isolated but not understood (THINK Pascal standalone crash)
- Message-ID: <Bxy3q0.231@news.udel.edu>
- Sender: usenet@news.udel.edu
- Nntp-Posting-Host: chopin.udel.edu
- Organization: University of Delaware
- Date: Thu, 19 Nov 1992 04:13:11 GMT
- Lines: 28
-
- As I recently posted, I have a crash which occurs when I compile my
- program as a stand-alone application, but not when I run in the THINK
- Pascal environment. Using Macsbug, and by inserting Sysbeeps into
- my code, I've isolated the problem to a call to BlockMove.
-
- What I'm trying to do is completely copy the contents of one handle
- into another (actually these are typecast handles, but that shouldn't
- make any difference- to the operating system they're the same).
- I first set the destination handle to the size of the source handle,
- then call BlockMove to copy the contents from one handle to the other.
- It is on this BlockMove that the crash occurs. The code looks like this:
-
- SetHandleSize(Handle(DestinationHandle), GetHandleSize
- (Handle(SourceHandle))); {Make the two handles the same size}
- BlockMove(Pointer(SourceHandle^), Pointer(DestinationHandle^),
- GetHandleSize(Handle(SourceHandle))); {Copy the contents
- of one handle into the other}
-
- I believe both handles to be valid going in. The crash is a bus
- error which says something about 'supervisor space' (I forget the exact
- wording). This crash never occurs in the THINK Pascal run environment.
- Does anyone have any idea why this is crashing in the stand-alone
- application? Several of the people who answered to my earlier
- posting mentioned problems with pointers. Is there something wrong
- with using the word 'pointer' as I am?
-
- --Kurisuto
-
-