Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 67188 - openssh compiled with newly unmasked glibc-2.3.4.20040808-r1 causes...
Summary: openssh compiled with newly unmasked glibc-2.3.4.20040808-r1 causes...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-11 19:24 UTC by Jewps
Modified: 2004-11-18 16:33 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
glibc-2.3.4.20040808-r1.restart_warning.patch (glibc-2.3.4.20040808-r1.restart_warning.patch,642 bytes, patch)
2004-10-16 20:36 UTC, Kalin KOZHUHAROV
Details | Diff
glibc-2.3.4.20040808-r1.restart_warning.patch with ebeep and epause (glibc-2.3.4.20040808-r1.restart_warning.patch,555 bytes, patch)
2004-10-16 22:11 UTC, Kalin KOZHUHAROV
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jewps 2004-10-11 19:24:16 UTC
This morning I synced my portage and decided to do a -u world, portage wanted to update glibc to 20040808. Everything was fine until I decided to rebuild SSH with skey support after the glibc update.

Now whenever i try to ssh into the system, I get:

sshd: root@pts/0: relocation error: /lib/libnss_dns.so.2: symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
Connection to xxx closed.



Reproducible: Didn't try
Steps to Reproduce:





I'd post my system info but I cannot get to my system at the moment, I'll update
this bug with the necessary information tomorrow when I get back to work.

Off the top of my head, my cflags are -O2 -mcpu=pentium3 -msse -mmmx -pipe
-fomit-frame-pointer

and I'm not using nptl.
Comment 1 djfunk 2004-10-12 07:09:23 UTC
Is also upgraded my glibc this morning and I didn't recompile ssh but now I can't connect to my server... :

djfunk@dgouju djfunk $ ssh rei
Connection closed by XXX.XXX.XXX.XXX

The exchange of public keys work, but it closes connection after...
Comment 2 Duke 2004-10-12 09:31:17 UTC
Same problem here.
Comment 3 bernard chen 2004-10-12 10:49:34 UTC
I had the same problem -- I emerged glibc-2.3.4.20040808-r1 and openssh stopped working. When I downgraded to glibc-2.3.3-20040420-r2, ssh started working again.
Comment 4 Dariush Molavi 2004-10-12 10:55:04 UTC
same exact problem here...will downgrade glibc when i get home and wait for a fix.
Comment 5 Dariush Molavi 2004-10-12 17:08:47 UTC
ok, well chalk this up to stupidity on my part. restarting sshd fixed it.
Comment 6 Jewps 2004-10-13 00:44:00 UTC
It looks like after recompiling ssh, you should restart ssh so ssh uses the new libraries. I believe that fixed it for me.

Never hurts to try, but that is if you still have access to the box :P

hehe 
Comment 7 djfunk 2004-10-13 04:10:21 UTC
It also crashed my apache 1.3.31 and mod_php 4.3.9:

/usr/sbin/apache: relocation error: /lib/libnss_dns.so.2: symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

Syntax error on line 57 of /etc/apache/conf/apache.conf:
Cannot load /etc/apache/modules/libphp4.so into server: /lib/libresolv.so.2: symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

I'm downgrading my glibc...
Comment 8 Dariush Molavi 2004-10-13 04:49:54 UTC
djfunk: 
i had the exact problem and errors you have. try restarting apache first.  that fixed it for me.
Comment 9 Travis Tilley (RETIRED) gentoo-dev 2004-10-13 10:46:59 UTC
the fix for res_init on amd64+ia64 with newer binutils is now amd64+ia64-only. gmsoft made this change earlier today. can everyone having this problem sync up and re-install glibc?
Comment 10 Kalin KOZHUHAROV 2004-10-16 20:35:22 UTC
Hi there,
I think I found the cause and this is not (may be) exactly glibc bug... you decide.

So I did upgrade glibc on a few machines and then lost contact with them (i.e. cannot ssh into them). I was trying to isolate the bug and found out that sshd needs restarting after (this) glibc upgrade. 

