On 3/19/07, Carlos Valiente <[EMAIL PROTECTED]> wrote:
On my -CURRENT amd64 system, Python 2.5 (installed from packge file python-2.5p3.tgz on 14 Mar 2007) is segfaulting within an installed module (the PostgreSQL Python driver from http://www.initd.org/tracker/psycopg/wiki/PsycopgTwo). The crash happens in line 175 of this function of the PostgreSQL Python driver:166: static PyObject * 167: qstring_str(qstringObject *self) 168: { 169: Dprintf("qstring_str: self: %p", self); 170: if (self->buffer == NULL) { 171: qstring_quote(self); 172: Dprintf("qstring_str: self: %p", self); 173: 174: Dprintf("qstring_str: About to bomb..."); 175: Dprintf("qstring_str: self->buffer: %p", self->buffer); 176: } 177: Py_XINCREF(self->buffer); 178: return self->buffer; 179: } Before the call to qstring_quote(), self is not NULL (I get values like 0x49f487e0). After the call, however, self is NULL. The GCC flags used to compile and link that code include -O2. When I manually compile and link that code with -O0, however, things work as expected. Is GCC the culprit of this problem, or should I keep on looking somewhere else?
"with -O0, however, things work as expected." I think you've answered your own question. I compliment you on your very detailed bug hunting. -Nick

