Bug 30640

Summary: crashes during work because no libgcc_s in /var/empty
Product: Sisyphus Reporter: Ivan Zakharyaschev <imz>
Component: pdnsdAssignee: Vladimir D. Seleznev <vseleznv>
Status: CLOSED WORKSFORME QA Contact: qa-sisyphus
Severity: critical    
Priority: P3 CC: vseleznv
Version: unstable   
Hardware: all   
OS: Linux   
Bug Depends on: 30641    
Bug Blocks: 30638    

Description Ivan Zakharyaschev 2015-01-11 01:36:26 MSK
(I don't have a test to reproduce this dependency on libgcc_s deterministically, but I suppose the situation in Sisyphus in this respect is not much different from t6, where I see the crashes in practice.)

+++ This bug was initially created as a clone of Bug #30638 +++

pdns-1.2.7 crashes some time after the start because libgcc_s is missing in /var/empty (its chroot). Its error message before dying is:

libgcc_s.so.1 must be installed for pthread_cancel to work

Here are some last messages from running: 

strace -e trace=file -fF pdnsd -g -v3 --config-file /etc/pdnsd.conf -p /var/run/pdnsd.pid

52 01/11 00:44:00| Using cached record.
52 01/11 00:44:00| Starting cached resolve for: ibigdan.livejournal.com., query AAAA
52 01/11 00:44:00| Record found in cache for ibigdan.livejournal.com.
52 01/11 00:44:00| Requery decision: dflags=0, cflags=0, req=0, neg=0, timed=1, timestamp=0
52 01/11 00:44:00| Trying name servers.
52 01/11 00:44:00| Sending query to 174.35.55.22
52 01/11 00:44:00| Sending query to 66.114.55.22
52 01/11 00:44:00| Caching type AAAA for domain ibigdan.livejournal.com. negative with ttl 600
52 01/11 00:44:00| Query to 174.35.55.22 succeeded.
52 01/11 00:44:00| Outbound msg len 103, tc=0, rc="no error"
52 01/11 00:44:00| Answering to: 192.168.1.13, source address: 192.168.1.2
Process 6227 detached
4 01/11 00:44:11| No query succeeded. Returning error code "server failed"
4 01/11 00:44:11| Outbound msg len 46, tc=0, rc="server failed"
4 01/11 00:44:11| Answering to: 192.168.1.13, source address: 192.168.1.2
Process 6177 detached
6 01/11 00:44:22| No query succeeded. Returning error code "server failed"
6 01/11 00:44:22| Outbound msg len 58, tc=0, rc="server failed"
6 01/11 00:44:22| Answering to: 192.168.1.13, source address: 192.168.1.2
Process 6179 detached
Process 6228 attached (waiting for parent)
Process 6228 resumed (parent 6173 ready)
53 01/11 00:44:22| Received query.
53 01/11 00:44:22| Bad rcode(2).
[pid  6228] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] open("/lib/tls/i686/sse2/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/lib/tls/i686/sse2", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/lib/tls/i686/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/lib/tls/i686", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/lib/tls/sse2/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/lib/tls/sse2", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/lib/tls/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/lib/tls", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/lib/i686/sse2/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/lib/i686/sse2", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/lib/i686/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/lib/i686", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/lib/sse2/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/lib/sse2", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/lib", {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0
[pid  6228] open("/usr/lib/tls/i686/sse2/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/usr/lib/tls/i686/sse2", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/usr/lib/tls/i686/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/usr/lib/tls/i686", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/usr/lib/tls/sse2/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/usr/lib/tls/sse2", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/usr/lib/tls/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/usr/lib/tls", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/usr/lib/i686/sse2/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/usr/lib/i686/sse2", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/usr/lib/i686/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/usr/lib/i686", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/usr/lib/sse2/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/usr/lib/sse2", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  6228] stat64("/usr/lib", 0xb61feb90) = -1 ENOENT (No such file or directory)
[pid  6228] open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
libgcc_s.so.1 must be installed for pthread_cancel to work
[pid  6228] --- SIGABRT (Aborted) @ 0 (0) ---
Process 6228 detached
[pid  6209] +++ killed by SIGABRT +++
Process 6209 detached
[pid  6172] +++ killed by SIGABRT +++
Process 6172 detached
[pid  6171] +++ killed by SIGABRT +++
Process 6171 detached
[pid  6173] +++ killed by SIGABRT +++
Process 6173 detached
+++ killed by SIGABRT +++
Process 6169 detached
Aborted (core dumped)
[root@localhost ~]# 

This dependency is not detectable, at least the following way:

[root@localhost ~]# ldd -r /usr/sbin/pdnsd
	linux-gate.so.1 (0xb7f7d000)
	libpthread.so.0 => /lib/libpthread.so.0 (0xb7f43000)
	libc.so.6 => /lib/libc.so.6 (0xb7dcc000)
	/lib/ld-linux.so.2 (0xb7f7e000)
[root@localhost ~]# ldd -r /lib/libpthread.so.0
	linux-gate.so.1 (0xb7f4c000)
	libc.so.6 => /lib/libc.so.6 (0xb7d9b000)
	/lib/ld-linux.so.2 (0xb7f4d000)
[root@localhost ~]# ldd -r /lib/libc.so.6
	/lib/ld-linux.so.2 (0xb7f32000)
	linux-gate.so.1 (0xb7f31000)
[root@localhost ~]# 


Perhaps, it's a problem of libc or libpthread (so that they are not immediately linked with libgcc_s, and hence crash in an empty chroot), or a problem of pdnsd's chroot configuration (it shouldn't be empty).
Comment 1 Ivan Zakharyaschev 2015-01-11 01:38:15 MSK
The same problem with another chrooted program: https://bugzilla.altlinux.org/show_bug.cgi?id=30639
Comment 2 Vladimir D. Seleznev 2018-11-14 20:47:08 MSK
Does the issue still present? By default pdnsd is chrooting, and in my environment it is working.
Comment 3 Vladimir D. Seleznev 2019-09-08 00:00:20 MSK
Feel free to reopen this bug report.