[Pharo-dev] Random number generator bug?

Max Leske maxleske at gmail.com
Wed Jun 29 04:11:11 EDT 2016


> On 29 Jun 2016, at 10:07, Max Leske <maxleske at gmail.com> wrote:
> 
> Same here of OS X 10.11 in Pharo 6. Not reproducible.

Same for Pharo 4. Are you sure there’s not another process that uses the generator unprotected?

> 
> Max
> 
>> On 29 Jun 2016, at 09:34, Ben Coman <btc at openInWorld.com> wrote:
>> 
>> On Windows 7,  I tried two case and could not reproduce this.
>> 
>> 1. Pharo-40611
>> C:\#Pharo\Pharo4.0\Pharo.exe
>> NBCoInterpreter NativeBoost-CogPlugin-HolgerHansPeterFreyther.21 uuid:
>> e0df6e2d-5694-40e2-8035-dc217200b424 Sep 25 2014
>> NBCogit NativeBoost-CogPlugin-HolgerHansPeterFreyther.21 uuid:
>> e0df6e2d-5694-40e2-8035-dc217200b424 Sep 25 2014
>> 
>> Note the same VM as yours
>> 
>> 2. Pharo-50554
>> C:\#Pharo\PharoSpur\Pharo.exe
>> CoInterpreter VMMaker.oscog-eem.1630 uuid:
>> 2ed025ea-f400-4440-8e8b-5aa46d06c9ab Jan 14 2016
>> StackToRegisterMappingCogit VMMaker.oscog-eem.1630 uuid:
>> 2ed025ea-f400-4440-8e8b-5aa46d06c9ab Jan 14 2016
>> https://github.com/estebanlm/pharo-vm.git Commit:
>> 21ec004cce7d26010c18d357c805a0e1a4ffe376 Date: 2016-01-14 11:42:33
>> +0100 By: Esteban Lorenzano <estebanlm at gmail.com> Jenkins build #498
>> 
>> Could you try some other combinations of machine/VM/image?
>> 
>> cheers -ben
>> 
>> On Wed, Jun 29, 2016 at 12:15 PM, Benoit St-Jean via Pharo-dev
>> <pharo-dev at lists.pharo.org> wrote:
>>> 
>>> 
>>> ---------- Forwarded message ----------
>>> From: Benoit St-Jean <bstjean at yahoo.com>
>>> To: Pharo Development List <pharo-dev at lists.pharo.org>
>>> Cc:
>>> Date: Wed, 29 Jun 2016 04:13:57 +0000 (UTC)
>>> Subject: Random number generator bug?
>>> I'm having problems understanding why the Integer>>#atRandom sometimes return a number greater than the receiver.
>>> 
>>> This problem only occurs when forking processes that generate random number using the above mentioned method.  Obviously, all processes share the same RNG from the Collection class.
>>> 
>>> Code below can reproduce (most of the time) the bug.
>>> 
>>> | n |
>>> n := 3172918.
>>> 5 timesRepeat: [ [n timesRepeat: [ | alea |
>>>                                   alea := n atRandom.
>>>                                   (alea > n) ifTrue: [ self halt]]] forkAt: Processor userBackgroundPriority ].
>>> 
>>> I'm on Windows 10, Pharo4.0 Latest update: #40627.
>>> 
>>> Pertinent System Reporter info below:
>>> 
>>> Virtual Machine
>>> ---------------
>>> F:\Pharo4\Pharo4.0\Pharo.exe
>>> NBCoInterpreter NativeBoost-CogPlugin-HolgerHansPeterFreyther.21 uuid: e0df6e2d-5694-40e2-8035-dc217200b424 Sep 25 2014
>>> NBCogit NativeBoost-CogPlugin-HolgerHansPeterFreyther.21 uuid: e0df6e2d-5694-40e2-8035-dc217200b424 Sep 25 2014
>>> https://github.com/pharo-project/pharo-vm.git Commit: 81b5d19917dcb78f22482a780deec48c53738396 Date: 2014-09-20 14:36:18 +0200 By: Esteban Lorenzano <estebanlm at gmail.com> Jenkins build #14858
>>> 
>>> Win32 built on Sep 25 2014 17:47:04 Compiler: 4.6.2
>>> VMMaker versionString https://github.com/pharo-project/pharo-vm.git Commit: 81b5d19917dcb78f22482a780deec48c53738396 Date: 2014-09-20 14:36:18 +0200 By: Esteban Lorenzano <estebanlm at gmail.com> Jenkins build #14858
>>> NBCoInterpreter NativeBoost-CogPlugin-HolgerHansPeterFreyther.21 uuid: e0df6e2d-5694-40e2-8035-dc217200b424 Sep 25 2014
>>> NBCogit NativeBoost-CogPlugin-HolgerHansPeterFreyther.21 uuid: e0df6e2d-5694-40e2-8035-dc217200b424 Sep 25 2014
>>> 
>>> Loaded VM Modules
>>> -----------------
>>> B2DPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> BitBltPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> FT2Plugin Freetype-Plugin-IgorStasenko.64 (e)
>>> FilePlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> FloatArrayPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> JPEGReadWriter2Plugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> Kernel32
>>> LargeIntegers v1.5 VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> LocalePlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> Matrix2x3Plugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> MiscPrimitivePlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> NativeBoostPlugin NativeBoost-CogPlugin-HolgerHansPeterFreyther.21 (i)
>>> SecurityPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> ZipPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> 
>>> VM Built-in Modules
>>> -------------------
>>> ADPCMCodecPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> AsynchFilePlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> B2DPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> B3DAcceleratorPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> BMPReadWriterPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> BitBltPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> CroquetPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> DSAPrims VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> DropPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> FFTPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> FilePlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> FloatArrayPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> FloatMathPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> HostWindowPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> IA32ABI VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> JPEGReadWriter2Plugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> JPEGReaderPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> JoystickTabletPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> Klatt VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> LargeIntegers v1.5 VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> LocalePlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> MIDIPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> Matrix2x3Plugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> MiscPrimitivePlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> Mpeg3Plugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> NativeBoostPlugin NativeBoost-CogPlugin-HolgerHansPeterFreyther.21 (i)
>>> RePlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> SecurityPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> SerialPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> SocketPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> SoundCodecPrims VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> SoundPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> StarSqueakPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> SurfacePlugin Sep 25 2014 (i)
>>> UUIDPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> Win32OSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-EstebanLorenzano.43 (i)
>>> ZipPlugin VMMaker.oscog-jeanbaptistearnaud.783 (i)
>>> 
>>> VM Configuration
>>> ----------------
>>> F:\Pharo4\Pharo4.0\Pharo.ini
>>> [Global]
>>> DeferUpdate=1
>>> ShowConsole=0
>>> DynamicConsole=1
>>> ReduceCPUUsage=0
>>> ReduceCPUInBackground=0
>>> 3ButtonMouse=0
>>> 1ButtonMouse=0
>>> UseDirectSound=1
>>> PriorityBoost=0
>>> B3DXUsesOpenGL=0
>>> CaseSensitiveFileMode=0
>>> 
>>> Operating System/Hardware
>>> -------------------------
>>> Win32 6.2 IX86
>>> 
>>> Hardware Details
>>> ----------------
>>> Hardware information:
>>>   Manufacturer: Unknown
>>>   Model: Unknown
>>>   Number of processors: 4
>>>   Page size: 4096
>>> 
>>> Memory Information (upon launch):
>>>   Physical Memory Size: 2097151 kbytes
>>>   Physical Memory Free: 2097151 kbytes
>>>   Page File Size: 4194303 kbytes
>>>   Page File Free: 4194303 kbytes
>>>   Virtual Memory Size: 2097024 kbytes
>>>   Virtual Memory Free: 2015568 kbytes
>>>   Memory Load: 45 percent
>>> 
>>> Processor 0: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
>>>   Identifier: Intel64 Family 6 Model 94 Stepping 3
>>>   ~MHZ: 2712
>>> 
>>> Processor 1: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
>>>   Identifier: Intel64 Family 6 Model 94 Stepping 3
>>>   ~MHZ: 2712
>>> 
>>> Processor 2: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
>>>   Identifier: Intel64 Family 6 Model 94 Stepping 3
>>>   ~MHZ: 2712
>>> 
>>> Processor 3: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
>>>   Identifier: Intel64 Family 6 Model 94 Stepping 3
>>>   ~MHZ: 2712
>>> 
>>> Graphics Hardware Details
>>> -------------------------
>>> Display Information:
>>>   Graphics adapter name: Intel(R) HD Graphics 530
>>>   Primary monitor resolution: 1280 x 720
>>> 
>>> Device: ???
>>>   Adapter String: Intel(R) HD Graphics 530
>>>   Bios String: Intel Video BIOS
>>>   Chip Type: Intel(R) HD Graphics Family
>>>   DAC Type: Internal
>>>   Memory Size: 0x40000000
>>> 
>>> Driver Versions:
>>>   igdumdim64:
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -----------------
>>> Benoît St-Jean
>>> Yahoo! Messenger: bstjean
>>> Twitter: @BenLeChialeux
>>> Pinterest: benoitstjean
>>> Instagram: Chef_Benito
>>> IRC: lamneth
>>> Blogue: endormitoire.wordpress.com
>>> "A standpoint is an intellectual horizon of radius zero".  (A. Einstein)
>>> 
>> 
> 





More information about the Pharo-dev mailing list