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

Discussion in 'Python' started by Xavier, Aug 6, 2003.

  1. Xavier

    Xavier Guest

    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.
    Xavier, Aug 6, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vertigo

    setuid() and getenv()?

    vertigo, Jul 16, 2004, in forum: Perl
    Replies:
    1
    Views:
    688
    Joe Smith
    Jul 17, 2004
  2. Skip Montanaro
    Replies:
    1
    Views:
    432
    Thomas Heller
    Aug 7, 2003
  3. lordy

    To getenv or not getenv

    lordy, Jul 28, 2006, in forum: Java
    Replies:
    2
    Views:
    4,798
    lordy
    Jul 28, 2006
  4. Magdoll
    Replies:
    2
    Views:
    235
    Magdoll
    Nov 17, 2008
  5. Andrey Vul
    Replies:
    8
    Views:
    683
    Richard Bos
    Jul 30, 2010
Loading...

Share This Page