mashingan / excelin

Create and read Excel file purely in Nim
MIT License
51 stars 1 forks source link

SegFault on readExcel() #8

Closed nick133 closed 1 year ago

nick133 commented 1 year ago

I'm not sure it's an issue, anyways since v0.5.3 I get strange segfault (nim1.6.2):

Traceback (most recent call last)
/home/nick/xlstest/src/xlstest.nim(8) xlstest
/home/nick/.nimble/pkgs/excelin-0.5.3/excelin.nim(138) readExcel
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
zsh: segmentation fault (core dumped)  ./xlstest

and with nim 1.9.5 i've got:

Traceback (most recent call last)
/home/nick/xlstest/src/xlstest.nim(8) xlstest
/home/nick/.nimble/pkgs2/excelin-0.5.3-ec9c2b93c098d062d83c3706198e5f9047d68460/excelin/internal_utilities.nim(71) readExcel
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
zsh: segmentation fault (core dumped)  ./xlstest

the code is simply:

import excelin
let xl = readExcel("Test.xlsx")

xlsx file is empty, created with libreoffice, may be I'm doing something wrong, but cant guess what exactly

mashingan commented 1 year ago

Can't reproduce it. Can you share the problematic xlsx and the libreoffice version to create it?

nick133 commented 1 year ago

I've tried libreoffice-still 7.4.7 and libreoffice-fresh 7.5.4 to create new file with the same result. Also saving as Excel XLSX or OpenDocument XLSX - both segfault. When I open some old XLSX file (1-2 years old) - it's opened as it should, but after editing it and saving in Libreoffice - I've got core dump.. obviously it's some kind of broken format issue in libreoffice.

Here's the exact file that produces error: 1.xlsx

mashingan commented 1 year ago

It's bug for accessing workbook when it's not found yet. Fixed it by looking it first. Should be already fixed please check in newest Excelin tagged version.

nick133 commented 1 year ago

works fine now, thanks!