Bug 160348 - kded crashes after SSL initialization
Summary: kded crashes after SSL initialization
Status: RESOLVED NOT A BUG
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kded (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-04 03:21 UTC by Daniel Franke
Modified: 2008-04-04 11:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2008-04-04 03:22:14 UTC
Version:            (using KDE 3.5.9)
Installed from:    Gentoo Packages
Compiler:          gcc-4.1.2 
OS:                Linux

For months, kded keeps crashing on SSL initialization. After login to KDE, kded is up running. Starting kmail, entering password to get access to kwallet ... crash. I'm fed up, especially since I seem to be the only one to encounter this problem :(


Last messages and backtrace:

[...]
kdecore (KLibLoader): Loading the next library global with flag 257.
kdecore (KLibLoader): WARNING: KLibrary: /usr/lib/libcrypto.so.0.9.8: undefined symbol: PKCS7_content_free
kdecore (KLibLoader): Loading the next library global with flag 257.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb65316d0 (LWP 26865)]
0xb7f3cf14 in _dl_relocate_object () from /lib/ld-linux.so.2
(gdb) bt
#0  0xb7f3cf14 in _dl_relocate_object () from /lib/ld-linux.so.2
#1  0xb7f43a06 in dl_open_worker () from /lib/ld-linux.so.2
#2  0xb7f3f892 in _dl_catch_error () from /lib/ld-linux.so.2
#3  0xb7f432ce in _dl_open () from /lib/ld-linux.so.2
#4  0xb6795c3d in dlopen_doit () from /lib/libdl.so.2
#5  0xb7f3f892 in _dl_catch_error () from /lib/ld-linux.so.2
#6  0xb67960dc in _dlerror_run () from /lib/libdl.so.2
#7  0xb6795b71 in dlopen@@GLIBC_2.1 () from /lib/libdl.so.2
#8  0xb5f3fb5d in dlfcn_load () from /usr/lib/libcrypto.so.0.9.8
#9  0xb5f407e3 in DSO_load () from /usr/lib/libcrypto.so.0.9.8
#10 0xb5fa1251 in COMP_zlib () from /usr/lib/libcrypto.so.0.9.8
#11 0xb5e94a3b in load_builtin_compressions () from /usr/lib/libssl.so.0.9.8
#12 0xb5e94c32 in SSL_COMP_get_compression_methods () from /usr/lib/libssl.so.0.9.8
#13 0xb5e9ab69 in SSL_library_init () from /usr/lib/libssl.so.0.9.8
#14 0xb7d1a6fa in KOpenSSLProxy (this=0x811a600) at kopenssl.cc:579
#15 0xb7d1a8fe in KOpenSSLProxy::self () at kopenssl.cc:634
#16 0xb7d0bfbf in KSSLCertificate::fromString (cert=@0xbfad5858) at ksslcertificate.cc:153
#17 0xb5ff21b2 in KSSLD::cacheLoadDefaultPolicies (this=0x8137290) at kssld.cpp:251
#18 0xb5ff4428 in KSSLD (this=0x8137290, name=@0xbfad5990) at kssld.cpp:122
#19 0xb5ff447e in create_kssld (name=@0xbfad5990) at kssld.cpp:57
#20 0xb7f25ea9 in Kded::loadModule (this=0x8057200, s=0x817bc20, onDemand=true) at kded.cpp:297
#21 0xb7f26480 in Kded::loadModule (this=0x8057200, obj=@0xbfad5c6c, onDemand=true) at kded.cpp:239
#22 0xb7f26504 in Kded::process (this=0x8057200, obj=@0xbfad5c6c, fun=@0xbfad5c64, data=@0xbfad5c5c, replyType=@0xbfad5c54, replyData=@0xbfad5c4c)
#23 0xb75fdb17 in DCOPClient::receive (this=0x80596c0, objId=@0xbfad5c6c, fun=@0xbfad5c64, data=@0xbfad5c5c, replyType=@0xbfad5c54, replyData=@0xbfad5c4c)
    at dcopclient.cpp:1634
#24 0xb76015fd in DCOPProcessInternal (d=0x80582e0, opcode=2, key=206, dataReceived=@0xbfad5d18, canPost=true) at dcopclient.cpp:520
#25 0xb7602608 in DCOPProcessMessage (iceConn=0x8058428, clientObject=0x80582e0, opcode=2, length=4040, replyWait=0x0, replyWaitRet=0xbfad5d84)
    at dcopclient.cpp:432
#26 0xb760ffb5 in KDE_IceProcessMessages (iceConn=0x8058428, replyWait=0x0, replyReadyRet=0x0) at process.c:326
#27 0xb75fed3d in DCOPClient::processSocketData (this=0x80596c0, fd=6) at dcopclient.cpp:2014
#28 0xb760251a in DCOPClient::qt_invoke (this=0x80596c0, _id=2, _o=0xbfad5f48) at ./dcopclient.moc:176
[snip]

