[reportlab-users] Chasing pyHnj error

Dinu Gherman gherman at darwin.in-berlin.de
Sun Nov 25 05:52:15 EST 2007


Robin Becker:


> The error when a bad file name is passed in (or the default fails)

> is caused by failing to set an error message in the Hyphen

> function. The error return also fails to remove the allocated memory.

>

> I changed the code at line 222 so it looks like

>

> if((self->hdict = hnj_hyphen_load(filename)) == NULL){

> PyErr_Format(PyExc_IOError,"Failed to load hyphenization

> information from \"%s\"", filename);

> Py_DECREF(self);

> return NULL;

> }

>

> that should clean up the allocation automatically. I have checked

> in that version. See if it works.


Thanks for the effort! Testing this on my Mac Book Pro, now running
Mac OS 10.4.11 shows this funny unchanged behviour below. Seems like
I don't even need to specify a hyphenation file, BTW...

Regards,

Dinu


Python 2.5.1 (r251:54863, Oct 5 2007, 13:55:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import pyHnj
>>> pyHnj.__file__
'/usr/local/lib/python2.5/site-packages/pyHnj.so'
>>> h = pyHnj.Hyphen("hyphen.mashed")
>>> h.hyphenate("hyphenation")
'hy-phen-ation'
>>> h = pyHnj.Hyphen("hyphen.mashed")
python2.5(427) malloc: *** Deallocation of a pointer not malloced:
0x5450b0; This could be a double free(), or free() called with the
middle of an allocated block; Try setting environment variable
MallocHelp to see tools to help debug
>>> h.hyphenate("hyphenation")
'hy-phen-ation'
>>>
>>> ^D
python2.5(427) malloc: *** Deallocation of a pointer not malloced:
0x5450a0; This could be a double free(), or free() called with the
middle of an allocated block; Try setting environment variable
MallocHelp to see tools to help debug



Python 2.5.1 (r251:54863, Oct 5 2007, 13:55:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import pyHnj
>>> pyHnj.__file__
'/usr/local/lib/python2.5/site-packages/pyHnj.so'
>>> h = pyHnj.Hyphen()
>>> h.hyphenate("hyphenation")
'hy-phen-ation'
>>>
>>> ^D
python2.5(428) malloc: *** Deallocation of a pointer not malloced:
0x5450b0; This could be a double free(), or free() called with the
middle of an allocated block; Try setting environment variable
MallocHelp to see tools to help debug



Python 2.5.1 (r251:54863, Oct 5 2007, 13:55:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import pyHnj
>>> pyHnj.__file__
'/usr/local/lib/python2.5/site-packages/pyHnj.so'
>>> h = pyHnj.Hyphen()
>>> h.hyphenate("hyphenation")
'hy-phen-ation'
>>> h.hyphenate("information")
'in-for-ma-tion'
>>> h = pyHnj.Hyphen()
python2.5(429) malloc: *** Deallocation of a pointer not malloced:
0x5450b0; This could be a double free(), or free() called with the
middle of an allocated block; Try setting environment variable
MallocHelp to see tools to help debug
>>> ^D
python2.5(429) malloc: *** Deallocation of a pointer not malloced:
0x5450a0; This could be a double free(), or free() called with the
middle of an allocated block; Try setting environment variable
MallocHelp to see tools to help debug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071125/732011b4/attachment.htm>


More information about the reportlab-users mailing list