RE: [xml] Memory lacks using XMLLIB under MPE OS

Date view Thread view Subject view Author view

From: Grasso Massimiliano (Massimiliano.Grasso@elsag.it)
Date: Fri Oct 13 2000 - 06:26:10 EDT


Hi Daniel,
thanks for your suggestions. Now we're trying to use the library memory
debug, but we have an error using xmlMemoryDump:
---------------------------------
      MEMORY ALLOCATED : 788, MAX was 32751
BLOCK NUMBER SIZE TYPE
0 342 2 malloc() in PARSER1.LIBXMLC.SERINO(2641) "&"
1 341 4 malloc() in PARSER1.LIBXMLC.SERINO(2641) "amp"
2 340 60 malloc() in ENTITIES.LIBXMLC.SERINO(119) pointer to
#341 a
t index 8
                                        ......
12 330 2 malloc() in PARSER1.LIBXMLC.SERINO(2641) "<"
13 329 3 malloc() in PARSER1.LIBXMLC.SERINO(2641) "lt"
14 328 60 malloc() in ENTITIES.LIBXMLC.SERINO(119) pointer to
#329 a
t index 8
15 327 128 malloc() in ENTITIES.LIBXMLC.SERINO(1036) pointer to
#328
at index 0
**** Data memory protection trap (TRAPS 68).

So, at the same time, we're going to get in some other way the map of all
pointers that are allocated, reallocated and free; doing that we hope to
understand where the problem is. At the moment seems that:
- some pointers are not deallocated
- the library try to deallocate pointers never allocated

I'm sorry but at the moment I can't send you the patch, for two reasons:
- the library was not modified to be portable also in MPE; with our changes
the library works only under mpe... (not too smart, I know)
- our changes are not fully tested; in other words i'm not sure that the
only problem is the one of memory.
Below I write something about the problems that you find if you try to
compile and use XMLLIB under MPE:
- filename max 8 char
- filename without extension (so you must put all the header file in a
directory, the source file in another directory, then define 'file
equations' to get matching the files and their logical names in the sources)
- you have only one level of directory
- the maximum length of a line inside a file that you want to compile is 80
char
- you must write the system routine 'getcwd()', that don't exist under MPE

I'll send you news about the patches and the solution of my problem as soon
as I can.

Massimiliano

-----Original Message-----
From: Daniel Veillard [mailto:Daniel.Veillard@w3.org]
Sent: giovedì 12 ottobre 2000 10.42
To: xml@rpmfind.net
Cc: Bovone Stefano
Subject: Re: [xml] Memory lacks using XMLLIB under MPE OS

  Hi Grasso,

On Thu, Oct 12, 2000 at 10:23:22AM +0200, Grasso Massimiliano wrote:
>
> We're trying to use the XML library under the OS MPE 5.5 of HP 3K
> calculators. To compile the sources we had to write some system routines
(),
> non existent under MPE.

  Hum, send the patches, If I need to define an level of abstraction
from the OS this may help (like getting WIN CE patches).

> In our applicaton we have a loop and for each iteration we perform a
parsing
> and a validation of a very simple XML syntax. In lines below there is a
> little sample of the source that we have written:
>
[...]
  The code seems to indicate that your don't modify the doc tree with
memory allocated outside libxml so the debugging approach given below
seems doable.

>
> When we checked the memory allocated for the process we discovered that it
> was increasing at each iteration. Perhaps our problem is in the use of
> deallocation routines? Do someone use in the same way the library under
> other OS without problems? In the latest case probably the problem could
be
> either in our porting or in the OS itself.
> Thank a lot for help, sorry for English...

  Hum, the best is to enable libxml memory debug, and call xmlMemoryDump();
before exit (like I do in xmllint.c) . If the memory debug is turned on,
all memory blocks allocated by libxml and not freed by libxml will be
saved in a .memdump file. This may help a lot finding where the problem
lies. All my regression checks are done with this enabled and check that
there is 0 memory left allocated at the end of the execution, but depending
on the combination of calls I may have forgot something.
  To enable the memory tracing, enable DEBUG_MEMORY_LOCATION in xmlversion.h
and compile xmlmemory.c in, the simplest is to configure with
--with-mem-debug

Daniel

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


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Oct 13 2000 - 09:43:50 EDT