Bug 467246 - python-tidy: the bindings are not 64bit safe
Summary: python-tidy: the bindings are not 64bit safe
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-tidy
Version: 9
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Terje Røsten
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-16 14:54 UTC by Jose Pedro Oliveira
Modified: 2008-10-30 12:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-10-30 12:49:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Fixes the pointer truncation (396 bytes, patch)
2008-10-16 14:58 UTC, Jose Pedro Oliveira
no flags Details | Diff

Description Jose Pedro Oliveira 2008-10-16 14:54:08 UTC
Description of problem:
The tidy python bindings aren't 64bit safes and cause segmentation faults under Apache/mod_python or Apache/mod_wsgi. 

Version-Release number of selected component (if applicable):
python-tidy-0.2-3

How reproducible:
Everytime that a mod_python (or mod_wsgi) script is executed.


Steps to Reproduce and Patch:

See the following tickets:
 * https://bugzilla.redhat.com/show_bug.cgi?id=466069
 * https://sourceforge.net/tracker2/index.php?func=detail&aid=2154022&group_id=27659&atid=390963

Comment 1 Jose Pedro Oliveira 2008-10-16 14:58:46 UTC
Created attachment 320563 [details]
Fixes the pointer truncation

This one-line patch fixes the pointer truncation and works for me in both 32 and 64 bit systems.

Comment 2 Jose Pedro Oliveira 2008-10-16 15:07:09 UTC
Changed the platform to x86_64 (but it mostly likely affects other 64bit systems)

Comment 3 Jose Pedro Oliveira 2008-10-16 15:12:29 UTC
One of the tidy maintainers also mentions an interface change that was made in 2006 that hasn't been synced into utidylib (the utidylib code is from 2004).

See the Arnaud's comments in the sourceforge tidy ticket mentioned above.

Comment 4 Jose Pedro Oliveira 2008-10-16 15:39:37 UTC
Bug report against utidylib:

* [ Bug #14691 ] bindings aren't 64bit safe
  http://developer.berlios.de/bugs/?func=detailbug&bug_id=14691&group_id=1810

Comment 5 Fedora Update System 2008-10-18 18:14:34 UTC
python-tidy-0.2-4.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/python-tidy-0.2-4.fc9

Comment 6 Fedora Update System 2008-10-18 18:14:37 UTC
python-tidy-0.2-4.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/python-tidy-0.2-4.fc8

Comment 7 Terje Røsten 2008-10-18 18:17:39 UTC
Thanks for the nice report!

Comment 8 Jose Pedro Oliveira 2008-10-19 02:56:58 UTC
Thanks for the new package release.

I still haven't looked up much into the 2006 tidy interface change
(http://tidy.cvs.sourceforge.net/viewvc/tidy/tidy/include/tidy.h?r1=1.14&r2=1.15)
mentioned in the sourceforge ticket.  Nevertheless I believe the "sinkData" field of the class _OuputSink needs to be modified (most likely to ctypes.POINTER(ctypes.c_void_p) )


Current definition:
...
class _OutputSink(ctypes.Structure):
    _fields_=[("sinkData", ctypes.c_int),
              ("putByte", PUTBYTEFUNC),
              ]
...

Comment 9 Jose Pedro Oliveira 2008-10-26 18:22:49 UTC
The messages in comments #5 and #6 are misleading: the new python-tidy packages have been submitted for *update testing* and not for update.

Comment 10 Fedora Update System 2008-10-30 12:49:51 UTC
python-tidy-0.2-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2008-10-30 12:50:13 UTC
python-tidy-0.2-4.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.