Bug 600 - compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02
Summary: compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: ix86 Other
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-22 20:28 AEST by johnf
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments
Contains the output of ./configure (408.47 KB, text/plain)
2003-06-22 20:30 AEST, johnf
no flags Details
configure.gz: rebuilt with extra defines for NCR MP-RAS (57.04 KB, application/octet-stream)
2003-06-29 17:10 AEST, Darren Tucker
no flags Details
output of 'make' after running the new attachment 'configure.gz' on 3.6.1p2 (2.97 KB, text/plain)
2003-06-30 17:25 AEST, johnf
no flags Details
Attempt to fix configure for NCR MP-RAS (1.35 KB, patch)
2003-06-30 19:30 AEST, Darren Tucker
no flags Details | Diff
New (gzip'ed) configure for MP-RAS made with previous attachment. (1.35 KB, application/octet-stream)
2003-06-30 19:34 AEST, Darren Tucker
no flags Details
New (gzip'ed) configure for MP-RAS made with previous attachment. (57.13 KB, application/octet-stream)
2003-06-30 19:35 AEST, Darren Tucker
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description johnf 2003-06-22 20:28:55 AEST
ssh, sshd, ssh-add, ssh-keygen, ssh-keyscan, ssh-keysign, and ssh-agent
appear to compile fine. Here's where it fails:


        cc -g -I. -I. -I/usr/local/ssl/include  -I/usr/local/include -DSSHDIR=\"
/usr/local/etc\"  -D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\"  -D_PATH_SSH_ASKPAS
S_DEFAULT=\"/usr/local/libexec/ssh-askpass\"  -D_PATH_SFTP_SERVER=\"/usr/local/l
ibexec/sftp-server\"  -D_PATH_SSH_KEY_SIGN=\"/usr/local/libexec/ssh-keysign\"  -
D_PATH_SSH_PIDDIR=\"/usr/local/etc\"  -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\"
 -DSSH_RAND_HELPER=\"/usr/local/libexec/ssh-rand-helper\" -DHAVE_CONFIG_H -c ssh
-rand-helper.c
E "ssh-rand-helper.c",L252/C16(#444):   ru
|    Type `double stir_rusage(int who,double entropy_estimate)::struct rusage' (
"ssh-rand-helper.c",L252/C9) of variable is a yet undefined struct/union.
E "ssh-rand-helper.c",L257/C23(#80):    ru
|    sizeof can't be applied to an incomplete struct/union.
w "ssh-rand-helper.c",L712/C30(#257):   '=' encountered where '==' may have been
 intended.
2 user errors   1 warning
*** Error code 2 (bu21)

make: fatal error.

I will add the config.log file as an attachment.
Comment 1 johnf 2003-06-22 20:30:53 AEST
Created attachment 331 [details]
Contains the output of ./configure
Comment 2 Darren Tucker 2003-06-22 21:00:11 AEST
I would guess that "struct rusage" is defined in a header file that is not 
included.  Try grepping /usr/include to find which header it is, then try 
#include'ing it in ssh-rand-helper.c to see if it fixes the problem.  Then tell 
us which one it is :-)
Comment 3 johnf 2003-06-25 14:00:11 AEST
I found rusage in /usr/include/sys/resource.h

I tried to add the following just after the first "#include" statement
in ssh-rand-helper.c. Still getting the same error:

1. #include "sys/resource.h"
2. #include <resource.h>
3. I even copied /usr/include/sys/resource.h into /usr/local/include
   (make shows "-I/usr/local/include" somewhere in the compilation)
   That didn't work either.

I also modified config.h and changed HAS_GETRUSAGE(?) from 1 to 0. Still
the same problem. In the end, I just commented the following code starting
in line 252 in ssh-rand-helper.c:

        struct rusage ru;

        if (getrusage(who, &ru) == -1)
                return 0;

        RAND_add(&ru, sizeof(ru), entropy_estimate);

        return entropy_estimate;

and replaced it with "return 0", just like in the "#else" part
of the "#ifdef" statement. All the rest of the programs compiled
fine.

I didn't run "make install" yet though because I'm not sure what
the effect of changing the code above to just one line (return 0)
would do.

Pls. let me know if it's fine to run "make install" even though
I changed my version of ssh-rand-helper.c. Just a reminder, this
is the newest source: 3.6.1p2. Thanks!
Comment 4 Damien Miller 2003-06-28 17:58:52 AEST
1. Changing the HAS_GETRUSAGE to 0 will not help, you need to comment out the
#define altogether

2. For some reason, configure is finding rusage but it is not in the headers
that we are including. Please try the following command (or equivalent):

find /usr/include -type f -exec grep rusage {} /dev/null \;

and report which files are matched.

Your system probably has what we need tucked away in some weird header file.
Comment 5 johnf 2003-06-28 20:01:58 AEST
Hi,

The rusage function(?) is in /usr/include/sys/resource.h.

I'll comment the whole HAS_GETRUSAGE section in config.h and
will recompile.

I also had problems about "no controlling tty". I found another
post that says to add "#...CTTY 1". After I did that, ssh worked.

JohnF
Comment 6 Damien Miller 2003-06-28 20:21:42 AEST
> The rusage function(?) is in /usr/include/sys/resource.h.

We are after the definition of "struct rusage", not so much the functions. 

Try manually adding '#include <sys/resource.h>' to ssh-rand-helper.c just before
the '#include "misc.h"' line near the top of the file.

If that doesn't work, try the find command I mentioned and attach the results to
this bug.
Comment 7 johnf 2003-06-29 13:44:10 AEST
Hi,

Adding "#include <sys/resource.h>" didn't help. Got the same error.

Here's the output of the "find" command:

/usr/include/sys/resource.h:struct rusage {
/usr/include/sys/resource.h:extern int getrusage(int, struct rusage *);
/usr/include/sys/wait.h:extern pid_t wait3(int *, int, struct rusage *);

Commenting the whole "#define HAVE_GETRUSAGE 1" line in config.h
succeeds and compilation goes ok all the way with no problems.

JohnF
Comment 8 Darren Tucker 2003-06-29 17:10:20 AEST
Created attachment 343 [details]
configure.gz: rebuilt with extra defines for NCR MP-RAS

Should have remembered this earlier (this was added after 3.6.1p2):
$ cvs log configure.ac
[snip]
revision 1.124
date: 2003/05/30 07:43:42;  author: dtucker;  state: Exp;  lines: +3 -1
 - (dtucker) Define SSHD_ACQUIRES_CTTY for NCR MP-RAS and Reliant Unix.

I'm pretty sure these are required.  I also want to add -D_XOPEN_SOURCE=1
-D_XOPEN_SOURCE_EXTENDED=1 to CPPFLAGS for MP-RAS but I haven't had
confirmation
that it will not break anything else.
[end quote]

Please try the attached (gzip'ed) configure file, which is from 3.6.1p2 with
both sets of defines added.  You shouldn't need any other flags or changes,
hopefully configure will get it right.
Comment 9 johnf 2003-06-30 17:25:31 AEST
Created attachment 345 [details]
output of 'make' after running the new attachment 'configure.gz' on 3.6.1p2
Comment 10 johnf 2003-06-30 17:27:46 AEST
Comment on attachment 345 [details]
output of 'make' after running the new attachment 'configure.gz' on 3.6.1p2

Using the configure.gz
that was attached here
breaks the compilation
real bad. Just commenting "HAVE_GETRUSAGE" and adding the "#define ....CTTY 1"
makes everything work"
Comment 11 Darren Tucker 2003-06-30 19:30:59 AEST
Created attachment 346 [details]
Attempt to fix configure for NCR MP-RAS

Ouch.  You appear to have system headers that blow up when those XOPEN defines
are defined.

We can try only defining HAVE_GETRUSAGE if getrusage() is defined AND can be
linked, as opposed to just if it can be linked (patch attached).

I'll attach a new configure rebuilt with this patch to test in a few minutes.
Comment 12 Darren Tucker 2003-06-30 19:34:05 AEST
Created attachment 347 [details]
New (gzip'ed) configure for MP-RAS made with previous attachment.
Comment 13 Darren Tucker 2003-06-30 19:35:54 AEST
Created attachment 348 [details]
New (gzip'ed) configure for MP-RAS made with previous attachment.
Comment 14 johnf 2003-07-03 13:15:27 AEST
Hi,

I'm confused here. Attachment 347 [details] shows a configure.ac patch file while
attachment 348 [details] shows a gzipped configure. Anyway, here's what I did:

1. download attachment 348 [details] (the one dated 2003-06-30 19:35 above)
2. extracted openssh-3.6.1p2.tar.gz to another directory
3. replaced the 'configure' file that came with openssh-3.6.1p2 with
   attachment 348 [details]
4. ./configure
5. make

The compilation finished. I haven't run 'make install' yet.
JohnF 
Comment 15 Darren Tucker 2003-07-03 13:34:45 AEST
"configure" is generated by autoconf from "configure.ac", so the changes are 
made to configure.ac but you need autoconf (I used v2.53) and gnu m4 to rebuild 
configure.

Attachment #346 [details] is the patch, #347 and #348 are the resulting configure file (a 
network hiccup meant that it was submitted twice).

I attached the patch so people could see what was changed and the rebuilt 
configure so it's easy to test.  If it runs OK for you and there are no 
objections I'll commit patch #346.
Comment 16 Darren Tucker 2003-07-07 19:46:09 AEST
Attachment #346 [details] applied.  Please reopen if this is not resolved or a new bug if 
there are further problems.
Comment 17 Damien Miller 2004-04-14 12:24:19 AEST
Mass change of RESOLVED bugs to CLOSED