Compiling externals: infrequent crash
Thomas Fischer
fischer.th at aon.at
Mon Mar 12 04:07:52 EDT 2007
Hello,
I have compiled an external which crashes Revolution with one
particular set of parameters (sometimes only after the second or
third try). The result usually looks like
EXC_BAD_ACCESS (0x0001)
KERN_INVALID_ADDRESS (0x0001) at 0x77777736
Thread 0 Crashed:
0 szone_malloc + 4048
1 malloc + 632
2 0x1000 + 1716868
3 0x1000 + 1716788
4 0x1000 + 1095296
5 0x1000 + 53916
6 0x1000 + 1063632
7 0x1000 + 929736
8 0x1000 + 794376
9 0x1000 + 804988
I tried to look at this in the debugger, but the function itself
(extracting lines out of a text) always reaches the end without
problems, the crash happens when the function returns to Revolution.
(Dreamcard 2.7.2 and Revolution 2.8.0-dp-2 tested).
After the crash I have to tell Revolution twice to quit immediately
(in the dock) before it finally stops.
The only problem I could make out is that I use the original data
handle to return the results. I used this on HyperCard externals with
no problem (that I am aware of), but is this somehow disallowed in
Revolution? For large amounts of data it seems economical to use the
existing pointer to write the return values to (admittedly more of a
concern with my former Mac Plus with 4Mb RAM). I rewrote the external
with using a copy of the original parameters to return the data and
haven't had a crash since, but would really like to know if there is
a general rule.
Best regards
Thomas Fischer
More information about the use-livecode
mailing list