Created attachment 95859 [details] File with a range of conditional formatting With upcoming file: welinder@toshiba ~/gnome/gnumeric/test $ localc ~/ccc.xls terminate called after throwing an instance of 'boost::bad_index' what(): 'at()' out of bounds The file was generated from gnumeric git: welinder@toshiba ~/gnome/gnumeric/test $ ../src/ssconvert ../samples/cond-format-tests.gnumeric ~/ccc.xls Note: I am not sure this xls file is actually valid. I *think* it is, but LO shouldn't crash regardless.
Created attachment 95861 [details] Same file with row 36 removed This is the same file, except that row 36 has been removed. That is the row that tests applying horizontal right-alignment via a conditional format.
Created attachment 95871 [details] console logs + bt with symbols On pc Debian x86-64 with master sources updated yesterday, I could reproduce the problem.
Created attachment 95872 [details] bt from warning I put a break on the warning and got this bt.
Kohei/Markus/Eike: any idea from the 2 bts?
According to our code that file is invalid but I just added a check to avoid crashing with a 0 based index. According to the code we assume a 1 based index at this point.
I note that Excel is apparently happy with that file. What field in what record do you believe is invalid?
Markus Mohrhard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=96926d2f2f90ad8b0aadbc0f5e915abbce6a2518 don't crash with possibly invalid index, fdo#76209 The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ok, nevermind my question. There is nothing wrong with the file. The real problem is in function ReadCF, see http://docs.libreoffice.org/sc/html/xicontent_8cxx_source.html 1. The code fails to take the optional number format record into account. The record, when present, lives before the font part. This particular cf does not have it, but others in the file do. Search for DXFNum in MS-XLS. 2. This code fails to take the optional alignment record into account. The record, when present, lives between font and border. (2) is what sends it off to the deep end here. It is trying to parse the alignment record as a formula. That is obviously not going to work very well. The committed patch is fine in and of itself. It's just not enough.
Markus Mohrhard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=74116032d3ebab422ba8508f42198d101822024f import alignment dxf record, related fdo#76209 The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Markus Mohrhard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ac6773e1e3e1382990c0f1942001b8b07cdc4682 import dxf number format record, related fdo#76209 The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Markus Mohrhard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=570200983a0eded4a4d3bfcefc6a4cfa3d388f1d import dxf protection record from xls, related fdo#76209 The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.