[xml] Re: libxml release 1.7.2 (bug?)

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Wed Sep 29 1999 - 04:21:24 EDT


On Tue, Sep 28, 1999 at 06:27:35PM +0200, Andrea LUCIANO wrote:
> Compiling the following lines, and running the executable results in a core dump:
>
> int size=0;
> unsigned char *buffer=NULL;
>
> xmlDocDumpMemory(doc,&buffer,&size);
>
> fprintf(stderr,"%s\n",buffer);
> free(buffer); // <----- a core dump!!!
> fprintf(stderr,"xxxxxxx\n");
>
> In libxml version 1.2 the same lines were OK. The problem arises calling the free on "buffer".

  Well, I cut and pasted your example in the "tester.c" program
and I didn't see the same problem happening. Use 1.7.1 or the version
in CVS, I applied a single line patch disabling memory debugging

Daniel

*** xmlmemory.h 1999/09/22 09:46:24 1.2
--- xmlmemory.h 1999/09/27 08:17:48 1.3
***************
*** 8,14 ****
  #ifndef _DEBUG_MEMORY_ALLOC_
  #define _DEBUG_MEMORY_ALLOC_
  
! /* #define NO_DEBUG_MEMORY */
  
  #ifdef NO_DEBUG_MEMORY
  #ifdef HAVE_MALLOC_H
--- 8,14 ----
  #ifndef _DEBUG_MEMORY_ALLOC_
  #define _DEBUG_MEMORY_ALLOC_
  
! #define NO_DEBUG_MEMORY
  
  #ifdef NO_DEBUG_MEMORY
  #ifdef HAVE_MALLOC_H

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux, WWW, rpmfind,
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | rpm2html, XML,
http://www.w3.org/People/W3Cpeople.html#Veillard | badminton, and Kaffe.
----
Message from the list xml@rufus.w3.org
Archived at : http://rufus.w3.org/veillard/XML/messages
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rufus.w3.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:29:47 EDT