Crashing be gone!

  • From: Brendan Murphy <bmurphy@xxxxxxxxxxxxxxxxxxxxx>
  • To: ftcdev@xxxxxxxxxxxxx
  • Date: Fri, 9 May 2008 12:20:09 -0500

Good news!

I have finally nailed down the crashing problem when setting RTF
into the FTC. The problem turns out to be a code gen bug in the
compiler. The cause of this is using structures to store data that
does not end up on a boundary. For example, one of my structures
is 61 bytes long and I do something like...

pa = parent.pa

What I am doing here is copying the contents of one structure to
another. This is a real big time saver since I don't have to copy
over every field individually. On the PPC this works correctly,
but on the x86 (Mac and Windows) it appears it wants to copy over
data based on boundaries (in this case, I suspect a boundary of 4
bytes). So what happens is that the copy operation on x86 clobbers
adjacent memory which in turn begins the program down the road to
crashville.

The work around is to pad the structures so that they end on a 4
byte boundary. This fix will be in the next preview and I will
be opening a feedback report with RS. I will also be putting an
FYI on the NUG. So if you use structures, pad them if they are of
odd sizes so the end up on 4 byte boundary.


FTC Website: www.truenorthsoftware.com/Realbasic/FormattedText.html
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in 
the subject field.


Other related posts:

  • » Crashing be gone!