[NumPy-Tickets] [NumPy] #1632: test_structured_arrays_with_objects2 fails with too high refcounts due to gcc 4.5.x bug
NumPy Trac
numpy-tickets@scipy....
Mon Oct 11 11:23:10 CDT 2010
#1632: test_structured_arrays_with_objects2 fails with too high refcounts due to
gcc 4.5.x bug
--------------------+-------------------------------------------------------
Reporter: nics | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 1.5.1
Component: Other | Version: 1.5.0
Keywords: |
--------------------+-------------------------------------------------------
Old description:
> Hi everybody,
>
> this isn't really a numpy bug but numpy is affected by a gcc bug (that is
> UNCONFIRMED right now) I've found while debugging the following numpy
> testsuite failer:
>
> ======================================================================
> FAIL: Ticket #1299 second test
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File
> "/pf/m/m222086/xas/solaris10/python2/python-2.7-ve0-gcc/lib/python2.7/sit
> e-packages/numpy/core/tests/test_regression.py", line 1255, in
> test_structured_a
> rrays_with_objects2
> assert sys.getrefcount(strb) == numb
> AssertionError:
> 7 = <module 'sys' (built-in)>.getrefcount('aaaa')
> array([[(0L, 'aaaa'), (0L, 'aaaa')]],
> dtype=[('f0', '>i8'), ('f1', '|O4')]) = <module 'numpy' from
> '/pf/m/m2
> 22086/xas/solaris10/python2/python-2.7-ve0-gcc/lib/python2.7/site-
> packages/numpy
> /__init__.pyc'>.array([[(0,'aaaa'),(1,'bbbb')]], 'i8,O')
> >> array([[(0L, 'aaaa'), (0L, 'aaaa')]],
> dtype=[('f0', '>i8'), ('f1', '|O4')])[array([[(0L, 'aaaa'),
> (0L, 'aaaa
> ')]],
> dtype=[('f0', '>i8'), ('f1', '|O4')]).nonzero()] = array([[(0L,
> 'aaaa'
> ), (0L, 'aaaa')]],
> dtype=[('f0', '>i8'), ('f1', '|O4')]).ravel()[:1]
> assert <module 'sys' (built-in)>.getrefcount('bbbb') == 7
> assert <module 'sys' (built-in)>.getrefcount('aaaa') == 7 + 2
>
> You'll find the gcc bug here:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45967
>
> Maybe we just wait for what the gcc people say about this issue; in the
> meanwhile you can use the attached patch against numpy-1.5.0 that fixes
> that issue with a workaround. The workaround isn't very clear code (and
> not commented ;) and thus, it either shouldn't be applied to the main
> branch at all or at least it should be removed again as soon as the issue
> has been fixed in gcc (again: if it is really a gcc bug).
>
> Wishes
>
> Nicolai
New description:
Hi everybody,
this isn't really a numpy bug but numpy is affected by a gcc bug (that is
UNCONFIRMED right now) I've found while debugging the following numpy
testsuite failer:
{{{
======================================================================
FAIL: Ticket #1299 second test
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/pf/m/m222086/xas/solaris10/python2/python-2.7-ve0-gcc/lib/python2.7/sit
e-packages/numpy/core/tests/test_regression.py", line 1255, in
test_structured_a
rrays_with_objects2
assert sys.getrefcount(strb) == numb
AssertionError:
7 = <module 'sys' (built-in)>.getrefcount('aaaa')
array([[(0L, 'aaaa'), (0L, 'aaaa')]],
dtype=[('f0', '>i8'), ('f1', '|O4')]) = <module 'numpy' from
'/pf/m/m2
22086/xas/solaris10/python2/python-2.7-ve0-gcc/lib/python2.7/site-
packages/numpy
/__init__.pyc'>.array([[(0,'aaaa'),(1,'bbbb')]], 'i8,O')
>> array([[(0L, 'aaaa'), (0L, 'aaaa')]],
dtype=[('f0', '>i8'), ('f1', '|O4')])[array([[(0L, 'aaaa'), (0L,
'aaaa
')]],
dtype=[('f0', '>i8'), ('f1', '|O4')]).nonzero()] = array([[(0L,
'aaaa'
), (0L, 'aaaa')]],
dtype=[('f0', '>i8'), ('f1', '|O4')]).ravel()[:1]
assert <module 'sys' (built-in)>.getrefcount('bbbb') == 7
assert <module 'sys' (built-in)>.getrefcount('aaaa') == 7 + 2
}}}
You'll find the gcc bug here:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45967
Maybe we just wait for what the gcc people say about this issue; in the
meanwhile you can use the attached patch against numpy-1.5.0 that fixes
that issue with a workaround. The workaround isn't very clear code (and
not commented ;) and thus, it either shouldn't be applied to the main
branch at all or at least it should be removed again as soon as the issue
has been fixed in gcc (again: if it is really a gcc bug).
Wishes
Nicolai
--
Comment(by pv):
Thanks for the sleuthing!
I think it might be best to not include workarounds for compiler bugs,
especially ones that affect only non-X86 platforms. But I'm not 100% sure
whether this is the correct choice, as PPC (which IIRC also requires
pointer alignment) is semi-common thanks to Apple computers.
We probably should nevertheless mention this GCC bug in the 1.5.1 release
notes.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1632#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list