Issue 128156 - "updates available" Sigsegv due to openssl (OPENSSL_ia32_cpuid) -- w workaround
Summary: "updates available" Sigsegv due to openssl (OPENSSL_ia32_cpuid) -- w workaround
Status: UNCONFIRMED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 4.1.6
Hardware: PC Linux 32-bit
: P5 (lowest) Major (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-18 04:39 UTC by insaner
Modified: 2019-07-19 08:26 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description insaner 2019-07-18 04:39:55 UTC
I just upgraded to fc27 (32bit), after which, when I first launched AOO 4.1.5, all seemed fine for the first few seconds, until the "Updates available" popup window appears, and AOO hangs. I thought it might be a bug with 4.1.5, so I manually updated to 4.1.6, and the same issue occurred. I tried a few things, like changing the Java version, disabling Java, but nothing worked. I did an strace, and then gdb, and finally landed on the clue:



Thread 570 "soffice.bin" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xad4ceb40 (LWP 13324)]
0xae7a865b in OPENSSL_ia32_cpuid () from /usr/lib/libcrypto.so.10
(gdb) 
(gdb) 
(gdb) bt
#0  0xae7a865b in OPENSSL_ia32_cpuid () at /usr/lib/libcrypto.so.10
#1  0xa2de7191 in OPENSSL_cpuid_setup () at /opt/openoffice4/program/../program/libserf-1.so.0
#2  0xad4cc620 in  ()
#3  0xb7fe7cbd in call_init.part () at /lib/ld-linux.so.2
#4  0xb7fe7e01 in _dl_init () at /lib/ld-linux.so.2
#5  0xb7fec0f2 in dl_open_worker () at /lib/ld-linux.so.2
#6  0xb78eb3a5 in _dl_catch_error () at /usr/lib/libc.so.6
#7  0xb7feb7f9 in _dl_open () at /lib/ld-linux.so.2
#8  0xb7798c65 in dlopen_doit () at /usr/lib/libdl.so.2
#9  0xb78eb3a5 in _dl_catch_error () at /usr/lib/libc.so.6
#10 0xb779938e in _dlerror_run () at /usr/lib/libdl.so.2
#11 0xb7798cee in dlopen@@GLIBC_2.1 () at /usr/lib/libdl.so.2
#12 0xb7e2dced in osl_loadAsciiModule () at /opt/openoffice4/program/libuno_sal.so.3
#13 0xb7e2dd66 in osl_loadModule () at /opt/openoffice4/program/libuno_sal.so.3
#14 0xb760da2d in cppu::loadSharedLibComponentFactory(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, com::sun::star::uno::Reference<com::sun::star::registry::XRegistryKey> const&) () at /opt/openoffice4/program/libuno_cppuhelpergcc3.so.3
#15 0xb1c23d3c in  () at /opt/openoffice4/program/bootstrap.uno.so
#16 0xb760240c in  () at /opt/openoffice4/program/libuno_cppuhelpergcc3.so.3
#17 0xb7602992 in  () at /opt/openoffice4/program/libuno_cppuhelpergcc3.so.3
#18 0xb7601c9d in  () at /opt/openoffice4/program/libuno_cppuhelpergcc3.so.3
#19 0xb7601d71 in  () at /opt/openoffice4/program/libuno_cppuhelpergcc3.so.3
#20 0xb1bfd2b0 in  () at /opt/openoffice4/program/bootstrap.uno.so
#21 0xb1bfc981 in  () at /opt/openoffice4/program/bootstrap.uno.so
#22 0xaeae5f65 in  () at /opt/openoffice4/program/../program/libucb1.so
#23 0xaead19b6 in  () at /opt/openoffice4/program/../program/libucb1.so
#24 0xaead76c2 in  () at /opt/openoffice4/program/../program/libucb1.so
#25 0xaead2e5f in  () at /opt/openoffice4/program/../program/libucb1.so
#26 0xaead2edb in  () at /opt/openoffice4/program/../program/libucb1.so
#27 0xa6daf155 in  () at /opt/openoffice4/program/../program/updatefeed.uno.so
#28 0xa6db0972 in  () at /opt/openoffice4/program/../program/updatefeed.uno.so
#29 0xa6ccdb6d in  () at /opt/openoffice4/program/../program/updchk.uno.so
#30 0xa6cc34ad in  () at /opt/openoffice4/program/../program/updchk.uno.so
#31 0xa6cc3782 in  () at /opt/openoffice4/program/../program/updchk.uno.so
#32 0xa6cc3896 in  () at /opt/openoffice4/program/../program/updchk.uno.so
#33 0xb7e2d6dd in  () at /opt/openoffice4/program/libuno_sal.so.3
#34 0xb777f317 in start_thread () at /usr/lib/libpthread.so.0
#35 0xb78b0506 in clone () at /usr/lib/libc.so.6


