473,396 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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:18)
[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:18)
[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.



Jul 18 '05 #1
0 1780

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Chad Paquette | last post by:
Hi, We have a legacy cgi app that's written in C. We are encountering an error when we try to retrieve a cgi environment variable. The variable we are getting contains a Base64 encoded...
10
by: Protoman | last post by:
What does getenv() do and why would you use it?
5
by: anuragmenon | last post by:
Hello, Trying to debug a weird problem here. When I run this program many times over, at some point argc gets corrupted and I get the error that enough number of arguments are not provided. It...
5
by: silrandir | last post by:
when attempting to call getenv() in global memory (c/c++), it constantly returns null, but when called in main, it properly reads the environment. is this expected behavior? sample code:...
4
by: Yogi Watcher | last post by:
Hi, Recently I have observed some odd behavior of getenv and putenv function. I am developing some code that integrates with several other libraries. This program is not using MFC. It is plain C...
9
by: Gerard Kramer | last post by:
Presently I have some difficulties with the following type of code which is understandably causing a segfault: //---- begin code ---- #include <valarray> #include <iostream> using...
4
by: klappnase | last post by:
Hello, I use the tktreectrl Tk extension (http://tktreectrl.sourceforge.net) through the python wrapper module (http://klappnase.zexxo.net/TkinterTreectrl/index.html). With python-2.5 it seems...
35
by: erik gartz | last post by:
Hi. I'd like to be able to write a loop such as: for i in range(10): pass but without the i variable. The reason for this is I'm using pylint and it complains about the unused variable i. I can...
2
by: Magdoll | last post by:
Has anyone run into the same problem I have? I used to run matplotlib with Python2.5 and everything worked fine. Now I use Python2.6, and everything falls apart. I installed numpy, libpng, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.