Bug 132455 - REF error after undo sheet deletion. Hard recalculate does not fix it (STR comment 7)
Summary: REF error after undo sheet deletion. Hard recalculate does not fix it (STR co...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, regression
: 162073 (view as bug list)
Depends on:
Blocks: Sheet Cell-Reference
  Show dependency treegraph
 
Reported: 2020-04-27 11:43 UTC by Telesto
Modified: 2024-08-19 15:48 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Sheet2 with text from Sheet1 (9.23 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-02-14 02:56 UTC, Tex2002ans
Details
Log of source commits mentioned in bibisect result (13.07 KB, text/plain)
2024-08-19 15:48 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-04-27 11:43:10 UTC
Description:
REF error after undo sheet deletion. Hard recalculate doens't fix it

Steps to Reproduce:
1. Open attachment 154545 [details]
2. Remove FiltrageVent
3. CTRL+Z -> Wait a long time
4. Notice sheet Comparison showing REF error 

Actual Results:
REF-error

Expected Results:
No ref-error


Reproducible: Always


User Profile Reset: No



Additional Info:
Found in
Version: 7.0.0.0.alpha0+ (x64)
Build ID: f924658e45f256544e43c3fdb2af9b585d0f0933
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win; 
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: threaded

and in 4.4.7.2

not in 3.5.7.2
Comment 1 Xisco Faulí 2020-05-13 11:08:05 UTC
Hi Telesto,
Would it be possible to get a reduced reproducer ?
Comment 2 Xisco Faulí 2020-06-17 12:02:58 UTC
(In reply to Xisco Faulí from comment #1)
> Hi Telesto,
> Would it be possible to get a reduced reproducer ?

Setting to NEEDINO
Comment 3 Telesto 2020-06-17 13:07:10 UTC
Nope, sheet is locked with a password
Comment 4 b. 2020-06-18 15:46:32 UTC
repro with: 

Version: 7.1.0.0.alpha0+ (x64)
Build ID: a201ab6f47c2d5a7ba4c5f998b0aa231cae82010
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL

small reproducer with simple formula with 'constructed indirect' to other sheet fails - to fail- will try complex formulas later ...
Comment 5 QA Administrators 2022-08-04 03:34:00 UTC Comment hidden (obsolete)
Comment 6 Tex2002ans 2024-02-14 02:45:29 UTC
I confirm, still an issue in:

Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: da48488a73ddd66ea24cf16bbc4f7b9c08e9bea1
CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Followed comment 0 exactly.

- - - - -

For example, in "Comparisons" sheet... Cell F2:

On load:

- =$FiltrageVent.$O2

After Step 2:

- =#REF!.$O2

and Step 3 (undoing the sheet delete), it still stays stuck as:

- =#REF!.$O2

Once they turn into #REF (at least on sheet deletion), seems like they never go back.

- - -

And like Xisco wrote in comment 1:

- Probably would be a good idea to get a better minimal example too. :)

I'll attach a very simple one.
Comment 7 Tex2002ans 2024-02-14 02:56:53 UTC
Created attachment 192552 [details]
Sheet2 with text from Sheet1

0. Open attached ODS file.

All it is:

Sheet1: A1: "TextfromSheet1"
Sheet2: A1: "Here is:"
Sheet2: B1: =$Sheet1.A1

- - -

1. Delete Sheet1.
2. Edit > Undo (Ctrl+Z)
3. Go back to Sheet2.

- - -

In Sheet2, Cell B1...

For values, you'll see:

Step 0: "TextfromSheet1"
Step 1: #REF!
Step 2: #REF!

For formulas, you'll see:

Step 0: =$Sheet1.A1
Step 1: =$#REF!.A1
Step 2: =$#REF!.A1

After Step 2, there is no amount of Undos you can do to return to the original state.
Comment 8 Tex2002ans 2024-02-14 03:03:18 UTC
Testing in Excel 365 (2401, Build 17231.20194), it just gave a warning:

> "Microsoft Excel will permanently delete this sheet. Do you want to continue?"

After deleting the sheet, pressing Ctrl+Z to undo did nothing, and Sheet2's formula was stuck as:

- =#REF!A1

- - -

So, if this is too complicated to toss onto the undo stack, perhaps a warning could work too.

"Hey! You have formulas pointing to this sheet. Are you SURE you want to Delete?"
Comment 9 m_a_riosv 2024-07-17 22:58:27 UTC
*** Bug 162073 has been marked as a duplicate of this bug. ***
Comment 10 ady 2024-07-18 04:33:09 UTC
Following either tdf#132455 comment 7, or the dupe tdf#162073, both result in:

LO 4.1.0.4 > OK
LO 4.2.0.4 > KO

Regression.
Comment 11 Steve271 2024-08-14 21:48:05 UTC
bibisected with linux-42max repo and got the following results:

 8e7bade4e7314a340c77edd9042e230f61f0323d is the first bad commit
commit 8e7bade4e7314a340c77edd9042e230f61f0323d
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sat Sep 5 18:33:36 2015 +0800

    source-hash-4c99a427ee4adaeddb2682c192384bad21d9d09b
    
    Bibisect: This commit covers the following source commit(s) which failed to build

    c7bdee8dbd1cf260a8513a0d31b36f90daa70f1c
    77ec47356025de4e46f48f94629f896349b0a8e5
    e9c5eb60d53204261c7937108bd53e86e46fc2f3
    75dec25730c88bdb8eb5e2a3f92689460fa89d29
    c008dc483f8c6840803983e7e351cec6fdd32070
    46419cd7a2d453c6f252c28dfb9dbfb08605e1c4
    dcf04c58456d8285bdcaa2921b6c08d48e09dab3
    dabeb3d643c0ebd2cb7fdce333d0e6248b1488ad
    8b252f30267d043522ff2cbf2bf42275bb7a6ec6
    76ca1529edb9afdb1838ab9a9e01fa231148c1d8
    341a4c87e977a2fd3948de6eaa647be4b32e6ebc
    3b3b0c04385851f120dc26d26e40f0d1c6344274
    cb4a47887df282196c9aa529269d5115306813c1
    1fe76b401760e0b31095d0a4d7e877aeee1624dc
    6ea53929245eb496d6954ab266636978653f1784
    65be1e27254ff1292b3593af42fbfb0235c26fcd
    b6a6a26698cb56a194c7c99b0ad267e60e3a05d5
    3b0c069c9a157c4cd9ec5636c776115af6d9664f
    458df361e0761651b6d17f4fb730f996243bc9f3
    2a5ea9ee0ba2b38d1810828a9fdf884d9b0fd198
    e3b91687590f08438b5a5d4eec72e634b11a8589
    57538e5f5002ecc2df95087244cb0431867c443e
    df90b9eaa16a52d076658ffc2fd1f65f12d1a622
    2a1c5aba7640416c78501116dd42d12e74fe4734
    66d3f24334e69e1655e83520950c59a0bda095a3
    8a39b8ce354bd42325ff61c07cfdc7a150d2925a
    91f7e9e02e72b46c881656a6b493fac276a6822b
    33a417fc82ce3c5f1b3d435d912eb4b5afc52054
    7a522da4f3946006fd325d498845225b8a8836f2
    5f188d659e8601e577f3a837c9dd3459761371ac
    92a78a052efcb3122932894fb446c62733daad42
    9186ae043b7e8afa5730b9d70818360cdfef2201
    359f33c5d0d39c4fcc57cba199a0d5b9a66c8fb9
    b1391232450af9e81079a2afe2173c422c8e9e3b
    e639e3068c30bb614c394466f41fa450ee8b2dbb
    cf02151987b19b12ca0be463732765bd35f54028
    2c92a92e2fa2503f0381b89f316f982eda580b6e
    21a1bce4301d3d8de9702373c830d2e115223991
    878f46727d8bcf1f75d056d9270ef3e2fe0b9d88
    bb7d5ce2a8bd1dca51eb627aa2df811541053969
    4347e3b15f10784b482544bd6324d3fcd4f0146c
    ec0080c40cfdb26896537f47a4c2e0439f9afdb1
    
    commit 4c99a427ee4adaeddb2682c192384bad21d9d09b
    Author:     Kohei Yoshida <kohei.yoshida@gmail.com>
    AuthorDate: Mon Jun 24 16:19:02 2013 -0400
    Commit:     Kohei Yoshida <kohei.yoshida@gmail.com>
    CommitDate: Mon Jun 24 16:51:45 2013 -0400
    
        Fix incorrect merge.
    
        Change-Id: I1337413e1ee49b7d90671ac517dbb2bd918dbebf

:040000 040000 a351ae70435bce76fad1787a0467fe4e09c305a9 52082a43a03d21ea26f375df3625991170469e9e M	opt


adding Cc to Kohei
Comment 12 Buovjaga 2024-08-19 15:48:45 UTC
Created attachment 195903 [details]
Log of source commits mentioned in bibisect result

All commits from Kohei.

Produced by copying the list of source commits to a file and doing this in LibreOffice core repo:

while IFS="" read -r p || [ -n "$p" ]; do   git show --no-patch "$p" >> /path/to/tdf132455_bisectlog.txt; done < /path/to/tdf132455_bisect_range.txt