revxml

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: revxml

Post by mwieder » Mon Apr 14, 2014 4:56 pm

@runrevmark - I added a note to the two bug reports. Yes, changing the instances of "length()" to "the number of bytes of" does indeed produce the correct values in 7.0-dp2. That said, I'm now seeing exactly the same results for the test stack and xml file in LC 5.5.4, 6.6, and 7.0.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Tue Apr 15, 2014 8:32 am

@runrevmark: It really is a PITA to debug. :-( Switching back to the old external is indeed what we did for now however, this is only a solution for that long. I was already thinking to hop on a plane and fly over to you guys to show the problem. :-/

Best,

Malte

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: revxml

Post by trevordevore » Mon Apr 28, 2014 3:21 pm

I'm troubleshooting a revXML related bug now that is tricky to track down. It looks like revAppendXML has a memory issue.

I make a call to revXMLRPC_AddParam. Random characters will end up in the XML tree after making the call. Sometimes the random characters are in the node value that revXMLRPC_AddParam added. Other times the error is in the value of a different node. Regardless, I end up with a tree with 1 invalid node value.

Unfortunately, a bare bones test stack doesn't recreate the issue. I can take the same XML as my app and try to add XML to it but no error occurs. I can recreate it every time in my application, however.

There is no issue in the version of revXML that comes with 6.5.2. There is starting in 6.6.2. I am using the older revXML external in my app but would like to figure out what is going on in case I ever need functionality in a newer version.

@malte - did you ever get to the bottom of the issue you encountered?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Mon Apr 28, 2014 11:57 pm

Hey Trevor,

unfortunatly not. As soon as I move the XML manipulation out of the apps context, it behaves itself. This is really frustrating.

Best,

Malte

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: revxml

Post by trevordevore » Tue Apr 29, 2014 2:32 am

@runrevmark - if someone at RunRev wants to test my app within context then they might be able to track it down. My app has to be posting a document to WordPress but it is reproducible 100% of the time on my machine.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: revxml

Post by LCMark » Tue Apr 29, 2014 9:59 am

Hmm - both of these issues definitely sound like a memory issue... However, looking at AddXML it doesn't appear to be doing anything that would cause memory overwriting, so it makes me think that its other operations which are causing the issue which is then (in Trevor's case) causing a crash when AddXML is called.

@trevordevore: Sure Trevor - if you send me an email with a recipe and what we need to reproduce we'll take a look and see if we can figure out what's going on.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: revxml

Post by LCMark » Wed Apr 30, 2014 10:18 am

Okay - so I can reproduce the crash in Clarify thanks to Trevor's recipe and it is definitely something memory related I think - the crash is occurring after the event so the recipe doesn't help much.

Do either of you guys have a stack which replicates the XML manipulations you are doing? I realize you've said it doesn't crash outside of the app, but I can run the manipulations through the engine using valgrind on Linux so if one of the XML functions is clobbering memory and causing the problem it will show up.

On a related note, I took a look at Bug 11748 whilst investigating this - I don't think its caused by a bug in libxml2 itself. Indeed, I think its that libxml2 in its newer version is a little more efficient - it isn't creating empty text nodes which revXML assumes are always there in certain places. Certainly the PutIntoXMLNode call is currently assuming there is always an empty text node there, and that you can create an empty text node - neither of these things are true with the newest libxml2. I've pushed a fix for it anyway, so it will get merged in in due course.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Wed Apr 30, 2014 1:11 pm

Hi Mark,

I guess I am able to extract the manipulation part from the app. Will take a day or 2 though. Will be on this tonight.

Best,

Malte

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: revxml

Post by LCMark » Wed Apr 30, 2014 1:14 pm

@malte: Any stacks that you have that do mainpulations using revXML might help - as long as its script that's doing several different things to an XML document it might still register the issue with valgrind.

EDIT: I've tried a couple from some of your bug reports - but I think they are a bit too simple to reproduce the problem as they are fine.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Wed Apr 30, 2014 1:26 pm

Will have it in a testcase with a large XML test file.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Wed Apr 30, 2014 9:55 pm

@Mark: I send you the testbed, along with XML Testdata. Of course it just works nicely, when moved out of context... :-(

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Wed Apr 30, 2014 11:49 pm

Looking at my testbed again I think I found the issue... :-)

revPutIntoXMLNode pID, pNode, pValue

Does not seem to like empty as a value. Will check to have this on atomic level. But having this in the testbed renders my whole tree useless.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Thu May 01, 2014 12:44 am

revPutIntoXMLNode indeed appears to be the troublemaker. Still it requires fairly large XML to happen.

Send a stack and testdata to MArk for investigation.

Best,

Malte

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Fri May 02, 2014 6:44 pm

I just tested RC3 and I am afraid to tell that there is still something fishy going on. :-(
While the tree now no longer appears to get useless, I end up with wrong values in the nodes. I try to get to the bottom of this, but must say I am really close to being at my wits end. Will keep you posted.

Malte

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: revxml

Post by trevordevore » Fri May 02, 2014 6:55 pm

@malte - Mark fixed the revPutIntoXMLNode empty node issue earlier in the week. So that bug shouldn't be affecting you any longer.

The issue you are seeing now sounds like the same one I am seeing. What happens is that revAppendXML can sometimes mess up the value of the node you are inserting or of another node in the tree. Are you using revAppendXML in your application?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Locked

Return to “Engine Contributors”