[comp.sys.apple] TML Pascal Application Crashes

tribby@hpindda.HP.COM (David Tribby) (05/26/88)

I use TML Pascal running under APW to write programs for the IIGS. For
months, I have noticed an intermittent problem that causes the entire
system to crash when I select the "About..." item on the menu.

This week, I believe I nailed down the conditions under which the
crash will occur:
        Boot system, and enter APW
        Run my application (an EXE, not S16 file) as first program
        Choose "About..." menu item as the first action
The program draws the frame and background for the "about" dialog,
then crashes in one of several ways...
        "BRK"s and enters the monitor
        Goes into some infinite loop; hard reset required to regain control
        Causes a series of beeps (multiple crashes into the monitor!)
        Sometimes it turns the super hi-res cursor into garbage
        It always seems to trash my RAM disk

My system has 1.25 meg (96K for /RAM5) and is running with the latest ROMs
and system software.

I think I found the problem last night, but because it is intermittent it
is hard to be sure. I took a very close look at the (fairly simple) code
making up the "About..." procedure, which was copied from TML's demos:
        1. Create a modal dialog
        2. Create a "continue" button as item number 1
        3. Make "continue" the default button
        4. Draw explanation text on the screen
        5. Wait for user to press "continue"
        6. Shut down dialog and return.
I recalled reading that item number 1 is the normal default button, so
step 3 is redundant. I took out the call to SetDefButton and recompiled
one application. It did not crash under the "most likely" conditions.
A second program continued to crash until I modified it...then it ran
without problems.

My questions:
        - Have you seen any problems similar to my description?
        - Can someone else verify that SetDefBuffon causes a crash?
        - How can I be sure I fixed the problem?

Dave Tribby
                                   - - - - -
        ARPA: tribby%hpda@hplabs.HP.COM   UUCP: hplabs!hpda!tribby