Bug 119659 - LOOKUP function >> application crashes, if "Result vector" argument is array of constant with more than one value in search direction, and search value is out of vector
Summary: LOOKUP function >> application crashes, if "Result vector" argument is array ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.6.0 target:7.4.8 target:7.5....
Keywords:
Depends on:
Blocks: Function-Vlookup
  Show dependency treegraph
 
Reported: 2018-09-03 09:52 UTC by Andrey
Modified: 2023-05-05 19:35 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
lookup function crash (97.78 KB, image/jpeg)
2018-09-05 17:27 UTC, Oliver Brinzing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey 2018-09-03 09:52:26 UTC
Description:
multi_type_vector::get_type#1625: block position not found!
(logical pos=2, block size=2, lofical size=2)

Steps to Reproduce:
1. Run LibreOffice calc
2. Fill A1:C1 cells with following values: A1=1, B1=2, C1=3
3. Enter following formulas to A2 cell:
=LOOKUP(3, A1:C1, {,2})
or
=LOOKUP(3, A1:C1, {1,})

Actual Results:
Application crashes

Expected Results:
Application should not crash, #N/A error should be displayed


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Build ID: dc68ad6c5cde3c62874b96422f2e5e8252499bad
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: en-US (en_US); Calc: CL
Comment 1 Regis Perdreau 2018-09-03 11:01:58 UTC
Guess I have to replace ',' with ';' so i can enter
=LOOKUP(3 ;A1:C1; {;2} )

No result. The A2 cell is blank, no error message.

The help tells that the third parameter is a range of cell. What is exactly expected with {,2} ? 


Version: 6.2.0.0.alpha0+
Build ID: 8854cf29682bc2f02fba1901f967c7a94bc706d5
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: fr-FR (fr_FR.UTF-8); Calc: threaded
Comment 2 Xisco Faulí 2018-09-03 13:55:17 UTC
I can't reproduce the crash

Versió: 6.0.6.2
ID de la construcció: 1:6.0.6-0ubuntu0.16.04.1
Fils de CPU: 4; SO: Linux 4.15; Renderitzador de la IU: per defecte; VCL: gtk3; 
Configuració local: ca-ES (ca_ES.UTF-8); Calc: group

Versión: 6.1.0.3
Id. de compilación: efb621ed25068d70781dc026f7e9c5187a4decd1
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; 
Configuración regional: es-ES (es_ES); Calc: group threaded

Version: 6.2.0.0.alpha0+
Build ID: 4b5fcd417587cfb9e6d8b61ecb037ab165eeb5b9
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: threaded

Could you please try with version 6.0.6.2 or 6.1.0.3 instead of 6.0.6.1 rc ?

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 3 himajin100000 2018-09-04 05:15:03 UTC
Error Message and Crash Reproducible. Marking NEW

Version: 6.2.0.0.alpha0+ (x64)
Build ID: 414ef6cb187dd3bbcc917dbedf3c0c1cc8668f60
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-08-21_00:13:04
Locale: en-US (ja_JP); Calc: CL

I don't know how to get stacktrace thingy though .Someday in the future (but not soon due to my laziness) I will search for how to.
Comment 4 himajin100000 2018-09-04 05:30:10 UTC
more note: when I did the same thing on my local build,
after the error, I got assertion errors.
https://opengrok.libreoffice.org/xref/core/desktop/source/app/officeipcthread.cxx?r=9401c7c2#904
https://opengrok.libreoffice.org/xref/core/vcl/source/app/scheduler.cxx?r=3bd83167#605
Comment 5 himajin100000 2018-09-04 09:01:52 UTC
Reproducible

バージョン: 6.1.1.1 (x64)
Build ID: 2718b4a18dfcc6a54ebe5f7b801ee7a47fa81e0c
CPU threads: 4; OS:Windows 10.0; UI render: default; 
ロケール: ja-JP (ja_JP); Calc: CL
Comment 6 Xisco Faulí 2018-09-04 09:04:22 UTC
Hi himajin100000,
Do you reproduce it if you disable OpenCL ? Tools - Options - LibreOffice - Open CL
Comment 7 himajin100000 2018-09-04 09:11:48 UTC
Reproducible

バージョン: 6.0.6.2 (x64)
Build ID: 0c292870b25a325b5ed35f6b45599d2ea4458e77
CPU threads: 4; OS:Windows 10.0; UI render: default; 
ロケール: ja-JP (ja_JP); Calc: 

with OpenCL and Software Interpreter turned off

>Do you reproduce it if you disable OpenCL ? Tools - Options - LibreOffice - Open CL
Comment 8 himajin100000 2018-09-04 09:15:01 UTC
Note: I restarted LibreOffice after turning off OpenCL and saw if the issue can be reproduced.
Comment 9 Xisco Faulí 2018-09-04 09:20:46 UTC
Maybe it's only happening on Win 10?

