Skip to content

Random seg fault with groupby #2113

@leonbaum

Description

@leonbaum

I came across this seg fault when I was trying to figure out the syntax to get column means. The below example triggers the seg fault, but strangely only about 30% of the time. About 10% of the time I get a reasonable error. The randomness of the result is very strange to me because the same command was run every time!

I am using the latest pandas and numpy from git. I have ECC memory and have never seen any hardware triggered issues.

$ python
Python 3.2.2 (default, Mar  9 2012, 14:43:22)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> pandas.DataFrame({'x': [1,2,3], 'y': [3,4,5]}).groupby(level=0, axis='columns').mean()
Segmentation fault

$ python
Python 3.2.2 (default, Mar  9 2012, 14:43:22)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> pandas.DataFrame({'x': [1,2,3], 'y': [3,4,5]}).groupby(level=0, axis='columns').mean()
   0  1  2
x  1  2  3
y  3  4  5
>>> pandas.DataFrame({'x': [1,2,3], 'y': [3,4,5]}).groupby(level=0, axis='columns').mean()
   0  1  2
x  1  2  3
y  3  4  5
>>> pandas.DataFrame({'x': [1,2,3], 'y': [3,4,5]}).groupby(level=0, axis='columns').mean()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.2/site-packages/pandas-0.9.1.dev_ebcbd33-py3.2-linux-x86_64.egg/pandas/core/generic.py", line 134, in groupby
    sort=sort, group_keys=group_keys)
  File "/usr/local/lib/python3.2/site-packages/pandas-0.9.1.dev_ebcbd33-py3.2-linux-x86_64.egg/pandas/core/groupby.py", line 481, in groupby
    return klass(obj, by, **kwds)
  File "/usr/local/lib/python3.2/site-packages/pandas-0.9.1.dev_ebcbd33-py3.2-linux-x86_64.egg/pandas/core/groupby.py", line 146, in __init__
    grouper, exclusions = _get_grouper(obj, keys, axis=axis,
IndexError: tuple index out of range
>>> pandas.DataFrame({'x': [1,2,3], 'y': [3,4,5]}).groupby(level=0, axis='columns').mean()
Segmentation fault

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions