Subject: bug#13768: closed (Re: bug#13768: --without-posix code uses scm_getpid() in libguile-2.0.2)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 25 Feb 2013 19:01:01 +0000

Your bug report

#13768: --without-posix code uses scm_getpid() in libguile-2.0.2

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
13768: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13768
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#13768: --without-posix code uses scm_getpid() in libguile-2.0.2
From: Mark H Weaver <[email-masked]>
To: Andy Wingo <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Mon, 25 Feb 2013 13:58:27 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Andy,

Andy Wingo <[email-masked]> writes:
> Our PRNG is not secure.  We should not be making arguments from the
> perspective of security.  (I think including the PID is a good thing,
> but not because of security.)

Indeed, point well taken.

> Why don't we just add the result of getpid() without relying on the
> scm_getpid() binding.  All platforms have it.

Ah, good!  I didn't know that getpid() was available on MinGW.

> Thanks for following up.  TBH though I would prefer that if you already
> know the solution, to go ahead and fix it instead of writing a mail and
> fixing the docs.

Agreed.  I didn't know the solution until just now.  I have done as you
suggested above, and am now closing this bug.

    Thanks,
      Mark

Subject: --without-posix code uses scm_getpid() in libguile-2.0.2
From: Jan Schukat <[email-masked]>
To: [email-masked]
Date: Wed, 20 Feb 2013 00:38:15 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

I'm experimenting a little with statically linking a minimal build of 
libguile. So while no one really would want to build it it with 
--without-posix (except when you want the same functionality on all 
platforms including windows in your program), and this is a low priority 
bug and I can easily fix it myself for my purposes, it is still a bug.

What happens is, in random.c in random_state_of_last_resort on line 668 
scm_getpid is used to seed the random generator. So either a 
preprocessor switch or a hand constructed scm like in scm_getpid 
(scm_from_ulong(getpid())) should be used there.

Regards