This project is archived and is in readonly mode.

#74 ✓resolved
flox

segfault reading isolation_level on closed connection

Reported by flox | November 4th, 2011 @ 11:51 PM

It happens with version 2.4.2 (from PyPI) on Ubuntu x86_64.

dsn = 'host=127.0.0.1 port=xxxxx user=xxxxxx password=xxxxxx dbname=xxxxxx'
import psycopg2 as pg
print pg.__version__
cnx = pg.connect(dsn=dsn)
cnx.close()
cnx.isolation_level

Output:

  2.4.2 (dt dec pq3 ext)
  Segmentation fault

Comments and changes to this ticket

  • flox

    flox November 4th, 2011 @ 11:52 PM

    >>> sys.version
    '2.6.6 (r266:84292, Sep 15 2010, 16:22:56) \n[GCC 4.4.5]'
    
  • flox

    flox November 6th, 2011 @ 01:36 AM

    Seems fixed with the @devel branch.

    
    >>> 
    >>> import psycopg2 as pg
    >>> print pg.__version__
    2.4.3.dev0 (dt dec pq3 ext)
    >>> cnx = pg.connect(dsn=dsn)
    >>> cnx.close()
    >>> cnx.isolation_level
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    psycopg2.OperationalError: connection pointer is NULL
    
    >>>
    
  • Daniele Varrazzo

    Daniele Varrazzo November 16th, 2011 @ 10:04 AM

    • State changed from “new” to “open”

    Yes, but there is still a missing check somewhere: it needs a better message. Thanks for reporting.

  • Daniele Varrazzo

    Daniele Varrazzo November 16th, 2011 @ 11:58 PM

    • State changed from “open” to “resolved”

    Bug fixed, added proper check for connection closed, thank you for the report.

    By the way, sorry for having made you wait 10 days: I don't receive email notification for new tickets opened by Lighthouse users, but I receive them from bugs open on the web interface. I've reported the issue one year ago (http://help.lighthouseapp.com/discussions/problems/2122-email-notif...) but it hasn't been fixed yet.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins

Pages