8000 importing umath_tests and then CTRL-D crashes with core dump (Trac #1425) · Issue #2023 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

importing umath_tests and then CTRL-D crashes with core dump (Trac #1425) #2023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thouis opened this issue Oct 19, 2012 · 10 comments
Closed

Comments

@thouis
Copy link
Contributor
thouis commented Oct 19, 2012

Original ticket http://projects.scipy.org/numpy/ticket/1425 on 2010-03-10 by @johannct, assigned to unknown.

[cohen@jarrett core]$ python

Python 2.6.2 (r262:71600, Jan 25 2010, 18:46:45) [GCC 4.4.2 20091222
(Red Hat 4.4.2-20)] on linux2 Type "help", "copyright", "credits" or
"license" for more information.

import umath_tests

python: Modules/gcmodule.c:277: visit_decref: Assertion `gc->gc.gc_refs
!= 0' failed.
Aborted (core dumped)

This occurs on my Fedora 12 box with python 2.6.2 and numpy 2.0.0.dev8291

@thouis thouis closed this as completed Oct 19, 2012
@numpy-gitbot
Copy link

@johannct wrote on 2010-03-10

backtrace of a python session that exhibits this crash:
(gdb) bt
#0 0x004a1416 in __kernel_vsyscall ()
#1 0x00609a91 in raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2 0x0060b35a in abort () at abort.c:92
#3 0x00602be8 in __assert_fail (assertion=,
file=, line=, function=)
at assert.c:81
#4 0x0032e31e in visit_decref (op=, data=) at Modules/gcmodule.c:277
#5 0x002a18c2 in dict_traverse (op=, visit=, arg=) at Objects/dictobject.c:2003
#6 0x0032eaf3 in subtract_refs (generation=) at
Modules/gcmodule.c:296
#7 collect (generation=) at Modules/gcmodule.c:817
#8 0x0032f640 in PyGC_Collect () at Modules/gcmodule.c:1292
#9 0x003200f0 in Py_Finalize () at Python/pythonrun.c:424
#10 0x00320218 in Py_Exit (sts=) at
Python/pythonrun.c:1714
#11 0x00320367 in handle_system_exit () at Python/pythonrun.c:1116
#12 0x0032057d in PyErr_PrintEx (set_sys_last_vars=) at Python/pythonrun.c:1126
#13 0x0032079f in PyErr_Print () at Python/pythonrun.c:1035
#14 0x00320f9a in PyRun_InteractiveOneFlags (fp=,
filename=, flags=) at
Python/pythonrun.c:843
#15 0x00321093 in PyRun_InteractiveLoopFlags (fp=,
filename=, flags=0xbfffefec) at Python/pythonrun.c:760
#16 0x003211df in PyRun_AnyFileExFlags (fp=,
filename=0x365add "", closeit=, flags=)
at Python/pythonrun.c:729
#17 0x0032dc85 in Py_Main (argc=, argv=) at Modules/main.c:599
#502 0x080485c8 in main (argc=, argv=) at Modules/python.c:23

@numpy-gitbot
Copy link

@pv wrote on 2010-03-10

More discussion here:
http://permalink.gmane.org/gmane.comp.python.numeric.general/36831

Current best guess: some sort of refcounting error in the generalized ufunc code, maybe?

@numpy-gitbot
Copy link

@bsouthey wrote on 2010-03-10

This occurred in changeset 8262, specifically in the file:
numpy/core/code_generators/generate_ufunc_api.py

The following line 54(?) should have be removed.
Py_DECREF(numpy);

@numpy-gitbot
Copy link

Attachment added by @bsouthey on 2010-03-10: generate_ufunc_api.diff

@numpy-gitbot
Copy link

@pv wrote on 2010-03-10

Nice sleuthing!

But things don't seem very straightforward at all here: the refcounting there in itself seems perfectly solid. Before fixing this, the reason for the failure should preferably be better understood, and explained as a comment in the code.

The issue seems to be something like this: when Python exits, it deallocates stuff. However, the numpy module is deallocated before some stuff that tries to use after deallocation -> bomb.

It might be a hint that the failure occurs only in umath_tests -- maybe there's something amiss there?

@numpy-gitbot
Copy link

Milestone changed to NumPy 2.0 by @pv on 2010-03-10

@numpy-gitbot
Copy link

@bsouthey wrote on 2010-03-10

It was an interesting and learning experience even if it was 99.99% trial and error! From the very little I understand, this defines the umath and ufunc APIs so it should occur with those tests.

Looking further, the line might just be out of place. When I look at the '#if PY_VERSION_HEX >= 0x03010000', I see two Py_DECREF(c_api); statements but only one 'Py_DECREF(numpy);' statement.

@numpy-gitbot
Copy link

@charris wrote on 2010-05-25

Pauli, I believe you fixed this in r8408.

@numpy-gitbot
Copy link

@charris wrote on 2010-05-25

I don't see this crash in recent svn, so I am closing the ticket. If there is still a problem reopen it.

@numpy-gitbot
Copy link

Milestone changed to 1.6.0 by @mwiebe on 2011-05-24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0