$ ls -l /usr/lib/libcrypto.so.10
lrwxrwxrwx. 1 root root 19 Apr  5  2018 /usr/lib/libcrypto.so.10 -> libcrypto.so.1.0.2o


So I tried a few more things:

$ LD_PRELOAD=/usr/lib/libcrypto.so.1.1.0i soffice

which did not work:



[New Thread 0xab7a7b40 (LWP 13998)]
[Thread 0xacc70b40 (LWP 13942) exited]

Thread 41 "soffice.bin" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xab7a7b40 (LWP 13998)]
0xadcb665b in OPENSSL_ia32_cpuid () from /usr/lib/libcrypto.so.10


(ie, it didn't pick up the lib)

So I tried:

# cd /usr/lib
# mkdir libcrypto-TMP
# mv libcrypto.so.10 libcrypto-TMP/
$ LD_PRELOAD=/usr/lib/libcrypto.so.1.1 soffice



Thread 44 "soffice.bin" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xabae9b40 (LWP 27083)]
0xb6ce02fa in pthread_rwlock_wrlock () from /usr/lib/libpthread.so.0


(gdb) thr 44
[Switching to thread 44 (Thread 0xabae9b40 (LWP 27083))]
#0  0xb778fb32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0  0xb778fb32 in _dl_sysinfo_int80 () at /lib/ld-linux.so.2
#1  0xb6dec133 in poll () at /usr/lib/libc.so.6
#2  0xb21f7040 in g_poll () at /usr/lib/libglib-2.0.so.0
#3  0xb21e7e2a in g_main_context_iterate.isra () at /usr/lib/libglib-2.0.so.0
#4  0xb21e7f77 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#5  0xb24fcd95 in  () at /opt/openoffice4/program/libvclplug_gtk.so
#6  0xb2452fb9 in X11SalInstance::Yield(bool, bool) () at /opt/openoffice4/program/libvclplug_gen.so
#7  0xb58faff2 in  () at /opt/openoffice4/program/libvcl.so
#8  0xb58f7dbe in Application::Yield(bool) () at /opt/openoffice4/program/libvcl.so
#9  0xb5508cca in  () at /opt/openoffice4/program/libsvx.so
#10 0xb550dd34 in  () at /opt/openoffice4/program/libsvx.so
#11 0xb563b6df in  () at /opt/openoffice4/program/libsvx.so
#12 0xb563ba5e in  () at /opt/openoffice4/program/libsvx.so
#13 0xb73038c0 in  () at /opt/openoffice4/program/libsofficeapp.so
#14 0xb730399d in  () at /opt/openoffice4/program/libsofficeapp.so
#15 0xb7305c68 in  () at /opt/openoffice4/program/libsofficeapp.so
#16 0xb58fe42e in  () at /opt/openoffice4/program/libvcl.so
#17 0xb57c0dfe in vos::signalHandlerFunction_impl(void*, oslSignalInfo*) () at /opt/openoffice4/program/libvos3gcc3.so
#18 0xb737738a in  () at /opt/openoffice4/program/libuno_sal.so.3
#19 0xb7378457 in  () at /opt/openoffice4/program/libuno_sal.so.3
#20 0xb6d41118 in <signal handler called> () at /usr/lib/libc.so.6
#21 0xb6ce02fa in pthread_rwlock_wrlock () at /usr/lib/libpthread.so.0
#22 0xb76812e8 in CRYPTO_THREAD_write_lock () at /usr/lib/libcrypto.so.1.1
#23 0xb76135c0 in ENGINE_finish () at /usr/lib/libcrypto.so.1.1
#24 0xb761cb9d in EVP_DigestInit_ex () at /usr/lib/libcrypto.so.1.1
#25 0xa3280992 in ssl3_init_finished_mac () at /opt/openoffice4/program/../program/libserf-1.so.0
#26 0xab12bcdc in  ()