Why? After doing a strace on a misbehaving sshd:
Process 13111 attached - interrupt to quit
select(6, [3], NULL, NULL, NULL)        = 1 (in [3])
accept(3, {sa_family=AF_INET6, sin6_port=htons(32772), inet_pton(AF_INET6, "2001:240:517:1::3", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 4
fcntl64(4, F_SETFL, O_RDONLY)           = 0
pipe([5, 6])                            = 0
fork(Process 4269 attached
)                                  = 4269
[pid 13111] close(6)                    = 0
[pid 13111] getpid()                    = 13111
[pid 13111] getpid()                    = 13111
[pid 13111] close(4)                    = 0
[pid 13111] select(6, [3 5], NULL, NULL, NULL <unfinished ...>
[pid  4269] close(5)                    = 0
[pid  4269] close(3)                    = 0
[pid  4269] setsid()                    = 4269
[pid  4269] alarm(0)                    = 0
[pid  4269] rt_sigaction(SIGALRM, NULL, {SIG_DFL}, 8) = 0

...<snip>...

[pid  4269] close(3)                    = 0
[pid  4269] open("/lib/libnss_dns.so.2", O_RDONLY) = 3
[pid  4269] read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\16"..., 512) = 512
[pid  4269] fstat64(3, {st_mode=S_IFREG|0755, st_size=14464, ...}) = 0
[pid  4269] mmap2(NULL, 12696, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40429000
[pid  4269] mmap2(0x4042c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x3) = 0x4042c000
[pid  4269] close(3)                    = 0
[pid  4269] munmap(0x40417000, 69893)   = 0
[pid  4269] writev(2, [{"sshd: kalin [priv]", 18}, {": ", 2}, {"relocation error", 16}, {": ", 2}, {"/lib/libnss_dns.so.2", 20}, {": ", 2}, {"symbol __res_maybe_init, version"..., 101}, {"", 0}, {"", 0}, {"\n", 1}], 10) = 162
[pid  4269] exit_group(127)             = ?
Process 4269 detached
[pid 13111] <... select resumed> )      = ? ERESTARTNOHAND (To be restarted)
[pid 13111] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid 13111] waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 127}], WNOHANG) = 4269
[pid 13111] waitpid(-1, 0xbfffe714, WNOHANG) = -1 ECHILD (No child processes)
[pid 13111] rt_sigaction(SIGCHLD, NULL, {0x804f500, [], 0}, 8) = 0
[pid 13111] sigreturn()                 = ? (mask now [])
[pid 13111] select(6, [3 5], NULL, NULL, NULL <unfinished ...>
[pid  4270] <... write resumed> )       = 5
[pid  4270] write(3, "\0\0\0\27\3", 5)  = -1 EPIPE (Broken pipe)
[pid  4270] --- SIGPIPE (Broken pipe) @ 0 (0) ---
[pid  4270] time([1097982279])          = 1097982279
[pid  4270] getpid()                    = 4270
[pid  4270] rt_sigaction(SIGPIPE, {0x4024fce0, [], 0}, {SIG_IGN}, 8) = 0
[pid  4270] socket(PF_FILE, SOCK_DGRAM, 0) = 5
[pid  4270] fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
[pid  4270] connect(5, {sa_family=AF_FILE, path="/dev/log"}, 16) = -1 ENOENT (No such file or directory)
[pid  4270] close(5)                    = 0
[pid  4270] rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0
[pid  4270] exit_group(255)             = ?
Process 4270 detached
<... select resumed> )                  = 1 (in [5])
close(5)                                = 0
select(6, [3], NULL, NULL, NULL <unfinished ...>
Process 13111 detached

So, the culprit is /lib/libnss_dns.so.2 which is part of glibc (`etcat -b /lib/libnss_dns.so.2`).
After a lot of Googling, I came up to this thread:
http://sources.redhat.com/ml/libc-hacker/2004-08/msg00004.html

So, I guess the only way (at the moment) is to restart things that use /lib/libnss_dns.so.2 after a glibc upgrade...
Till now openssh and apache2 were found. Any other?

How to handle that in portage? The very least is a patch to warn the user (sending after this) after glibc install.

Is there anyway to check who uses /lib/libnss_dns.so.2 ?? ldd was of no help.

Comment 11 Kalin KOZHUHAROV 2004-10-16 20:36:51 UTC
Created attachment 42004 [details, diff]
glibc-2.3.4.20040808-r1.restart_warning.patch

This is the least that can be done, a warning.

*** Patch untested! ***
Comment 12 Kalin KOZHUHAROV 2004-10-16 22:11:01 UTC
Created attachment 42007 [details, diff]
glibc-2.3.4.20040808-r1.restart_warning.patch with ebeep and epause

Just a quick update of the patch, using ebeep and epause (Thanks Georgi!)
Comment 13 Alex V. Koval 2004-10-21 02:40:46 UTC
hm,

> 1098264395:
Comment 14 Alex V. Koval 2004-10-21 02:40:46 UTC
hm,

> 1098264395:  >>> emerge (5 of 13) sys-libs/glibc-2.3.4.20040808-r1 to /

I have emerged glibs on 3 servers, but /etc/init.d/ssh restart does not work for me to restart ssh after glibc upgrade

this works:
> (killall sshd ; killall -9 sshd ; /etc/init.d/sshd  zap ;  /etc/init.d/sshd start)

it means, that there must be big warning about SSH, and how to restart that... I had to call colocation to restart the server
Comment 15 Quentin Hartman 2004-11-01 15:27:09 UTC
Same here on 17 remote boxes (ugh!). Restart sshd fixes it.
Comment 16 Alexey Bazhin 2004-11-18 02:29:20 UTC
i had this problem too and fixed it _remotely_ by
ssh root@myserver "/etc/init.d/sshd restart"
Comment 17 Jewps 2004-11-18 16:33:16 UTC
I kept getting comments through my email so i thought i'd close this heh..