Debugger causing problems.

Alex Tweedly alex at tweedly.net
Mon Jan 17 08:11:32 CST 2005


I've spent the best part of the last week working on this one problem, 
and finally found the solution. This is a bit of a rambling rant,  sorry 
about that but I needed to tell someone I've finally made it work :-), 
and how frustrating it's been :-(

I build a simple Spam cleaner a few months ago. The standalone built 
just fine, and it's been in regular daily use on 3 or 4 machines, as 
well as my own use in the IDE - it's by far the most used, and most 
useful, app I've built in Rev.  I've slowly added a few features as I 
used it in the IDE,, and last week decided it was time to build another 
standalone.

Built the standalone, put it on the other machine - and it won't run 
properly. The app loads OK, and it will set up preferences and other 
config stuff OK; but when you click on the "Read email" button it just 
(apparently) does nothing. What it should do is check the preferences 
that have been set, realize the password has not been given and prompt 
the user for it - i.e. no network activity until after this prompt. It 
never gets as far as prompting.

I checked on my own development machine - the standalone fails there too.

So I started debugging - rather painfully, since it would only fail in 
the standalone - so I had to revert to adding debug output statements, 
build the standalone, try it, and repeat - just like an old-fashioned 
edit/compile/test cycle :-(

While doing this, I would occasionally need to run it in the IDE (to 
check the "correct" order and value for  the trace outputs). While doing 
that, I discovered that if I loaded this stack (and therefore see the 
results from openstack/opencard/etc.) and immediately close the stack, 
then immediately try to use the IDE menu - Rev crashes.  The odd thing 
is that if you do something else (like click one of the buttons in the 
toolbar), it carries on OK, and the menu is once again usable.

In 2.5, it just closes silently.
In 2.2.1, it give a "Metacard engine has encountered a problem and must 
close. |Report to Microsoft ?" dialog before closing.

Figuring these were probably somehow related, I started debugging that. 
On a copy of the stack, I (piece by piece) removed the stack script, the 
card script, all the buttons and fields and their handlers - still the 
same behaviour. Simply loading and unloading the stack is enough to 
cause IDE menu usage to crash Rev; remember there are no startup or 
openxxx handlers - so none of the stack's code should be being executed.

I then started deleting the sub-stacks one by one - and eventually 
discovered that one of them (the "help" stack) had a breakpoint set. I 
unset that - and everything is fixed.Went back to the original stack, 
removed the same breakpoint - and now everything is OK there. The stack 
can be loaded and unloaded without problems, and the standalone now 
works just fine.

So I'm happy that I have fixed the problem, and can build my standalone 
again. But I'm kind of worried that something as innocuous as a 
breakpoint in a handler (that isn't being invoked) could cause this kind 
of problems.

I vaguely remember hearing about problems due to breakpoints - but a 
quick search of Bugzilla and of the list archives didn't find anything. 
Does anyone know of a BZ entry this would relate to, or should I open a 
new one ?

Thanks for listening
-- Alex.



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005



More information about the use-livecode mailing list