-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
bug in dataframe.to_json causing segfault with 0.16.0 #9781
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
Comments
pls show the original frame and its programatic construction. need to establish that this is not a result of something else. |
I don't think I can show you its programmatic construction. n [6]: df.info() I have not been able to construct a dataframe on my own that exhibits this problem. |
Here's a repro. Multi-dtype but empty columns.
|
Excellent! Thanks! |
Fixed by #9805. |
calling to_json on an apparently empty dataframe may segfault.
using the same dataframe with 0.15.2 works.
A git bisect says that commit a67bef4 is when the problem first appeared.
segfault:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fd42aae8735 in PdBlock_iterBegin (_obj=0x7fd423d22410, tc=0x7fff1bf57310) at pandas/src/ujson/python/objToJSON.c:1057
(gdb) list
1052 // init a dedicated context for this column
1053 NpyArr_iterBegin(obj, tc);
1054 npyarr = GET_TC(tc)->npyarr;
1055
1056 // set the dataptr to our desired column and initialise
1057 npyarr->dataptr += npyarr->stride * idx;
1058 NpyArr_iterNext(obj, tc);
1059 GET_TC(tc)->itemValue = NULL;
1060 ((PyObjectEncoder*) tc->encoder)->npyCtxtPassthru = NULL;
1061
Following is the test code and ascii-pickle file that reproduces the behavior:
below is the pickled dataframe that causes the problem.
(I've been unable to construct another dataframe that exhibits this behavior)
The text was updated successfully, but these errors were encountered: