After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 69625 - xmlDocDumpMemory Crashes with various memory access errors.
xmlDocDumpMemory Crashes with various memory access errors.
Status: VERIFIED NOTGNOME
Product: libxml2
Classification: Platform
Component: general
2.4.13
Other Windows
: Normal major
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2002-01-25 01:00 UTC by alberts
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description alberts 2002-01-25 01:00:20 UTC
Windows NT 4sp3
libxml2 version 2.4.13
MSVC++ 5.0
Compiled with the Debug Configuration:

Parse the following instance with xmlParseFile then dump with 
xmlDocDumpMemory:

<?xml version="1.0" ?>
<PIBX>
  <PIB name="Me">
    <ACCOUNT name="monster.com">
      <LoginUrl>http://my.monster.ca/login.asp</LoginUrl>
      <UserName>flysolo99</UserName>
      <Password>bigsecret</Password>
    </ACCOUNT>
  </PIB>
</PIBX>

No libxml2 code was changed except xmlwin32version.h which is
set up as follows:

#if 0
#define WITH_TRIO
#else
#define WITHOUT_TRIO
#endif

#if 0
#define LIBXML_THREAD_ENABLED
#endif

#if 0
#define LIBXML_FTP_ENABLED
#endif

#if 0
#define LIBXML_HTTP_ENABLED
#endif

#if 1
#define LIBXML_HTML_ENABLED
#endif

#if 0
#define LIBXML_CATALOG_ENABLED
#endif

#if 0
#define LIBXML_DOCB_ENABLED
#endif

#if 0
#define LIBXML_XPATH_ENABLED
#endif

#if 0
#define LIBXML_XPTR_ENABLED
#endif

#if 0
#define LIBXML_XINCLUDE_ENABLED
#endif

#if 0
#define LIBXML_ICONV_ENABLED
#endif

#if 1
#define LIBXML_DEBUG_ENABLED
#endif

#if 1
#define DEBUG_MEMORY_LOCATION
#endif
Comment 1 alberts 2002-01-25 03:27:16 UTC
It crashes with xmlDocDump too.
Comment 2 Daniel Veillard 2002-01-25 11:29:14 UTC
I can't reproduce it on Linux:
orchis:~/XML -> ./xmllint --memory tst.xml 
<?xml version="1.0"?>
<PIBX>
  <PIB name="Me">
    <ACCOUNT name="monster.com">
      <LoginUrl>http://my.monster.ca/login.asp</LoginUrl>
      <UserName>flysolo99</UserName>
      <Password>bigsecret</Password>
    </ACCOUNT>
  </PIB>
</PIBX>
orchis:~/XML -> ./xmllint tst.xml 
<?xml version="1.0"?>
<PIBX>
  <PIB name="Me">
    <ACCOUNT name="monster.com">
      <LoginUrl>http://my.monster.ca/login.asp</LoginUrl>
      <UserName>flysolo99</UserName>
      <Password>bigsecret</Password>
    </ACCOUNT>
  </PIB>
</PIBX>
orchis:~/XML -> 

  Does the xmllint test fails on your setup ?
    - if no the bug is in your code
    - if yes contact the maintainer of the Windows port
      Igor on the list, there is nothing I can do about it

Daniel
Comment 3 Daniel Veillard 2002-01-25 11:32:07 UTC
It is probably related to the use of the memory debug wrapper
#if 1
#define LIBXML_DEBUG_ENABLED
#endif

#if 1
#define DEBUG_MEMORY_LOCATION
#endif

  Try switching them off, I have no idea if this may work with
Windows or DLL.

  Again the best to get help on Windows specific issues is
join the list and ask there.

Daniel
Comment 4 alberts 2002-01-26 19:14:28 UTC
-xmllint doesn't build cleanly and I don't have time now to figure out 
why.

How could there be a bug in my code:
  xmlDocPtr docptr;
  docptr = xmlParseFile("test.pibx");
  if (docptr == NULL) return 0;
  printf("got here!\n");
  xmlDocDump( stdout, docptr);

My XML instance is so small it is also obviously valid by visual 
inspection.

I'm pressed for time so my plan of attack is to write my own instance 
specific serializer since the in memory representation of my instance 
seems valid.

I tried it with with the memory debug wrapper both on and off with the 
same result.  I may join the windows list later when I have more time.

Comment 5 Daniel Veillard 2002-01-26 20:26:46 UTC
I bet your code is correct, that it would crash with any XML
instance, and thus that the problem lies somewhere else which
I have no way to debug since it's tied to your platform which
I don't and can't support directly ! Igor is the person doing
the Windows build. I don't want to debug them, I have no way
to do this. Use his binary, check if there is the same
error, if not blame your vompilation environment, if yes send 
him or the list a report.

Daniel
Comment 6 Daniel Veillard 2002-02-12 08:37:58 UTC
No more input, I think this is closed.

Daniel