Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 14 May 2011 10:05:40 -0400
From: "Robert Harris" <rs904c@...scape.net>
To: <john-users@...ts.openwall.com>
Subject: RE: ITIMER_REAL'  error in bench.c

John Users and Alex,

That worked!

Problem setting in bench.c:
#define _XOPEN_SOURCE /* for setitimer(2) */

Setting that fixed bench.c:
#define _XOPEN_SOURCE 500 /* for setitimer(2) */


Alex, 

Why does the number 500 work?   I tried other numbers like 2200, 200, and
400 and they all failed.


-----Original Message-----
From: Solar Designer [mailto:solar@...nwall.com] 
Sent: Friday, May 13, 2011 12:14 PM
To: john-users@...ts.openwall.com
Subject: Re: [john-users] ITIMER_REAL' error in bench.c

Robert, Jim, all -

On Wed, May 11, 2011 at 05:47:08PM -0400, Robert Harris wrote:
> I get the following error trying to compile 
> 
> JtR 1.7.7 and JtR 1.7.7 jumbo 1 on Solaris x86.
> 
> bench.c: In function `benchmark_format':
> bench.c:96: error: storage size of 'it' isn't known
> bench.c:140: warning: implicit declaration of function `setitimer'
> bench.c:140: error: `ITIMER_REAL' undeclared (first use in this function)

This must be a regression introduced with this change:

http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/john/john/src/bench.c
.diff?r1=1.8;r2=1.9

documented as:

"Define _XOPEN_SOURCE for setitimer(2).  Problem seen when compiling
with musl."

musl is an alternative libc for Linux:

http://www.etalabs.net/musl/

Apparently, Solaris thinks that having _XOPEN_SOURCE merely defined
without requesting a specific version of the X/Open specification means
that we want a fairly old version.

Thus, a workaround is to remove "#define _XOPEN_SOURCE" (this breaks
compiles with musl, but should allow the code to compile on Solaris).

A proper fix is to figure out what to replace the "#define _XOPEN_SOURCE"
with.  Maybe replace _XOPEN_SOURCE with _POSIX_SOURCE.  Maybe specify a
version, like:

#define _XOPEN_SOURCE 500

This is what signals.c uses because it also needs siginterrupt(3).

Robert - can you please give "#define _XOPEN_SOURCE 500" a try?  If it
works, this is likely the fix I'll commit.

To give another example, c3_fmt.c uses this weird combination:

#define _XOPEN_SOURCE 4 /* for crypt(3) */
#define _XOPEN_SOURCE_EXTENDED
#define _XOPEN_VERSION 4
#define _XPG4_2

which is needed (based on my experience with popa3d) to get crypt(3)
defined on a variety of systems.

We need to come up with similarly portable yet preferably minimal and
clean settings for getting setitimer(2) defined.  Hopefully, a simple
"#define _XOPEN_SOURCE 500" will be it.

Thanks,

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.