visit_decref: Assertion `gc->gc.gc_refs != 0' failed.

A

alexLIGO

Hi,

I got this error when trying to execute the following python command
with in a C module: Py_BuildValue

Do anyone have any idea what this error is about?
And does anyone have any idea how to debug a python script?

Thanks
Alexander
 
M

Michael Hudson

alexLIGO said:
Hi,

I got this error when trying to execute the following python command
with in a C module: Py_BuildValue

You get that error immediately on calling that function?
Do anyone have any idea what this error is about?

You've probably got your refcounting wrong somewhere.

Cheers,
mwh
 
T

Tim Peters

[alexLIGO]
I got this error when trying to execute the following python command
with in a C module: Py_BuildValue

Do anyone have any idea what this error is about?

Just the comment on the failing assert:

assert(gc->gc.gc_refs != 0); /* else refcount was too small */

There are more pointers to the object than the object's reference
count says there are. That's fatally bad. Probably due to a missing
Py_INCREF, possibly due to an "extra" Py_DECREF.
And does anyone have any idea how to debug a python script?

You need to debug C code here, not Python code. It's unlikely that
the problem is in C code that ships with Python; it's far more likely
to be in your C code, or in C code from a third-party extension
module.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top