and I finally ran into the workaround:

$ soffice

(ie, no LD_PRELOAD, but I had removed the symlink) AOO is now up and seems to be stable with no issues. I will re-enable Java and see if that affects anything (I doubt it will).


# lsof -p `pgrep soffice.bin`|grep crypt
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/500/gvfs
      Output information may be incomplete.
soffice.b 28416 myuser  mem       REG        8,5   2588072   1973404 /usr/lib/libcrypto.so.1.1.0i
soffice.b 28416 myuser  mem       REG        8,5    114672   1974479 /usr/lib/libk5crypto.so.3.1
soffice.b 28416 myuser  mem       REG        8,5    927356   1988762 /usr/lib/libgcrypt.so.20.2.3
soffice.b 28416 myuser  mem       REG        8,5     43396   1971710 /usr/lib/libcrypt-2.26.so


# ls -l libcrypto.so*
lrwxrwxrwx  1 root root      19 Sep 20  2018 libcrypto.so -> libcrypto.so.1.1.0i
-rwxr-xr-x  1 root root  805244 Sep 30  2003 libcrypto.so.0.9.6
-rwxr-xr-x  1 root root  857020 Sep 30  2003 libcrypto.so.0.9.6b
-rwxr-xr-x  1 root root 1113096 May 20  2005 libcrypto.so.0.9.7a
lrwxrwxrwx  1 root root      18 Jan 14  2004 libcrypto.so.1 -> libcrypto.so.0.9.6
-rwxr-xr-x. 1 root root 2188508 Apr  5  2018 libcrypto.so.1.0.2o
lrwxrwxrwx  1 root root      19 Sep 20  2018 libcrypto.so.1.1 -> libcrypto.so.1.1.0i
-rwxr-xr-x  1 root root 2588072 Sep 20  2018 libcrypto.so.1.1.0i
lrwxrwxrwx  1 root root      19 Jan 14  2004 libcrypto.so.2 -> libcrypto.so.0.9.6b
lrwxrwxrwx  1 root root      19 Jan 14  2004 libcrypto.so.4 -> libcrypto.so.0.9.7a

(yes, I do have some old files still lying around.. but it is picking up the right one, after removing the symlink to the problematic file)


$ rpm -q --whatprovides /usr/lib/libcrypto.so.1.0.2o
compat-openssl10-1.0.2o-1.fc27.i686
$ rpm -q --whatprovides /usr/lib/libcrypto.so.1.1  
openssl-libs-1.1.0i-1.fc27.i686

an attempt at rpm -e compat-openssl10-1.0.2o-1.fc27.i686 leads to a list of fc27 packages I wish to keep.

As you can see, removing the symlink is not a good solution, as other applications are bound to fail.


------
Others might run into this bug by searching for the following backtrace (the first few backtraces I ran gave me the following, which led me down a long, wrong rabbit-hole):

