Unit Tests failing when built with clang 12

Luke Benes lukebenes at hotmail.com
Mon Mar 15 19:54:17 UTC 2021


The  recently added Unit Test test_tdf131000
https://cgit.freedesktop.org/libreoffice/core/commit/?id=df33714f0eca
fails with clang 12 but not with gcc 10 or clang 11. I bisected this regression to this change in clang:

https://github.com/llvm/llvm-project/commit/69cd776e1ee79e72ccbdad30749eac04579715ee
    [CodeGen] Apply 'nonnull' and 'dereferenceable(N)' to 'this' pointer


Does this look like undefined behavior on our end or a bug in clang? The build log is below:

-Luke


[UIT] calc_tests9
False
test_tdf131000 (forms.Forms) ...

Fatal exception: Signal 11
Stack:
/core/instdir/program/libuno_sal.so.3(+0x37ac1)[0xb7f5fac1]
/core/instdir/program/libuno_sal.so.3(+0x379b3)[0xb7f5f9b3]
linux-gate.so.1(__kernel_rt_sigreturn+0x0)[0xb7f8c560]
/core/instdir/program/libfwklo.so(+0x17e32a)[0xb6b3a32a]
/core/instdir/program/libfwklo.so(+0x182e5a)[0xb6b3ee5a]
/core/instdir/program/libsvxlo.so(+0x280df4)[0xb604ddf4]
/core/instdir/program/libsvxlo.so(+0x281082)[0xb604e082]
/core/instdir/program/libsvxlo.so(+0x28120f)[0xb604e20f]
/core/instdir/program/libsfxlo.so(+0x1738b4)[0xb64208b4]
/core/instdir/program/libsfxlo.so(+0x17385b)[0xb642085b]
/core/instdir/program/libsfxlo.so(+0x1525bb)[0xb63ff5bb]
/core/instdir/program/libsfxlo.so(+0x152161)[0xb63ff161]
/core/instdir/program/libsfxlo.so(_ZN11SfxBindings6UpdateEt+0x10e)[0xb63ff8fa]
/core/instdir/program/libsfxlo.so(+0x1582e2)[0xb64052e2]
/core/instdir/program/libsfxlo.so(_ZN13SfxDispatcher8Execute_ER8SfxShellRK7SfxSlotR10SfxRequest11SfxCallMode+0x8c)[0xb64067c0]
/core/instdir/program/libsfxlo.so(+0x154227)[0xb6401227]
/core/instdir/program/libsfxlo.so(+0x197f7e)[0xb6444f7e]
/core/instdir/program/libsfxlo.so(+0x196baf)[0xb6443baf]
/core/instdir/program/libsfxlo.so(+0x198644)[0xb6445644]
/core/instdir/program/libcomphelper.so(_ZN10comphelper15dispatchCommandERKN3rtl8OUStringERKN3com3sun4star3uno9ReferenceINS6_5frame6XFrameEEERKNS7_8SequenceINS6_5beans13PropertyValueEEERKNS8_INS9_23XDispatchResultListenerEEE+0x2e3)[0xb71307b7]
/core/instdir/program/libcomphelper.so(_ZN10comphelper15dispatchCommandERKN3rtl8OUStringERKN3com3sun4star3uno8SequenceINS6_5beans13PropertyValueEEERKNS7_9ReferenceINS6_5frame23XDispatchResultListenerEEE+0xb0)[0xb71309f0]
/core/instdir/program/libvcllo.so(+0x656b7e)[0xb494db7e]
/core/instdir/program/libvcllo.so(+0x6596e3)[0xb49506e3]
/core/instdir/program/libvcllo.so(+0x659c56)[0xb4950c56]
/core/instdir/program/libgcc3_uno.so(+0x7e35)[0xb7e38e35]
/core/instdir/program/libgcc3_uno.so(+0x77c8)[0xb7e387c8]
/core/instdir/program/libgcc3_uno.so(+0x7419)[0xb7e38419]
/core/instdir/program/libbinaryurplo.so(+0x11de7)[0xae00fde7]
/core/instdir/program/libbinaryurplo.so(+0x115f8)[0xae00f5f8]
/core/instdir/program/libbinaryurplo.so(+0x163c8)[0xae0143c8]
/core/instdir/program/libuno_cppu.so.3(+0x564b)[0xb706964b]
/core/instdir/program/libuno_cppu.so.3(+0x6913)[0xb706a913]
/core/instdir/program/libuno_cppu.so.3(+0x6a49)[0xb706aa49]
/core/instdir/program/libuno_cppu.so.3(+0x6e7e)[0xb706ae7e]
/core/instdir/program/libuno_sal.so.3(+0x3a686)[0xb7f62686]
/lib/libpthread.so.0(+0x7e77)[0xb78bce77]
/lib/libc.so.6(clone+0x66)[0xb7d3c4d6]
OfficeConnection: connecting to: uno:pipe,name=pytest1bf07fa8-791f-11eb-8141-2c56dc06c1e5;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
NoConnectException: sleeping...
['OnLoad']
OnLoadFinished
['OnLoad']
OnTitleChanged
['OnLoad']
OnFocus
['OnLoad']
OnViewCreated
['ModelessDialogVisible']
DialogExecute
Execution time for forms.Forms.test_tdf131000: 2.707
Binary URP bridge already disposed /core/binaryurp/source/bridge.cxx:1045
ERROR
ERROR
test_cancelButton (pivotTable.pivotTable) ... OfficeConnection: connecting to: uno:pipe,name=pytest1ec37366-791f-11eb-8141-2c56dc06c1e5;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
['OnLoad']
OnLoadFinished
['OnLoad']
OnTitleChanged
['OnLoad']
OnFocus
['OnLoad']
OnViewCreated
['DialogExecute']
ModelessDialogVisible
['OnLoad', 'DialogExecute', 'ModelessDialogExecute', 'ModelessDialogVisible']
DialogClosed
['OnLoad', 'DialogExecute', 'ModelessDialogExecute', 'ModelessDialogVisible']
DialogClosed
['OnLoad', 'DialogExecute', 'ModelessDialogExecute', 'ModelessDialogVisible']
DialogClosed
['OnLoad', 'DialogExecute', 'ModelessDialogExecute', 'ModelessDialogVisible']
DialogClosed
['OnLoad', 'DialogExecute', 'ModelessDialogExecute', 'ModelessDialogVisible']
DialogClosed
['OnLoad', 'DialogExecute', 'ModelessDialogExecute', 'ModelessDialogVisible']
DialogClosed
['OnLoad', 'DialogExecute', 'ModelessDialogExecute', 'ModelessDialogVisible']
DialogClosed
Execution time for pivotTable.pivotTable.test_cancelButton: 2.904
tearDown: calling terminate()...
...done
ok
test_tdf121949_copy_block_with_single_cell_not_included (tdf121949.tdf121949) ... OfficeConnection: connecting to: uno:pipe,name=pytest212b6d0c-791f-11eb-8141-2c56dc06c1e5;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
['OnNew']
OnCreate
['OnNew']
OnStorageChanged
['OnNew']
OnTitleChanged
['OnNew']
OnFocus
['OnNew']
OnViewCreated
['DialogExecute']
OnModeChanged
['DialogClosed']
OnModeChanged
Execution time for tdf121949.tdf121949.test_tdf121949_copy_block_with_single_cell_not_included: 1.977
tearDown: calling terminate()...
...done
ok
test_tdf126673_auto_fit_row_height (tdf126673.tdf126673) ... OfficeConnection: connecting to: uno:pipe,name=pytest2302a0d2-791f-11eb-8141-2c56dc06c1e5;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
['OnLoad']
OnLoadFinished
['OnLoad']
OnTitleChanged
['OnLoad']
OnFocus
['OnLoad']
OnViewCreated
['DialogExecute']
DialogClosed
['DialogExecute']
OnModeChanged
['DialogClosed']
OnModeChanged
['DialogExecute']
OnModeChanged
['DialogClosed']
OnModeChanged
['DialogExecute']
OnModeChanged
['DialogClosed']
OnModeChanged
Execution time for tdf126673.tdf126673.test_tdf126673_auto_fit_row_height: 3.273
tearDown: calling terminate()...
...done
ok
test_tdf130371 (tdf130371.namedRanges) ... OfficeConnection: connecting to: uno:pipe,name=pytest25a48f12-791f-11eb-8141-2c56dc06c1e5;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
['OnLoad']
OnLoadFinished
['OnLoad']
OnTitleChanged
['OnLoad']
OnFocus
['OnLoad']
OnViewCreated
['DialogExecute']
ModelessDialogVisible
['DialogExecute']
ModelessDialogVisible
['DialogExecute']
ModelessDialogVisible
Execution time for tdf130371.namedRanges.test_tdf130371: 2.307
tearDown: calling terminate()...
...done
ok
test_tdf133629 (tdf133629.tdf133629) ... OfficeConnection: connecting to: uno:pipe,name=pytest27b138f0-791f-11eb-8141-2c56dc06c1e5;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
['OnNew']
OnCreate
['OnNew']
OnStorageChanged
['OnNew']
OnTitleChanged
['OnNew']
OnFocus
['OnNew']
OnViewCreated
['DialogExecute']
OnModeChanged
['DialogExecute']
OnModeChanged
['DialogClosed']
OnModeChanged
Execution time for tdf133629.tdf133629.test_tdf133629: 2.899
tearDown: calling terminate()...
...done
ok
test_tdf137446 (tdf137446.tdf137446) ... OfficeConnection: connecting to: uno:pipe,name=pytest2a19fb90-791f-11eb-8141-2c56dc06c1e5;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
['OnLoad']
OnLoadFinished
['OnLoad']
OnTitleChanged
['OnLoad']
OnFocus
['OnLoad']
OnViewCreated
['DialogExecute']
DialogClosed
['DialogExecute']
OnModeChanged
['DialogClosed']
OnModeChanged
['DialogExecute']
OnModeChanged
['DialogExecute']
OnModeChanged
Execution time for tdf137446.tdf137446.test_tdf137446: 2.507
tearDown: calling terminate()...
...done
ok
test_tdf91217_crash_deleting_rows (tdf91217.tdf91217) ... OfficeConnection: connecting to: uno:pipe,name=pytest2c425f16-791f-11eb-8141-2c56dc06c1e5;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
Execution time for tdf91217.tdf91217.test_tdf91217_crash_deleting_rows: 0.000
close
tearDown: calling terminate()...
...done
ok

======================================================================
ERROR: test_tdf131000 (forms.Forms)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/core/uitest/uitest/test.py", line 110, in execute_modeless_dialog_through_command
    if not self._xUITest.executeCommand(command):
uitest.test.com.sun.star.lang.DisposedException: Binary URP bridge disposed during call /core/binaryurp/source/bridge.cxx:611

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/core/sc/qa/uitest/calc_tests9/forms.py", line 22, in test_tdf131000
    self.ui_test.execute_modeless_dialog_through_command(".uno:ControlProperties")
  File "/core/uitest/uitest/test.py", line 118, in execute_modeless_dialog_through_command
    time.sleep(DEFAULT_SLEEP)
  File "/core/uitest/libreoffice/uno/eventlistener.py", line 38, in __exit__
    self.xGEB.removeDocumentEventListener(self)
uitest.test.com.sun.star.lang.DisposedException: Binary URP bridge already disposed /core/binaryurp/source/bridge.cxx:1045

======================================================================
ERROR: test_tdf131000 (forms.Forms)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/core/uitest/uitest/framework.py", line 46, in tearDown
    self.connection.tearDown()
  File "/core/uitest/libreoffice/connection.py", line 182, in tearDown
    self.connection.tearDown()
  File "/core/uitest/libreoffice/connection.py", line 121, in tearDown
    if self.xContext:
uno.com.sun.star.uno.RuntimeException: Binary URP bridge already disposed /core/binaryurp/source/bridge.cxx:1045

----------------------------------------------------------------------
Ran 8 tests in 28.586s

FAILED (errors=2)
Tests run: 8
Tests failed: 0
Tests errors: 2
Tests skipped: 0

Error: a unit test failed:

To rerun just this failed test without all others, use:
    make UITest_calc_tests9

Or to run just a specific test case method, use:
    make UITest_calc_tests9 UITEST_TEST_NAME="Module.ClassName.methodName"
where
    Module - the name of the python file (without the .py extension)
    Class - is the name in the "class Class" declaration

Or to do interactive debugging, run two shells with:
    LANG=C SAL_USE_VCLPLUGIN=gen make debugrun
    make gb_UITest_DEBUGRUN=T UITest_calc_tests9

The SAL_USE_VCLPLUGIN part is unnecessary if you are running on a kde desktop.
(The default gtk3 backend has issues with some uitests).

Failing that, put a
    time.sleep(60)
in the beginning of the method in the .py file,
and attach gdb to the running soffice process.

make[1]: *** [/core/solenv/gbuild/UITest.mk:60: /core/workdir/UITest/calc_tests9/done] Error 1


More information about the LibreOffice mailing list