Re: [xml] libxml causes crash on windows

2011-04-11 Thread Jellinghaus Andreas
Hi Bjoern,

thanks for your help!

The crash I saw was the typical access to a random memory location outside the 
processes memory.

Thanks for reminding me on the VSCRT incompatibilities issues.
Now I recompiled libxml myself with VS2008 (libxml 2.7.8 with small editing of 
win32/Makefile.msc
- some extra + at the start of three new lines), and tried again with that.

It works now, said app with my dll and the new compiled libxml works now fine - 
in release mode.

If I compile my dll in debug mode, the dll isn't even loaded - R6034. If I link 
my debug dll
with libxml_a.lib instead, it works, but the 3rd party app again crashes. So I 
guess I need
to recompile libxml once as a debug binary and once as a release binary and 
always use the
right dll?

I had a look with dependency walker at the 3rd party app, and the dll's listed 
directly are:
mfc42.dll msvcrt.dll kernel32.dll user32.dll advapi32.dll wsock32.dll
msvcp60.dll version.dll

does anyone know what version of VS and what flags to use with compiler and 
linker might work
best with those files? if I googled right, mfc42.dll is Visual C++ 4.2 from 
1998.

I can't even compile other libraries such as openssl with vs 2005, and guess 
they won't work
with such an old visual c++ either - in case I can find that somewhere.

Maybe I need to try static linking my dll with libxml, openssl and maybe even 
the windows
system libs to mitigate the problem?

does anyone have experience with this type of DLL hell on windows?

Regards, Andreas
p.s. I don't have the typical dll hell issues - I don't copy msvcrt* files 
around, but rather
use the proper vcredist files, and for libxml, openssl etc. I have one seperate 
directory
with the third party app and all those dll files, so that app uses those files 
in that
directory, and the rest of the system stays clean.
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


[xml] libxml causes crash on windows

2011-04-09 Thread Jellinghaus Andreas
Hi there,

on windows xp with vs 2008 I'm using libxml 2.7.7 (the binaries from 
xmlsoft.org website).

I have some third party app loading a plugin dll and running init(), do(), 
done() functions,
and unloading the plugin dll. In my plugin dll I try to use libxml, and when I 
do, everyhing
works fine except the 3rd party app crashes after everything is done.

my init contains:
xmlInitParser();
LIBXML_TEST_VERSION

and my done has:
xmlCleanupParser();

and I can keep those in - with that alone everything works fine, and stays 
stable.

but as soon as my code tries to use some libxml functionality, in the end the 
3rd party app
crashes. I reduced the code to this single line, it is enough to cause the 
crash:
doc = xmlParseMemory((char *)card_data, strlen((char *)card_data) + 1);

whether I xmlFreeDoc(doc); or not doesn't change anything.

of course I try to get support from the makers of the 3rd party app, as it is 
there code
that crashes, but well ...

so I wonder: did I do something wrong, like forgetting some initialisation or 
shutdown
code, or is there anything else I need to do? the plan is to use libxml in a 
way, so at
the end is everything like it was before - no need for stupid 3rd party apps to 
crash etc.

and: do I need to do anything special for the two libs used by libxml? (libz, 
libiconv)?
I'm not calling or using them myself, so I hope the xmlInitParser() and 
xmlCleanupParser()
takes care of those dependencies, is that right?

Thanks for your help and best regards,

Andreas
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] libxml causes crash on windows

2011-04-09 Thread Bjoern Hoehrmann
* Jellinghaus Andreas wrote:
on windows xp with vs 2008 I'm using libxml 2.7.7 (the binaries from 
xmlsoft.org website).

I have some third party app loading a plugin dll and running init(), do(), 
done() functions,
and unloading the plugin dll. In my plugin dll I try to use libxml, and when I 
do, everyhing
works fine except the 3rd party app crashes after everything is done.

That is insufficient information (Windows, for instance, tells you why
it had to terminate the process, for instance, an illegal write, a bad
instruction, a stack overflow, and so on; you should also be able to
get a call stack trace from the crash). But to make a guess, mysterious
crashes when mixing code compiled with different versions of MSVC are
quite often the result of mixing incompatible runtime libraries, that's
what I'd try to rule out first after looking at the more basic things.

I would also make sure your code and the third party code do not share
any other libraries, like the application picking up the zlib library
you use for libxml. Assuming the application does not crash trying to
call your code, and there is nothing shared between the various compo-
nents involved, there should be no reason for anything you do with lib-
xml to cause crashes in unrelated code.
-- 
Björn Höhrmann · mailto:bjo...@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml