-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Reproducible segfault reading python-written xlsx #928
Comments
I did a little bit of digging out of curiosity, looks like it happens here: if (get_conf_int("xlsx_readformulas") &&
// dont handle shared formulas right now
! (xmlHasProp(child_node->xmlChildrenNode, (xmlChar *) "t") &&
! strcmp((shared = (char *) xmlGetProp(child_node->xmlChildrenNode, (xmlChar *) "t")), "shared"))
) and the problem is that xlsx generated by pandas is lacking "t=" attribute. If opened/saved by excel, and compared two XMLs, the "t=" attribute appears. So, on pandas-generated xls the xmlGetProp return NULL, and strcmp shits the bed. I can't compile on my machine to verify tho. |
Thank you @earthshrink. WIll check this out. |
andmarti1424
added a commit
that referenced
this issue
Feb 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Synopsis
Sc-im
segfaults on .xlsx files generated or updated usingopenpyxl
python library. The generated .xlsx files are "legal" in the sense that Gnumeric, LibreOffice and Google Sheets have no issues reading them.Steps to reproduce
Python test script
Execution
Save and run the python test script. Verify that the generated file
foo.xlsx
loads in Gnumeric, LibreOffice and in Google Sheets.Run:
sc-im --quit_afterload --nocurses foo.xlsx
- this will segfault.If run under
gdb
(or with C stacktrace library using-ldynamic
in Makefile), the following stacktrace is produced:Workaround
Gnumeric's
ssconvert
seems to fix the generated file such thatsc-im
is able to read without segfault.Run:
ssconvert foo.xlsx bar.xlsx
.With this test file,
ssconvert
generates a warning but bar.xlsx opens insc-im
without segfault. I do not get this warning with some larger spreadsheets I was working with, but the behaviour is the same, viz segfault on the generated or updated file and no segfault afterssconvert
.The text was updated successfully, but these errors were encountered: