Unit Tests failing when built with clang 12

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:

    [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

I jumped the gun emailing this dev list. The underlying issue was a null-pointer-use in LibreOffice. Sorry for the noise.

fixed here:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=9ccbf716ba16

discussed here:
http://document-foundation-mail-archive.969070.n3.nabble.com/Unit-Tests-failing-when-built-with-clang-12-tp4297414.html