crash recipe for htmlText?

Richard Gaskin ambassador at fourthworld.com
Mon Jan 10 17:16:29 EST 2005


Andre Garzia wrote:
 > On Jan 10, 2005, at 7:58 PM, Richard Gaskin wrote:
 >
 >> I'm getting some intermittent hard crashes after setting the
 >> htmlText of a field.  Trying to pin this down, I have a script
 >> that repeatedly performs the same parsing, formatting, and
 >> htmlText setting over and over, and sometimes all of it works
 >> well, sometimes it displays garbage and crashes, and sometimes
 >> it displas garbage and doesn't crash.
 >>
 >> To help pin this down further I have it writing a log of the
 >> data I'm setting the field's htmlText to, so that hopefully
 >> when it crashes I can see if it's due to badly-formed HTML.
 >>
 >> Oddly enough, I've only had once instance in which bad-looking data
 >> would up in the log.  In all other cases it writes well to the log,
 >> even if I see garbage in the field on screen.
 >>
 >> Do any of you folks know of specific issues in which setting or
 >> getting htmlText will cause a crash?  I couldn't find anything
 >> related to this in Bugzilla....
 >
 > What's the text encoding? are you using strange unicodes?

Most of these documents are XML documents with a header noting them as 
"UTF-8", but the actual data is plain text with the only unusual 
elements being hex character encodings (see my earlier post from this 
morning asking for a fast way to convert hex encoded entities into 
displayable text).

The actual code is too lengthy to post, but in short what it does is:

1. Parses up the XML
2. Runs the data from each element through htmlText to
    convert 8859-1 entities
3. Appends the result to a variable
4. Sets the htmlText of a field to that variable for display

If it always crashed in the same spot I'd think it was my code, and 
could dive in an fix it.

But since the same code executes with such mixed results it suggests 
something deeper is going on but it's been very hard to pin down, hence 
my somewhat open-ended inquiry here.

Any and all anecdotes about crahes related to htmlText are likely 
helpful.  TIA -

--
  Richard Gaskin
  Fourth World Media Corporation
  __________________________________________________
  Rev tools and more: http://www.fourthworld.com/rev


More information about the use-livecode mailing list