Description: I am trying to fix a uitest bug on riscv64. All the UI test failed for throwing "IndexError: index out of range" when closing doc. Here is an example: https://gist.github.com/Sakura286/e216f57c1a81c6dc813ac52f76479293 On x86, "bool(frames)" should be "False" and "frames[0].active" should not be executed in uitest/uitest/test.py::close_doc(). But on riscv64, "bool(frames)" turn out to be "True". I looked into the code, and find that "frames.__len__()" on x86 changed from 1 to 0, but on riscv64 it changed from 270582939649 to 270582939648. 270582939648 is 0011 1111 0000 0000 0000 0000 0000 0000 0000 0000 in binary form (32 bit zero suffix). Maybe this is the opening to solve the problem. But I cannot find out where the __len__() function of the pyuno object is defined and cannot track how this weired number value comes from. I would be appreciated if someone provide some tips. Steps to Reproduce: 1. Run any UI test on riscv64 2. UI test failed for "IndexError: index out of range" Actual Results: UItest failed for error Expected Results: The doc closed without exception Reproducible: Always User Profile Reset: No Additional Info: Described above.
frames.__len__() calls the fuction PyUNO_len() in pyuno/source/module/pyuno.cxx. > int nLen = lcl_detach_getLength( me ); > if (nLen >= 0) > return nLen; "nlen" is a 32bit int variable. Remember that 0011 1111 0000 0000 0000 0000 0000 0000 0000 0000 has 32bit suffix 0. So the value of "nlen" is right in PyUNO_len(). Thus this bug should be locate between c++ and python environment.
it seems that this exhibits when built with -O2 but not with -O0...
https://gerrit.libreoffice.org/c/core/+/154837 was merged without this bug ID in the commit subject line, so this report didn't get the automatic comment. In the patch comments, René says the patch 'doesnt fix all tests but it's not supposed to, it definitely fixes the "index out of range" thingy'. Should this report be kept open or are further fixes planned?
I think it can be marked fixed. The description refers exactly that one issue and thus is fixed. Any new other problem should probably get a new bug anyway :)