openssh static build - mission impossible?

Peter Stuge peter at stuge.se
Tue Mar 13 13:49:46 EST 2012


Mr Dash Four wrote:
> What I did was to build a new toolchain for my target arch,

While a good idea per se, as per the original requirements you stated
it is completely overkill. CFLAGS=-Dcrypt=DES_crypt would have been
sufficient, as you could note from earlier emails.


> I am left with one very weird problem though: When I use a "Match"
> statement, which matches on anything from "Address", "Host" or
> "User", sshd chokes and exits with segfault error!

I guess those need the nsswitch functionality which you were sure
that you wouldn't need, back when you were getting warnings about
linking statically against glibc.

Maybe you discovered this.

uclibc is not glibc, so things may be different there.


> Any ideas what might cause this segfault error I am getting?

Not really. Sprinkle printfs across sshd where it is crashing.


Mr Dash Four wrote:
> "strace -ffvrTxo sshd /etc/rc.d/init.d/sshd start"

It will not make any difference in this case, but I recommend doing
away with all irrelevant unknowns when debugging, so better run
/usr/sbin/sshd -ddd instead of that rc script.


>      0.002288 close(4)                  = 0 <0.000275>
>      0.001008 getuid32()                = 0 <0.000153>
>      0.000763 --- SIGSEGV (Segmentation fault) @ 0 (1237ac) ---
> ------8<----------
> 
> So, it seems the offending function is our old friend getuid32()!

No, not at all. getuid32() is shown to complete without error and
after that some code in sshd uses a bad pointer and crashes.


> Any suggestions?

Ideally build sshd with debugging and run it in gdb and get a stack
trace. If you don't want to get or make a suitable gdb then sprinkle
printf() over sshd to find the crash and then the cause.


//Peter


More information about the openssh-unix-dev mailing list