Greetings,
While messing around with the "dl" module I ran into a segfault.
*DO NOTE THAT THE FOLLOWING OCCURED ON 2 OF MY LINUX WORKSTATIONS*
------
# python -c 'import dl; a=dl.open("libc .so.6"); print a.call("getenv" )'
or while in the interpreter:
import dl
a=dl.open("libc .so.6")
print a.call("getenv" )
------
After discussing the issue with a counterpart, and thinking logically in
the case of getenv(const char *name) -- the call segfaults because of the
missing *name, variable. Now, my problem is not with the obvious.. but
with the fact that Python segfaulted instead of raising an exception or
returning 0 (in the case of my netbsd box with: Python 2.3 (#1, Aug 6
2003, 00:29:47)//[GCC 2.95.3 20010315 (release) (NetBSD nb3)] on netbsd1).
Thanks, and sorry if this issue has been brought up already.
Here is the full log from all 3 machines I tested it on:
#1
--> python
Python 2.3 (#1, Aug 6 2003, 00:29:47)
[GCC 2.95.3 20010315 (release) (NetBSD nb3)] on netbsd1
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>> import dl
>>> a=dl.open('libc .so.12.83.1')
>>> print a.call('getenv' )[/color][/color][/color]
0
#2
sabu@culprit:/root$ python
Python 2.2.3+ (#1, Jul 5 2003, 11:04:18)
[GCC 3.3.1 20030626 (Debian prerelease)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>> import dl
>>> a=dl.open('libc .so.6')
>>> print a.call('getenv' )[/color][/color][/color]
Segmentation fault
sabu@culprit:/root$
#3
root@tixdev:~# python2.2
Python 2.2.3+ (#1, Jul 5 2003, 11:04:18)
[GCC 3.3.1 20030626 (Debian prerelease)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>> import dl
>>> a=dl.open('libc .so.6')
>>> print a.call('getenv' )[/color][/color][/color]
Segmentation fault
root@tixdev:~#
--Xavier.
While messing around with the "dl" module I ran into a segfault.
*DO NOTE THAT THE FOLLOWING OCCURED ON 2 OF MY LINUX WORKSTATIONS*
------
# python -c 'import dl; a=dl.open("libc .so.6"); print a.call("getenv" )'
or while in the interpreter:
import dl
a=dl.open("libc .so.6")
print a.call("getenv" )
------
After discussing the issue with a counterpart, and thinking logically in
the case of getenv(const char *name) -- the call segfaults because of the
missing *name, variable. Now, my problem is not with the obvious.. but
with the fact that Python segfaulted instead of raising an exception or
returning 0 (in the case of my netbsd box with: Python 2.3 (#1, Aug 6
2003, 00:29:47)//[GCC 2.95.3 20010315 (release) (NetBSD nb3)] on netbsd1).
Thanks, and sorry if this issue has been brought up already.
Here is the full log from all 3 machines I tested it on:
#1
--> python
Python 2.3 (#1, Aug 6 2003, 00:29:47)
[GCC 2.95.3 20010315 (release) (NetBSD nb3)] on netbsd1
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>> import dl
>>> a=dl.open('libc .so.12.83.1')
>>> print a.call('getenv' )[/color][/color][/color]
0
#2
sabu@culprit:/root$ python
Python 2.2.3+ (#1, Jul 5 2003, 11:04:18)
[GCC 3.3.1 20030626 (Debian prerelease)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>> import dl
>>> a=dl.open('libc .so.6')
>>> print a.call('getenv' )[/color][/color][/color]
Segmentation fault
sabu@culprit:/root$
#3
root@tixdev:~# python2.2
Python 2.2.3+ (#1, Jul 5 2003, 11:04:18)
[GCC 3.3.1 20030626 (Debian prerelease)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>> import dl
>>> a=dl.open('libc .so.6')
>>> print a.call('getenv' )[/color][/color][/color]
Segmentation fault
root@tixdev:~#
--Xavier.