(gdb) cont
Continuing.
KDE Daemon (kded) already running.

Program terminated with signal SIGALRM, Alarm clock.
The program no longer exists.
(gdb) kded: ERROR: Communication problem with kded, it probably crashed.


Here I wondered about SIGALRM; `strace kded --nofork` shows:
[snip]

write(2, "kdecore (KLibLoader): Loading th"..., 69kdecore (KLibLoader): Loading the next library global with flag 257.
) = 69
open("/usr/lib/libcrypto.so.0.9.8", O_RDONLY) = 16
read(16, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\317\3\0004\0\0\0"..., 512) = 512
fstat64(16, {st_mode=S_IFREG|0555, st_size=1509578, ...}) = 0
mmap2(NULL, 1307352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 16, 0) = 0xb5f47000
mmap2(0xb606e000, 86016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 16, 0x127) = 0xb606e000
mmap2(0xb6083000, 13016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6083000
close(16)                               = 0
mprotect(0xb606e000, 32768, PROT_READ)  = 0
write(2, "kdecore (KLibLoader): WARNING: K"..., 107kdecore (KLibLoader): WARNING: KLibrary: /usr/lib/libcrypto.so.0.9.8: undefined symbol: PKCS7_content_free
) = 107
access("/usr/lib/libssl.so.0.9.8", R_OK) = 0
write(2, "kdecore (KLibLoader): Loading th"..., 69kdecore (KLibLoader): Loading the next library global with flag 257.
) = 69
open("/usr/lib/libssl.so.0.9.8", O_RDONLY) = 16
read(16, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\305\0\0004\0\0\0"..., 512) = 512
fstat64(16, {st_mode=S_IFREG|0555, st_size=303328, ...}) = 0
mmap2(NULL, 265016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 16, 0) = 0xb5f06000
mmap2(0xb5f43000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 16, 0x3d) = 0xb5f43000
close(16)                               = 0
mprotect(0xb5f43000, 4096, PROT_READ)   = 0
open("tls/i686/sse2/libz.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/i686/libz.so", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("tls/sse2/libz.so", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("tls/libz.so", O_RDONLY)           = -1 ENOENT (No such file or directory)
open("i686/sse2/libz.so", O_RDONLY)     = -1 ENOENT (No such file or directory)
open("i686/libz.so", O_RDONLY)          = -1 ENOENT (No such file or directory)
open("sse2/libz.so", O_RDONLY)          = -1 ENOENT (No such file or directory)
open("libz.so", O_RDONLY)               = -1 ENOENT (No such file or directory)
open("/home/daniel/i686-pc-linux-gnu/gcc/lib/libz.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/daniel/i686-pc-linux-gnu/gcc/lib/gcc/i686-pc-linux-gnu/4.4.0/libz.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 16
fstat64(16, {st_mode=S_IFREG|0644, st_size=96980, ...}) = 0
mmap2(NULL, 96980, PROT_READ, MAP_PRIVATE, 16, 0) = 0xb5eee000
close(16)                               = 0
open("/lib/libz.so", O_RDONLY)          = 16
read(16, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\24\0\0004\0\0\0"..., 512) = 512
fstat64(16, {st_mode=S_IFREG|0755, st_size=77744, ...}) = 0
close(16)                               = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
rt_sigaction(SIGALRM, {SIG_DFL}, {SIG_DFL}, 8) = 0
alarm(3)                                = 0
rt_sigaction(SIGINT, {SIG_IGN}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [SEGV], 8) = 0
clone(child_stack=0, flags=CLONE_PARENT_SETTID|SIGCHLD, parent_tidptr=0xbf95db94) = 27397
waitpid(27397, KDE Daemon (kded) already running.
0xbf95db98, 0)           = ? ERESTARTSYS (To be restarted)
--- SIGALRM (Alarm clock) @ 0 (0) ---
+++ killed by SIGALRM +++



Excerpt from .xsession-errors (which doesn't seem to show anything unusual):
[...]
kdeinit: Got EXT_EXEC 'kwalletmanager' from launcher.
Could not load library! Trying exec....
kio (KLauncher): kwalletmanager (pid 26878) up and running.
kdeinit: Got EXEC_NEW 'kio_imap4' from launcher.
kio (KLauncher): kio_imap4 (pid 26879) up and running.
DCOP: register 'kwalletmanager' -> number of clients is now 39
DCOP: unregister 'kwalletmanager-2'
DCOP: register 'anonymous-26878' -> number of clients is now 39
DCOP: unregister 'anonymous-26878'
kdeinit: PID 26878 terminated.
DCOP: unregister 'anonymous-26872'
kdeinit: PID 26872 terminated.
kdecore (KNetwork resolver): shouldResInit: /etc/resolv.conf updated
kdeinit: Got EXEC_NEW 'kio_pop3' from launcher.
kio (KLauncher): kio_pop3 (pid 26886) up and running.
kdeinit: Got EXEC_NEW 'kio_pop3' from launcher.
kdecore (KLibLoader): Loading the next library global with flag 257.
kdecore (KLibLoader): WARNING: KLibrary: /usr/lib/libcrypto.so.0.9.8: undefined symbol: PKCS7_content_free
kdecore (KLibLoader): Loading the next library global with flag 257.
kdecore (KLibLoader): WARNING: KLibrary: /usr/lib/libcrypto.so.0.9.8: undefined symbol: OpenSSL_add_all_algorithms
kdecore (KLibLoader): WARNING: KLibrary: /usr/lib/libcrypto.so.0.9.8: undefined symbol: OPENSSL_add_all_algorithms
kdecore (KLibLoader): WARNING: KLibrary: /usr/lib/libcrypto.so.0.9.8: undefined symbol: OpenSSL_add_all_algorithms_conf
kssl: KSSL initialize
kssl: Cipher list is: DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-DSS-CAMELLIA256-SHA:CAMELLIA256-SHA:DES-CBC3-MD5:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-DSS-CAMELLIA128-SHA:CAMELLIA128-SHA:IDEA-CBC-SHA:IDEA-CBC-MD5:RC2-CBC-MD5:RC4-SHA:RC4-MD5:RC4-MD5:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:DES-CBC-MD5
kssl: Cipher list: DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-DSS-CAMELLIA256-SHA:CAMELLIA256-SHA:DES-CBC3-MD5:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-DSS-CAMELLIA128-SHA:CAMELLIA128-SHA:IDEA-CBC-SHA:IDEA-CBC-MD5:RC2-CBC-MD5:RC4-SHA:RC4-MD5:RC4-MD5:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:DES-CBC-MD5
kio_pop3: POP3Protocol::POP3Protocol()
kio (KLauncher): kio_pop3 (pid 26887) up and running.
[...]


Report at bugs.gentoo.org (closed as invalid; proposed solutions didn't work, rebuilt many times since then):
    http://bugs.gentoo.org/show_bug.cgi?id=183061

Request for help at OpenSSL-devel ML, no reply:
    http://www.mail-archive.com/openssl-users@openssl.org/msg51486.html (no reply)


I'd appreciate any pointer to a solution, either KDE-wise or a workaround on my side. This report is submitted using firefox as konqueror can't handle cookies any more ...
Comment 1 David Faure 2008-04-04 10:26:28 UTC
On Friday 04 April 2008, Daniel Franke wrote:
> #0  0xb7f3cf14 in _dl_relocate_object () from /lib/ld-linux.so.2
> #1  0xb7f43a06 in dl_open_worker () from /lib/ld-linux.so.2
> #2  0xb7f3f892 in _dl_catch_error () from /lib/ld-linux.so.2
> #3  0xb7f432ce in _dl_open () from /lib/ld-linux.so.2
> #4  0xb6795c3d in dlopen_doit () from /lib/libdl.so.2
> #5  0xb7f3f892 in _dl_catch_error () from /lib/ld-linux.so.2
> #6  0xb67960dc in _dlerror_run () from /lib/libdl.so.2
> #7  0xb6795b71 in dlopen  GLIBC_2 1 () from /lib/libdl.so.2
> #8  0xb5f3fb5d in dlfcn_load () from /usr/lib/libcrypto.so.0.9.8
> #9  0xb5f407e3 in DSO_load () from /usr/lib/libcrypto.so.0.9.8
> #10 0xb5fa1251 in COMP_zlib () from /usr/lib/libcrypto.so.0.9.8
> #11 0xb5e94a3b in load_builtin_compressions () from /usr/lib/libssl.so.0.9.8
> #12 0xb5e94c32 in SSL_COMP_get_compression_methods () from /usr/lib/libssl.so.0.9.8
> #13 0xb5e9ab69 in SSL_library_init () from /usr/lib/libssl.so.0.9.8
> #14 0xb7d1a6fa in KOpenSSLProxy (this=0x811a600) at kopenssl.cc:579


This is a crash in libssl/libcrypto when dlopening /lib/libz.so, I don't think anything KDE can do about it.

>  I seem to be the only one to encounter this problem


Using binary packages is a good way of making sure you use stable stuff tested by others before you :)
Comment 2 Daniel Franke 2008-04-04 11:35:46 UTC
Recompiling OpenSSL without zlib (USE="-zlib" emerge --oneshot openssl) seems to work - oh my!

> Using binary packages is a good way of making sure you use stable
> stuff tested by others before you. 

Where's the fun in that? :)
Usually I'm quite capable of handling such problems myself, however, this one stunned me for almost a year.

Please excuse the noise.