Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue3313] dlopen() error with no error message from dlerror()

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 7, 2008, 6:24 AM

Post #1 of 4 (128 views)
Permalink
[issue3313] dlopen() error with no error message from dlerror()

New submission from STINNER Victor <haypo[at]users.sourceforge.net>:

Python dl_open() function (from dl module) calls dlopen() and check
its result: if it's NULL, it's an error. This is correct if I read the
man page. But with an invalid flag value (-1), dlopen() returns NULL
but dlerror() also gives a NULL pointer. Example:

>>> import dl
>>> dl.open("/usr/lib/libm.so", -1)
Erreur de segmentation (core dumped)

Workaround: use a static error message if dlerror() returns NULL.

I wrote a patch for dl_open() but other functions (in ctypes module?)
should also call dlerror().

----------
components: Library (Lib)
files: dl_open.patch
keywords: patch
messages: 69388
nosy: haypo
severity: normal
status: open
title: dlopen() error with no error message from dlerror()
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file10842/dl_open.patch

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3313>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 8, 2008, 6:45 AM

Post #2 of 4 (114 views)
Permalink
[issue3313] dlopen() error with no error message from dlerror() [In reply to]

STINNER Victor <haypo[at]users.sourceforge.net> added the comment:

As expected, the bug can be reproduced with ctypes.dlopen().
py_dl_open() function of Modules/_ctypes/callproc.c should be merged
with Modules/dlmodule.c.

Here use at least the attached patch for ctypes (same job than the
other patch: use default string if dlerror() returns NULL).

Added file: http://bugs.python.org/file10858/ctypes_dlopen.patch

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3313>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 15, 2008, 11:35 AM

Post #3 of 4 (103 views)
Permalink
[issue3313] dlopen() error with no error message from dlerror() [In reply to]

Thomas Heller <theller[at]ctypes.org> added the comment:

I can confirm the problem on ubuntu linux.

----------
assignee: -> theller
nosy: +theller

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3313>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 15, 2008, 12:50 PM

Post #4 of 4 (101 views)
Permalink
[issue3313] dlopen() error with no error message from dlerror() [In reply to]

Thomas Heller <theller[at]ctypes.org> added the comment:

Thanks for the patch, fixed in trunk rev 64977 and py3k rev 64978.

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3313>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.