RE: [xml] python bindings initialization

  Yes this sounds like an interesting solution, but ... it
break in my regression tests. Basically I compile with 
enabled, i.e. all the memory is allocated, from the start, with
the memory debugging shell. Your trick seems to confuse something
somewhere, and all regression tests with python now fail with:
  paphio:~/XML/python/tests -> ./
  Memory leak -422 bytes

I.e. we end-up with a shifted memory count, there is 2 ways to 
solve this:
  - the unclean way: never report negative memory allocated memory
    and reset the base when it happens
  - find out about where that base shift comes from (probably the
    memory allocated with the debug memory routines when running 
    with memory debug - can probably be tested by checking the 
    existing memory routine before switching to debug) and account
    for it when reporting.

I think your trick solves the hardest part for users, but it would be
great if the problem for running the regressions tests in debug mode
could be solved. BTW there is also a serious problem with the 
debug mode
when running the libxslt python regression tests, the whole set 
(debug + libxml2 + libxslt + python) seems to completely confuse the
memory allocator (I assume it's something similar to the problem you
fixed), but it still happen with your patch in.

I probably won't be able to make the release before this week-end, 
could you have a look at those cornercases if you have time ?

Hm. I can't reproduce on windows. Any idea?
I put a breakpoint in xmlMemMalloc, and the first call
comes from xmlInitCharEncodingHandlers. But that is cleaned-up
nicely by the xmlCleanupParser, no no leak nor positive, nor negative.
Maybe I missed a #define: Igor's configures sets DEBUG_MEMORY_ALLOCATION,
is that correct? (I'd say yes having looked at globals.c, but...).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]