<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugzilla.globus.org/bugzilla/bugzilla.dtd">

<bugzilla version="3.2.3"
          urlbase="http://bugzilla.globus.org/bugzilla/"
          maintainer="bacon@mcs.anl.gov"
>

    <bug>
          <bug_id>6563</bug_id>
          
          <creation_ts>2008-12-05 09:18</creation_ts>
          <short_desc>statically linked gsi-enabled sshd segmentation fault</short_desc>
          <delta_ts>2009-02-25 13:52:04</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>GSI-OpenSSH</product>
          <component>GSI-OpenSSH</component>
          <version>4.2.0</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          <bug_file_loc>http://lists.globus.org/pipermail/gsi-openssh-user/2008-November/000008.html</bug_file_loc>
          
          
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jim Basney">jbasney@ncsa.uiuc.edu</reporter>
          <assigned_to name="Jim Basney">jbasney@ncsa.uiuc.edu</assigned_to>
          <cc>vwelch@uiuc.edu</cc>

      

      
          <long_desc isprivate="0">
            <who name="Jim Basney">jbasney@ncsa.uiuc.edu</who>
            <bug_when>2008-12-05 09:18:52</bug_when>
            <thetext>Andreas Maier wrote:
&gt; Hello,
&gt; 
&gt; I tried to compile a static version of gsissh from globus-toolkit v4.2.1
&gt; using
&gt; 
&gt;&gt; ./configure --prefix=/home/globus
&gt;&gt; --with-gsiopensshargs=&quot;--with-globus-static 
&gt; --with-ldflags=&quot;-static&quot;&quot;
&gt; 
&gt; After calling
&gt;&gt; make gsi-openssh 2&gt;&amp;1 | tee make.log
&gt;&gt; make install
&gt; 
&gt; I get a binary with no dynamically linked libraries
&gt; 
&gt;&gt; ldd sshd
&gt; not a dynamic executable
&gt; 
&gt; I started sshd with
&gt; 
&gt;&gt; ulimit -s 1000000  # just to make sure we have no stack problem
&gt;&gt; sudo strace /home/lu64lay/globus2/sbin/sshd -p 1234 -ddd
&gt; 
&gt; I tried to connect to sshd using
&gt; 
&gt;&gt; gsissh -p 1234 localhost
&gt; 
&gt; However sshd generates a segmentation fault at connection time as you
&gt; can see
&gt; from the strace output (see below).
&gt; 
&gt; Is this a bug in sshd? Or do I have to generate gsissh with different
&gt; options to get a working static executable? Is it possible at all to make
&gt; a static version of gsissh?
&gt; 
&gt; Any help will be appreciated.
&gt; 
&gt; Andreas Maier
&gt; 
&gt; P.S.:
&gt; 
&gt; ....
&gt; 
&gt;  write(2, &quot;debug2: parse_server_config: con&quot;..., 62debug2:
&gt; parse_server_config:
&gt; config reprocess config len 329
&gt; ) = 62
&gt; write(2, &quot;debug1: Config token is protocol&quot;..., 34debug1: Config token
&gt; is protocol
&gt; ) = 34
&gt; write(2, &quot;debug1: Config token is rsaauthe&quot;..., 43debug1: Config token is
&gt; rsaauthentication
&gt; ) = 43
&gt; write(2, &quot;debug1: Config token is pubkeyau&quot;..., 46debug1: Config token is
&gt; pubkeyauthentication
&gt; ) = 46
&gt; write(2, &quot;debug1: Config token is challeng&quot;..., 57debug1: Config token is
&gt; challengeresponseauthentication
&gt; ) = 57
&gt; write(2, &quot;debug1: Config token is x11forwa&quot;..., 39debug1: Config token is
&gt; x11forwarding
&gt; ) = 39
&gt; write(2, &quot;debug1: Config token is useprivi&quot;..., 48debug1: Config token is
&gt; useprivilegeseparation
&gt; ) = 48
&gt; write(2, &quot;debug1: Config token is subsyste&quot;..., 35debug1: Config token
&gt; is subsystem
&gt; ) = 35
&gt; open(&quot;/etc/ld.so.cache&quot;, O_RDONLY)      = 5
&gt; fstat(5, {st_mode=S_IFREG|0644, st_size=159215, ...}) = 0
&gt; mmap(NULL, 159215, PROT_READ, MAP_PRIVATE, 5, 0) = 0x2b8f8b72f000
&gt; close(5)                                = 0
&gt; open(&quot;/lib64/libnss_compat.so.2&quot;, O_RDONLY) = 5
&gt; read(5, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&gt;\0\1\0\0\0\320\26\0&quot;...,
&gt; 832) = 832
&gt; fstat(5, {st_mode=S_IFREG|0755, st_size=38678, ...}) = 0
&gt; mmap(NULL, 1078536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) =
&gt; 0x2b8f8b756000
&gt; madvise(0x2b8f8b756000, 1078536, MADV_SEQUENTIAL|0x1) = 0
&gt; mprotect(0x2b8f8b75d000, 1044480, PROT_NONE) = 0
&gt; mmap(0x2b8f8b85c000, 8192, PROT_READ|PROT_WRITE,
&gt; MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x6000) = 0x2b8f8b85c000
&gt; close(5)                                = 0
&gt; open(&quot;/lib64/libnsl.so.1&quot;, O_RDONLY)    = 5
&gt; read(5, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&gt;\0\1\0\0\0000H\0\0&quot;...,
&gt; 832) = 832
&gt; fstat(5, {st_mode=S_IFREG|0755, st_size=99531, ...}) = 0
&gt; mmap(NULL, 1136936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) =
&gt; 0x2b8f8b85e000
&gt; madvise(0x2b8f8b85e000, 1136936, MADV_SEQUENTIAL|0x1) = 0
&gt; mprotect(0x2b8f8b871000, 1044480, PROT_NONE) = 0
&gt; mmap(0x2b8f8b970000, 8192, PROT_READ|PROT_WRITE,
&gt; MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x12000) = 0x2b8f8b970000
&gt; mmap(0x2b8f8b972000, 6440, PROT_READ|PROT_WRITE,
&gt; MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b8f8b972000
&gt; close(5)                                = 0
&gt; munmap(0x2b8f8b72f000, 159215)          = 0
&gt; open(&quot;/etc/nsswitch.conf&quot;, O_RDONLY)    = 5
&gt; fstat(5, {st_mode=S_IFREG|0644, st_size=1201, ...}) = 0
&gt; mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
&gt; 0x2b8f8b72f000
&gt; read(5, &quot;#\n# /etc/nsswitch.conf\n#\n# An ex&quot;..., 4096) = 1201
&gt; read(5, &quot;&quot;, 4096)                       = 0
&gt; close(5)                                = 0
&gt; munmap(0x2b8f8b72f000, 4096)            = 0
&gt; open(&quot;/etc/ld.so.cache&quot;, O_RDONLY)      = 5
&gt; fstat(5, {st_mode=S_IFREG|0644, st_size=159215, ...}) = 0
&gt; mmap(NULL, 159215, PROT_READ, MAP_PRIVATE, 5, 0) = 0x2b8f8b72f000
&gt; close(5)                                = 0
&gt; open(&quot;/lib64/libnss_nis.so.2&quot;, O_RDONLY) = 5
&gt; read(5, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&gt;\0\1\0\0\0\320$\0\0&quot;...,
&gt; 832) = 832
&gt; fstat(5, {st_mode=S_IFREG|0755, st_size=53187, ...}) = 0
&gt; mmap(NULL, 1090744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) =
&gt; 0x2b8f8b974000
&gt; madvise(0x2b8f8b974000, 1090744, MADV_SEQUENTIAL|0x1) = 0
&gt; mprotect(0x2b8f8b97d000, 1048576, PROT_NONE) = 0
&gt; mmap(0x2b8f8ba7d000, 8192, PROT_READ|PROT_WRITE,
&gt; MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x9000) = 0x2b8f8ba7d000
&gt; close(5)                                = 0
&gt; munmap(0x2b8f8b72f000, 159215)          = 0
&gt; open(&quot;/etc/shadow&quot;, O_RDONLY)           = 5
&gt; fcntl(5, F_GETFD)                       = 0
&gt; fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
&gt; lseek(5, 0, SEEK_CUR)                   = 0
&gt; fstat(5, {st_mode=S_IFREG|0640, st_size=495, ...}) = 0
&gt; mmap(NULL, 495, PROT_READ, MAP_SHARED, 5, 0) = 0x2b8f8b72f000
&gt; lseek(5, 495, SEEK_SET)                 = 495
&gt; fstat(5, {st_mode=S_IFREG|0640, st_size=495, ...}) = 0
&gt; munmap(0x2b8f8b72f000, 495)             = 0
&gt; close(5)                                = 0
&gt; open(&quot;/etc/ld.so.cache&quot;, O_RDONLY)      = 5
&gt; fstat(5, {st_mode=S_IFREG|0644, st_size=159215, ...}) = 0
&gt; mmap(NULL, 159215, PROT_READ, MAP_PRIVATE, 5, 0) = 0x2b8f8b72f000
&gt; close(5)                                = 0
&gt; open(&quot;/lib64/libnss_winbind.so.2&quot;, O_RDONLY) = 5
&gt; read(5, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&gt;\0\1\0\0\0 \27\0\0&quot;...,
&gt; 832) = 832
&gt; fstat(5, {st_mode=S_IFREG|0755, st_size=23616, ...}) = 0
&gt; mmap(NULL, 1091664, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) =
&gt; 0x2b8f8ba7f000
&gt; madvise(0x2b8f8ba7f000, 1091664, MADV_SEQUENTIAL|0x1) = 0
&gt; mprotect(0x2b8f8ba84000, 1048576, PROT_NONE) = 0
&gt; mmap(0x2b8f8bb84000, 4096, PROT_READ|PROT_WRITE,
&gt; MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x5000) = 0x2b8f8bb84000
&gt; mmap(0x2b8f8bb85000, 18512, PROT_READ|PROT_WRITE,
&gt; MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b8f8bb85000
&gt; close(5)                                = 0
&gt; open(&quot;/lib64/libpthread.so.0&quot;, O_RDONLY) = 5
&gt; read(5, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&gt;\0\1\0\0\0 Z\0\0\0&quot;...,
&gt; 832) = 832
&gt; fstat(5, {st_mode=S_IFREG|0755, st_size=123722, ...}) = 0
&gt; mmap(NULL, 1147768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) =
&gt; 0x2b8f8bb8a000
&gt; madvise(0x2b8f8bb8a000, 1147768, MADV_SEQUENTIAL|0x1) = 0
&gt; mprotect(0x2b8f8bb9e000, 1044480, PROT_NONE) = 0
&gt; mmap(0x2b8f8bc9d000, 8192, PROT_READ|PROT_WRITE,
&gt; MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x13000) = 0x2b8f8bc9d000
&gt; mmap(0x2b8f8bc9f000, 13176, PROT_READ|PROT_WRITE,
&gt; MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b8f8bc9f000
&gt; close(5)                                = 0
&gt; set_tid_address(0x7d98f0)               = 23203
&gt; rt_sigaction(SIGRTMIN, {0x2b8f8bb8f5d0, [], SA_RESTORER|SA_SIGINFO,
&gt; 0x2b8f8bb97c00}, NULL, 8) = 0
&gt; rt_sigaction(SIGRT_1, {0x2b8f8bb8f520, [],
&gt; SA_RESTORER|SA_RESTART|SA_SIGINFO,
&gt; 0x2b8f8bb97c00}, NULL, 8) = 0
&gt; rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
&gt; getrlimit(RLIMIT_STACK, {rlim_cur=1000000*1024, rlim_max=1000000*1024}) = 0
&gt; --- SIGSEGV (Segmentation fault) @ 0 (0) ---
&gt; +++ killed by SIGSEGV +++
&gt;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Jim Basney">jbasney@ncsa.uiuc.edu</who>
            <bug_when>2008-12-05 09:19:51</bug_when>
            <thetext>Andreas Maier wrote:
&gt; Jim Basney wrote:
&gt;&gt; - What platform and operating system are you using?
&gt; 
&gt; I use Suse Linux Enterprise Desktop 10.2 (64 bit)
&gt;&gt; uname -a
&gt; Linux xx01 2.6.16.60-0.31-smp #1 SMP Tue Oct 7 16:16:29 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux
&gt; 
&gt;&gt; - Does the problem also occur when using
&gt;&gt;   &quot;sshd -ddd -o &apos;UsePrivilegeSeparation no&apos; -r&quot;?
&gt; 
&gt; This didn&apos;t change anything.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Jim Basney">jbasney@ncsa.uiuc.edu</who>
            <bug_when>2009-02-25 13:52:04</bug_when>
            <thetext>I finally found some time to look into this. It&apos;s a messy issue with glibc and NSS. There&apos;s some info at:
  http://www.gnu.org/software/libc/FAQ.html#s-2.22
It depends on glibc version, NSS configuration, etc. It&apos;s not specific to GSI-OpenSSH. The same occurs for static compiles of vanilla OpenSSH. Using --with-globus-static (i.e., static linking against Globus libraries) works OK. It&apos;s the --with-ldflags=&quot;-static&quot; (static linking against system libraries) that fails.

I don&apos;t see anything I can do about this. I&apos;m going to close this ticket as WONTFIX.</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>