Skip to content

BUG: read_csv segfault #5664

Closed
Closed
@dsm054

Description

@dsm054

Came across this when trying to parse a poorly-formatted csv file and got the number of columns wrong. Mostly it segfaults; sometimes it produces a broken last row.

>>> import pandas as pd
>>> from StringIO import StringIO
>>> pd.__version__
'0.13.0rc1-43-g4f9fefc'
>>> 
>>> f = StringIO('1,1,1,1,0\n'*2 + '\n'*2)
>>> df = pd.read_csv(f,names=list("abcd"))
Segmentation fault (core dumped)

When it doesn't segfault it tends to produce

      a   b   c    d
 1    1   1   1    0
 1    1   1   1    0
NaN NaN NaN NaN  NaN
NaN NaN NaN NaN  [unicode box: 0 0 0 1]

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