(gdb) bt
#0  0xb7758b32 in _dl_sysinfo_int80 () at /lib/ld-linux.so.2
#1  0xb6f0d572 in __lll_lock_wait () at /lib/libpthread.so.0
#2  0xb6f05c23 in pthread_mutex_lock () at /lib/libpthread.so.0
#3  0xb6f1ce27 in dlsym () at /lib/libdl.so.2
#4  0xb75adbd9 in osl_getAsciiFunctionSymbol () at /opt/openoffice4/program/libuno_sal.so.3
#5  0xb75adc48 in osl_getFunctionSymbol () at /opt/openoffice4/program/libuno_sal.so.3
#6  0xaecd8bd9 in  () at /opt/openoffice4/program/../program/i18npool.uno.so
#7  0xaecd2caa in  () at /opt/openoffice4/program/../program/i18npool.uno.so
#8  0xaecd37b6 in  () at /opt/openoffice4/program/../program/i18npool.uno.so
#9  0xaecd3e3e in  () at /opt/openoffice4/program/../program/i18npool.uno.so
#10 0xaece80a9 in  () at /opt/openoffice4/program/../program/i18npool.uno.so
#11 0xaece88f1 in  () at /opt/openoffice4/program/../program/i18npool.uno.so
#12 0xaece4538 in  () at /opt/openoffice4/program/../program/i18npool.uno.so
#13 0xb46df1e3 in  () at /opt/openoffice4/program/libediteng.so
#14 0xb46fe397 in  () at /opt/openoffice4/program/libediteng.so
#15 0xb46c0479 in EditEngine::CompleteOnlineSpelling() () at /opt/openoffice4/program/libediteng.so
#16 0xabf04aca in  () at /opt/openoffice4/program/../program/libsc.so
#17 0xabf06af5 in  () at /opt/openoffice4/program/../program/libsc.so
#18 0xabbb59a7 in  () at /opt/openoffice4/program/../program/libsc.so
#19 0xabbb5a65 in  () at /opt/openoffice4/program/../program/libsc.so
#20 0xb5b464dd in  () at /opt/openoffice4/program/libvcl.so
#21 0xb5b57381 in Timer::Timeout() () at /opt/openoffice4/program/libvcl.so
#22 0xb5b57725 in Timer::ImplTimerCallbackProc() () at /opt/openoffice4/program/libvcl.so
#23 0xb2695d16 in  () at /opt/openoffice4/program/libvclplug_gen.so
#24 0xb2695b12 in X11SalData::Timeout() const () at /opt/openoffice4/program/libvclplug_gen.so
#25 0xb273e149 in  () at /opt/openoffice4/program/libvclplug_gtk.so
#26 0xb273e174 in  () at /opt/openoffice4/program/libvclplug_gtk.so
#27 0xb24236c7 in g_timeout_dispatch () at /lib/libglib-2.0.so.0
#28 0xb2422af1 in g_main_context_dispatch () at /lib/libglib-2.0.so.0
#29 0xb2422ec9 in g_main_context_iterate.isra () at /lib/libglib-2.0.so.0
#30 0xb2422f77 in g_main_context_iteration () at /lib/libglib-2.0.so.0
#31 0xb273dd95 in  () at /opt/openoffice4/program/libvclplug_gtk.so
#32 0xb2693fb9 in X11SalInstance::Yield(bool, bool) () at /opt/openoffice4/program/libvclplug_gen.so
#33 0xb5b52ff2 in  () at /opt/openoffice4/program/libvcl.so
#34 0xb5b4fdbe in Application::Yield(bool) () at /opt/openoffice4/program/libvcl.so
#35 0xb5b51ccb in Application::Execute() () at /opt/openoffice4/program/libvcl.so
#36 0xb75432e0 in  () at /opt/openoffice4/program/libsofficeapp.so
#37 0xb5b56d8b in  () at /opt/openoffice4/program/libvcl.so
#38 0xb5b56e79 in SVMain() () at /opt/openoffice4/program/libvcl.so
#39 0xb7563e50 in soffice_main () at /opt/openoffice4/program/libsofficeapp.so
#40 0x08048c84 in main ()

------


TL;DR:

compat-openssl10-1.0.2o-1.fc27.i686 provides a file (/usr/lib/libcrypto.so.10 -> libcrypto.so.1.0.2o) which gets picked up by AOO and triggers a crash/hang at the appearance of "Updates available" popup. 

WORKAROUND:

remove symlink /usr/lib/libcrypto.so.10
Comment 1 insaner 2019-07-18 05:03:30 UTC
BETTER WORKAROUND:

I just tried the workaround suggested in the following link:

https://forums.kleientertainment.com/forums/topic/78421-solved-openssl_ia32_cpuid-problem/

by launching soffice like this:

$ env OPENSSL_ia32cap="~0x10000000" soffice

(after moving the symlink back to its original location) and AOO did not crash. The popup appeared, disappeared, and I can still use my AOO as normal. This is a much better workaround, which will not break my other applications.

More info:

https://www.openssl.org/docs/man1.1.0/man3/OPENSSL_ia32cap.html
Comment 2 oooforum (fr) 2019-07-19 08:26:30 UTC
FYI, updating process don't work (see issue #127789)