The recent thread on server crashes has prompted me to ask a question -
Has anyone had a problem with A4D's position function? I have not been
able to duplicate what is happening on our test server yet, but I can
crash our 4D Client that is running as a web server at will with data
from a particular record. I've long suspected that our infrequent
crashes was cause by a couple XML like library routines (all make heavy
use of the position function), but have never been able to prove it.
When we had this crash the other day on a seldom used method, I started
to trace the problem by moving a "dump locals" and "exit" through the
code and it points to the call to "Position" causing the 4D client
(and A4D web server) to crash. Again this routine works on other
records so it seems related to the content of the data - which make no
sense. The routine listed below is one I've been playing with to debug
the one that had the occasional crashes, so it is only used on my test
case.
method "xml_GetTagArray"($xml;$tag;&$tagArray)
$cnt := xml_CountTags($xml;$tag)
resize array($tagArray;$cnt)
for($i;1;$cnt)
$result:=xml_GetTag ($xml;$tag)
$tagArray{$i} := $result
`$first := position($result;$xml) // crash will occur on this call if
uncommented
$first:=first of($xml;$result)
$last:=$first+Length($result)
$xml:=Substring($xml;$last)
end for
end method
As you can see, it was just a simple position call, so I replaced it
with "first of" and it works fine! Nothing strange in the data, just a
628 character XML type node where the only tag in the structure is 627
characters long, leaving only a CR at the end.
Got crash dumps but have not filed a bug report - wanted to get the
data to test server and see if I can duplicate it, but can't get to the
data until we solve another problem. Anyone else having anything like
this?
Steve
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/