I can't reproduce it in

Version: 6.2.0.0.alpha0+
Build ID: a1dd8098e6e2a7d5ba4b9c1a2d094db11d3d6b27
CPU threads: 16; OS: Windows 6.3; UI render: default; 
Locale: en-GB (en_GB); Calc: threaded
Comment 10 himajin100000 2018-09-05 03:20:56 UTC
Reproducible on the same OS as my other posts.

バージョン: 5.4.7.2 (x64)
Build ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU threads: 4; OS: Windows 6.19; UI render: default; 
ロケール: ja-JP (ja_JP); Calc: single
Comment 11 Oliver Brinzing 2018-09-05 17:27:09 UTC
Created attachment 144698 [details]
lookup function crash

i can reproduce if a dot "." is entered instead of a comma: {0.2}
please have a look at the attachment

German Separator settings are:
Function:       ;
Array column:   .
Array row:      ;

Version: 6.2.0.0.alpha0+ (x64)
Build ID: 6c08039ebec28b936dd4521139c9670f7fadf9f4
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: de-DE (de_DE); Calc: threaded
Comment 12 Xisco Faulí 2018-09-06 13:36:15 UTC
Confirmed in

Version: 6.2.0.0.alpha0+
Build ID: f8edef392245c292398a80f6a858ca19f32df9c3
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

using

=LOOKUP(3; A1:C1; {.2})
Comment 13 Xisco Faulí 2018-09-06 13:42:26 UTC
Also reproduced in

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.10; Render: default; 

Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 14 Xisco Faulí 2018-09-06 13:44:03 UTC
@Eike, I thought you could be interested in this issue....
Comment 15 QA Administrators 2020-12-29 03:43:47 UTC Comment hidden (obsolete)
Comment 16 QA Administrators 2022-12-30 03:28:16 UTC Comment hidden (obsolete)
Comment 17 Eike Rathke 2023-04-29 16:47:14 UTC
To reproduce the lookup vector must be a cell range reference (not array) and the result vector an array (not reference) that is shorter than the lookup vector's found element position.

A1:C1={1,2,3}

With array column separator , comma:

=LOOKUP(3; A1:C1; {1,2})
Comment 18 Commit Notification 2023-04-29 18:04:01 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6b6b83b43fcae13e30a9ca67b421187a5e0d7142

Resolves: tdf#119659 Check found position for result vector

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2023-05-01 21:11:49 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/595eda782296916ddfec5f6d15e9abc5c61667ee

Related: tdf#119659 Use ValidColRowOrReplicated() for matrix dimension check

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2023-05-02 09:09:49 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/ade4e5cc9bb5a2026d8a9bdccd18c1645a7dd032

Resolves: tdf#119659 Check found position for result vector

It will be available in 7.4.8.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Commit Notification 2023-05-02 09:09:52 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/700e918ba7c481034a4629fbbf95e829e2a2786a

Resolves: tdf#119659 Check found position for result vector

It will be available in 7.5.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2023-05-02 14:13:44 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/30334be31f190b5da79f3ba2bec94b2ff35ad72c

tdf#119659: sc_uicalc: Add unittest

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 24 Commit Notification 2023-05-03 10:18:26 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-4-7":

https://git.libreoffice.org/core/commit/4a1fad2147186f6b150cd10519dda541a4d2e6c0

Resolves: tdf#119659 Check found position for result vector

It will be available in 7.4.7.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 25 ady 2023-05-04 12:37:26 UTC
Three points:

* 1._
(In reply to Commit Notification from comment #23)

> tdf#119659: sc_uicalc: Add unittest

FTR, https://gerrit.libreoffice.org/c/core/+/151328


* 2._

(In reply to Commit Notification from comment #20)
> Related: tdf#119659 Use ValidColRowOrReplicated() for matrix dimension check
> It will be available in 7.6.0.

Will there be any back-port / cherry-pick for 7.5 and 7.4.x?


* 3._
With:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 83b1f6b58a30bdb589e9ce73deef39f021aebde1
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (es_AR); UI: en-US
Calc: CL threaded
Built: 2023-05-04

Result of test is #N/A, no crash.
Comment 26 Eike Rathke 2023-05-05 19:35:53 UTC
(In reply to ady from comment #25)
> (In reply to Commit Notification from comment #20)
> > Related: tdf#119659 Use ValidColRowOrReplicated() for matrix dimension check
> > It will be available in 7.6.0.
> 
> Will there be any back-port / cherry-pick for 7.5 and 7.4.x?
7.4.7 certainly not. 7.5 I don't know yet; though correct in itself, the change may provoke a different behaviour in code calling those functions and evaluating the return value unwittingly of the implications.