diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-02-23 22:47:33 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-02-24 09:42:39 +0100 |
commit | ba2a0eb8807409ed67af70ab828f45b69fe66c48 (patch) | |
tree | fd30dbaecd4d3279b6ee22d29881a2375fcbae88 /solenv | |
parent | 8f2b1b1cb84e1ae3139eb90b8efdf61e608adbad (diff) |
Don't run ExternalExecutable_python with LD_LIBRARY_PATH
257bcb1a1140d3e070cfaef6fec0704740bc83b8 "get internal python invocations
working" had made this use LD_LIBRARY_PATH or similar on the various platforms,
but without giving any reason what it would actually be good for.
5d8f48c81eac8650315b936d0e89ad1d54b566fc "solver doesn't solve anything..." then
(somewhat by chance?) removed it for solenv/gbuild/platform/macosx.mk,
apparently without loss of functionality, but left it intact for other
platforms.
But at least in some Jenkins Linux build environments presence of
LD_LIBRARY_PATH (pointing at instdir/program/) appears to cause subtle problems:
Builds like <https://ci.libreoffice.org/job/lo_tb_master_linux/49844/>
occasionally crashed with
[...]
> make -O
[...]
> [build PAT] python3
> [build PRJ] python3
[...]
> [build PKG] python3
> [build EPK] python3
[...]
> [build BIN] python3
[...]
> [build MOD] python3
[...]
> [build PRJ] nss
[...]
> make[1]: *** Deleting file '/home/tdf/lode/jenkins/workspace/lo_tb_master_linux/workdir/UIConfig/sfx.a11yerrors'
> [build UIA] sfx
> Suppression file: /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/sanitizers/ui/sfx.suppr
> False positive file: /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/sanitizers/ui/sfx.false
> sfx2/uiconfig/ui/documentinfopage.ui: WARNING: 'GtkLabel' 'label8' does not specify what it labels within 'interface'
> 1 new warning (64 suppressed by /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/sanitizers/ui/sfx.suppr, please fix them)
> 0 new fatals (12 suppressed by /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/sanitizers/ui/sfx.suppr, please fix them)
> Explanations are available on https://wiki.documentfoundation.org/Development/Accessibility
>
> /bin/sh: line 1: 31655 Segmentation fault (core dumped) LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program" PYTHONHOME="$I/program/python-core-3.8.12" PYTHONPATH="${PYPATH:+$PYPATH:}$I/program/python-core-3.8.12/lib:$I/program/python-core-3.8.12/lib/lib-dynload" $I/program/python.bin $S/bin/gla11y -P $S/ -f $S/solenv/sanitizers/ui/sfx.false -s $S/solenv/sanitizers/ui/sfx.suppr --widgets-suffixignored +ValueSet,HBox,VBox,ToolBox,Preview,PreviewWin,PreviewWindow,PrevWindow --widgets-button +svtlo-ManagedMenuButton --fatal-all --not-fatal-type duplicate-mnemonic --not-fatal-type labelled-by-and-mnemonic --not-fatal-type orphan-label -o $W/UIConfig/sfx.a11yerrors $S/sfx2/uiconfig/ui/alienwarndialog.ui $S/sfx2/uiconfig/ui/addtargetdialog.ui $S/sfx2/uiconfig/ui/autoredactdialog.ui $S/sfx2/uiconfig/ui/bookmarkdialog.ui $S/sfx2/uiconfig/ui/bookmarkmenu.ui $S/sfx2/uiconfig/ui/charmapcontrol.ui $S/sfx2/uiconfig/ui/charviewmenu.ui $S/sfx2/uiconfig/ui/checkin.ui $S/sfx2/uiconfig/ui/classificationbox.ui $S/sfx2/uiconfig/ui/cmisinfopage.ui $S/sfx2/uiconfig/ui/cmisline.ui $S/sfx2/uiconfig/ui/commandpopup.ui $S/sfx2/uiconfig/ui/custominfopage.ui $S/sfx2/uiconfig/ui/deck.ui $S/sfx2/uiconfig/ui/descriptioninfopage.ui $S/sfx2/uiconfig/ui/developmenttool.ui $S/sfx2/uiconfig/ui/devtoolsmenu.ui $S/sfx2/uiconfig/ui/documentfontspage.ui $S/sfx2/uiconfig/ui/documentinfopage.ui $S/sfx2/uiconfig/ui/documentpropertiesdialog.ui $S/sfx2/uiconfig/ui/editdocumentdialog.ui $S/sfx2/uiconfig/ui/editdurationdialog.ui $S/sfx2/uiconfig/ui/emojicontrol.ui $S/sfx2/uiconfig/ui/extrabutton.ui $S/sfx2/uiconfig/ui/errorfindemaildialog.ui $S/sfx2/uiconfig/ui/floatingrecord.ui $S/sfx2/uiconfig/ui/helpbookmarkpage.ui $S/sfx2/uiconfig/ui/helpcontrol.ui $S/sfx2/uiconfig/ui/helpcontentpage.ui $S/sfx2/uiconfig/ui/helpindexpage.ui $S/sfx2/uiconfig/ui/helpmanual.ui $S/sfx2/uiconfig/ui/helpsearchpage.ui $S/sfx2/uiconfig/ui/helpwindow.ui $S/sfx2/uiconfig/ui/infobar.ui $S/sfx2/uiconfig/ui/inputdialog.ui $S/sfx2/uiconfig/ui/licensedialog.ui $S/sfx2/uiconfig/ui/linefragment.ui $S/sfx2/uiconfig/ui/linkeditdialog.ui $S/sfx2/uiconfig/ui/loadtemplatedialog.ui $S/sfx2/uiconfig/ui/managestylepage.ui $S/sfx2/uiconfig/ui/navigator.ui $S/sfx2/uiconfig/ui/newstyle.ui $S/sfx2/uiconfig/ui/notebookbar.ui $S/sfx2/uiconfig/ui/optprintpage.ui $S/sfx2/uiconfig/ui/panel.ui $S/sfx2/uiconfig/ui/password.ui $S/sfx2/uiconfig/ui/notebookbarpopup.ui $S/sfx2/uiconfig/ui/printeroptionsdialog.ui $S/sfx2/uiconfig/ui/querysavedialog.ui $S/sfx2/uiconfig/ui/saveastemplatedlg.ui $S/sfx2/uiconfig/ui/safemodequerydialog.ui $S/sfx2/uiconfig/ui/searchdialog.ui $S/sfx2/uiconfig/ui/securityinfopage.ui $S/sfx2/uiconfig/ui/singletabdialog.ui $S/sfx2/uiconfig/ui/startcenter.ui $S/sfx2/uiconfig/ui/stylecontextmenu.ui $S/sfx2/uiconfig/ui/tabbar.ui $S/sfx2/uiconfig/ui/tabbarcontents.ui $S/sfx2/uiconfig/ui/tabbutton.ui $S/sfx2/uiconfig/ui/templatedlg.ui $S/sfx2/uiconfig/ui/templatecategorydlg.ui $S/sfx2/uiconfig/ui/templatepanel.ui $S/sfx2/uiconfig/ui/urlbox.ui $S/sfx2/uiconfig/ui/versionsofdialog.ui $S/sfx2/uiconfig/ui/versioncommentdialog.ui $S/sfx2/uiconfig/ui/versionscmis.ui
> /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/gbuild/UIConfig.mk:157: recipe for target '/home/tdf/lode/jenkins/workspace/lo_tb_master_linux/workdir/UIConfig/sfx.a11yerrors' failed
> make[1]: *** [/home/tdf/lode/jenkins/workspace/lo_tb_master_linux/workdir/UIConfig/sfx.a11yerrors] Error 139
> make[1]: *** Waiting for unfinished jobs....
where the crashed instdir/program/python.bin is at
> (gdb) thread apply all backtrace
>
> Thread 1 (Thread 0x2af0920e1a40 (LWP 30414)):
> #0 0x0000000000000ae0 in ?? ()
> #1 0x00002af0920b008a in _dl_fini () from /lib64/ld-linux-x86-64.so.2
> #2 0x00002af093404ce9 in __run_exit_handlers () from /lib64/libc.so.6
> #3 0x00002af093404d37 in exit () from /lib64/libc.so.6
> #4 0x00002af0933ed55c in __libc_start_main () from /lib64/libc.so.6
> #5 0x000000000040068e in _start ()
with
> (gdb) info sharedlibrary
> From To Syms Read Shared Object Library
> 0x00002af09232e2f0 0x00002af09253270c Yes /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/instdir/program/libpython3.8.so.1.0
> 0x00002af09286fe30 0x00002af092874cec Yes (*) /lib64/libcrypt.so.1
> 0x00002af092aab8f0 0x00002af092ab6db1 Yes (*) /lib64/libpthread.so.0
> 0x00002af092cc2e50 0x00002af092cc394e Yes (*) /lib64/libdl.so.2
> 0x00002af092ec6e90 0x00002af092ec77a4 Yes (*) /lib64/libutil.so.1
> 0x00002af0930ce350 0x00002af093139336 Yes (*) /lib64/libm.so.6
> 0x00002af0933ea9f0 0x00002af09353ab6f Yes (*) /lib64/libc.so.6
> 0x00002af093799a50 0x00002af09379a05a Yes (*) /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/instdir/program/libfreebl3.so
> 0x00002af0920a0af0 0x00002af0920bc060 Yes (*) /lib64/ld-linux-x86-64.so.2
> 0x00002af09a0e3be0 0x00002af09a10aa53 Yes /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/instdir/program/python-core-3.8.12/lib/lib-dynload/pyexpat.cpython-3.8.so
What is suspicious is that it uses instdir/program/libfreebl3.so when
external/nss has been built ("[build PRJ] nss") but has not yet been fully
delivered (no "[build PKG] nss"). It uses instdir/program/libfreebl3.so because
on that machine instdir/program/python.bin has a DT_NEEDED of libcrypt.so.1 and
/lib64/libcrypt.so.1 has a DT_NEEDED of libfreebl3.so, which the LD_LIBRARY_PATH
then resolves with instdir/program/libfreebl3.so rather than with the expected
/lib64/libfreebl3.so.
So remove setting of LD_LIBRARY_PATH on all the platforms where it was still
used, in the hope that it isn't actually necessary on any of them. Only on
Windows, setting PATH is still needed (in line with how the Executable_python
wrapper modifies it too) to avoid build failures like
> instdir/program/python-core-3.8.12/bin/python.exe: error while loading shared libraries: python38_d.dll: cannot open shared object file: No such file or directory
Change-Id: I398aa89166a6a7f3db58c4e65237840b73bec74b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130470
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/platform/solaris.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/unxgcc.mk | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 0f396dd8e80e..9d18cd913a87 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -347,7 +347,7 @@ endef gb_UIMenubarTarget_UIMenubarTarget_platform := # Python -gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload:$(INSTDIR)/program" +gb_Python_PRECOMMAND := PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload:$(INSTDIR)/program" gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(INSTROOT)/program/python # this is passed to gdb as executable when running tests gb_Python_INSTALLED_EXECUTABLE_GDB := $(INSTROOT)/program/python.bin diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index a0aead205c12..b98732030b32 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -413,7 +413,7 @@ endef gb_UIMenubarTarget_UIMenubarTarget_platform := # Python -gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload" +gb_Python_PRECOMMAND := PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload" gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(INSTROOT)/program/python # this is passed to gdb as executable when running tests gb_Python_INSTALLED_EXECUTABLE_GDB := $(INSTROOT)/program/python.bin |