Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > dl + getenv (without arguments) = segfault (python2.p2, python2.3)

Reply
Thread Tools

dl + getenv (without arguments) = segfault (python2.p2, python2.3)

 
 
Xavier
Guest
Posts: n/a
 
      08-06-2003
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.
>>> import dl
>>> a=dl.open('libc.so.12.83.1')
>>> print a.call('getenv')

0

#2
sabu@culprit:/root$ python
Python 2.2.3+ (#1, Jul 5 2003, 11:04:1
[GCC 3.3.1 20030626 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dl
>>> a=dl.open('libc.so.6')
>>> print a.call('getenv')

Segmentation fault
sabu@culprit:/root$

#3
root@tixdev:~# python2.2
Python 2.2.3+ (#1, Jul 5 2003, 11:04:1
[GCC 3.3.1 20030626 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dl
>>> a=dl.open('libc.so.6')
>>> print a.call('getenv')

Segmentation fault
root@tixdev:~#

--Xavier.











 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
invoking a segfault within a segfault handler - is this undefinedbehavior? Andrey Vul C Programming 8 07-30-2010 02:14 PM
To getenv or not getenv lordy Java 2 07-28-2006 07:48 PM
Is there a getEnv(String string) method in javax.servlet.http package? RC Java 1 07-07-2005 03:49 PM
setuid() and getenv()? vertigo Perl 1 07-17-2004 08:32 AM
Re: dl + getenv (without arguments) = segfault (python2.p2, python2.3) Skip Montanaro Python 1 08-07-2003 07:19 AM



Advertisments