Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 15 May 2014 13:40:13 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: Re: c3 format broken w/ OMP on Solaris 11

magnum,

On Thu, May 15, 2014 at 12:17:47AM +0200, magnum wrote:
> I see a problem on Sparc Solaris 11 w/ gcc 4.5.2 building the crypt(3) 
> format with OpenMP. I was testing Jumbo but this is a core problem.
> 
> The problem is this pragma:
> #pragma omp parallel for default(none) private(index) shared(warned, 
> count, crypt_out, saved_key, saved_salt, stderr)
> 
> Compiler dies unless I change it do either
> #pragma omp parallel for default(none) private(index) shared(warned, 
> count, crypt_out, saved_key, saved_salt, __iob)
> 
> ...or just (That block is '#if __sun' and I'm not 100% sure __iob will 
> work on just *any* __sun?)
> #pragma omp parallel for

Right.  This was reported to me before, and I recorded it as:

"1.8.0's c3_fmt.c fails to build with OpenMP on Solaris (needs __iob)"

I should fix it for 1.8.1.

> However, after fixing that I still have some problems. First, it does 
> not actually seem to use OMP although it prints it does:
> 
> Warning: OpenMP is disabled; a non-OpenMP build may be faster
> Benchmarking: crypt, generic crypt(3) DES [?/32]... DONE
> Many salts:     864 c/s real, 872 c/s virtual
> Only one salt:  872 c/s real, 872 c/s virtual
> 
> Will run 8 OpenMP threads
> Benchmarking: crypt, generic crypt(3) DES [?/32]... (8xOMP) DONE
> Many salts:     855 c/s real, 838 c/s virtual
> Only one salt:  864 c/s real, 842 c/s virtual

That's because Solaris' descrypt code has a mutex in it (I think).  You
need to test on a hash type that we actually care to use this generic
code with - e.g., sha512crypt and SunMD5 show decent OpenMP scaling.
(Of course, jumbo's code for these is faster yet.)

> Second, only seen in --test=0 (all formats) runs so far, it sometimes 
> just hangs after printing this:
> Testing: crypt, generic crypt(3) DES [?/32]... (8xOMP)
> 
> It hangs forever with 0% CPU load. I don't actually care about this 
> (we're just doing Jumbo BE tests :) but now you have been notified.

Oh, this is a new thing.  Sounds like they might have a deadlock in
(des)crypt code - maybe they try to acquire more than one lock?  You
could want to investigate this and report a Solaris bug.

> BTW the man page on that machine does state that crypt() is MT safe.

Yes, Solaris' crypt() is documented as MT-safe, and we rely on that.

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.