I implemented an external using the xml-parser of this community http://xmlsoft.org/
See the xml-folder for the implementation.
You need to copy all dylibs to /usr/lib in sudo-mode.
All works fine.

Also since long time I am using an external for copy files (filesys with ‘cp’ command)
Sources in the filesys-folder.

Please open the patch and follow the steps described. The combination of the two patches crashes Max.

It is hard to understand, why Max crashes here (in general) and even more weird: why is Max crashing only after the second time…?
It looks like a collosion of the dylibs… but I don’t have any idea of the dylib system of Max@Mac
The crash: Max freezes… it is not a crash to be more precise (colorball shows up, nothing happens)

Under Windows I was using 2.7.8 of libxml and I had problems with the combination of libxml/zlib and quicktime (jit.qt.movie)http://cycling74.com/forums/topic.php?id=33277
This I could resolve copying the dll into the app folder after building an Application (and not inlcude it into the ‘sources’).

Attachments:

At first glance, I don’t see any problems with your code for the file copying. There is no source code for the xmlparser though. I can only speculate that some resource in that object is not being properly released.

is large enough? I don’t see any safeguards to make sure that the memory isn’t being accessed past the end of this. As a minimum you could use strncpy(), or Max’s strncpy_zero(), instead of strcpy().

Are you debugging using the Runtime? Assuming yes, you could turn on Xcode’s "Enable Guard Malloc" feature. It will run _very_ slowly, but often crashes at the point that out-of-bounds memory is accessed rather than at some random point later on.

Hi Tim,
thank you for your answer!
But why is it all working on windows?
The problem occurs regularly in the same moment of the process, but if it would be a pointer access violation, it would appear in different situations, wouldn’t it?

I tried with debug mode too, but there was again the inifitive-loop phenomenon.

I tried to change the char xmlResult to 4096, as well I am using strncopy_zero with this length in xmlparser.c. Also I attached the console output of xCode in GuardMalloc-Mode. There is still no change.
In the line 242 of filesys.cerrCode = path_copyfile(srcpath, srcfilename, dstpath, dstfilename);
the Debugger tells me: GDB: stepping into… and that’s it, no response anymore.
Is there anything else I can do? I am thinking, that it could be a problem with the file access. For me it looks like
the copy process is started (the file also is generated as a hidden copy-in-process-file), but it is ending in one step in an infinitive loop.

Thanks in advance
Best
Johannes

Attachments:

The console doesn’t tell me much… So it just spins forever rather than actually crashing? Speculating (but maybe it will spark an idea for you), is the file you are copying properly terminated? Is it possibly still open for writing by another process?

Instead of using path_copyfile(), you could try substituting your own code to copy the file contents and see what happens. It should be pretty easy to do with fopen() and friends.

Sorry I can’t dive in for an extra-detailed analysis right now — we’ve got a lot cooking still to do on Max 6.

problem solved finally… I am using the standard-copy function with fopen/getc/putc to copy the file and now it works. I think it is related to the path_copyfile()-Method and a flag should be the access-option in the method-signature – one day, after Max6.