1.0 largeIdentityHash fails on 64-bit Linux

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

1.0 largeIdentityHash fails on 64-bit Linux

Ben Coman
With Linux 64 bit image 
TestRunner running FLBinaryFileStreamSerializationTest
produces error "PrimitiveFailed: primitive #basicIdentityHash in SmallFloat64 failed"

The same error occurs evaluating...
   1.0 largeIdentityHash
which works fine on 32-bit.


Build information: 
Pharo-7.0+alpha.build.409.sha.bb4eaaf976e3fb148b33b6d87598022b77329768 (64 Bit)
CoInterpreter VMMaker.oscog-eem.2295  Dec 21 2017
StackToRegisterMappingCogit VMMaker.oscog-eem.2297 Dec 21 2017
VM: 201712211450 
Unix built on Dec 21 2017 14:53:19 Compiler: 4.8.4

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: 1.0 largeIdentityHash fails on 64-bit Linux

Eliot Miranda-2
Hi Ben,

On Sat, Jan 6, 2018 at 8:47 PM, Ben Coman <[hidden email]> wrote:
With Linux 64 bit image 
TestRunner running FLBinaryFileStreamSerializationTest
produces error "PrimitiveFailed: primitive #basicIdentityHash in SmallFloat64 failed"

I suspect the SmallFloat64 basicIdentityHash method is missing or using the wrong primitive number.  Here's what happens in Squeak:

1.0 class -> 1.0 identityHash hex -> ((1.0 class whichClassIncludesSelector: #identityHash) >> #identityHash) primitive SmallFloat64->'16r7F0000000000000'->171

And primitive 171 is the primitiveImmediateAsInteger primitive that converts SmallIntegers to themselves, Characters to their integer codes, and SmallFloat64 to an integer representing their bits.  e.g.

#(-0.0 0.0 -1.0 1.0) collect: [:n| n -> n identityHash hex -> (n identityHash bitAnd: 2 << 64 - 1) hex]
{-0.0->'-16r1000000000000000'->'16r1F000000000000000' .
  0.0->'16r0'->'16r0' .
 -1.0->'-16r810000000000000'->'16r1F7F0000000000000' .
  1.0->'16r7F0000000000000'->'16r7F0000000000000'}

SmallFloat64>>identityHash
"Answer an integer unique to the receiver."
<primitive: 171>
^self primitiveFailed

HTH


The same error occurs evaluating...
   1.0 largeIdentityHash
which works fine on 32-bit.


Build information: 
Pharo-7.0+alpha.build.409.sha.bb4eaaf976e3fb148b33b6d87598022b77329768 (64 Bit)
CoInterpreter VMMaker.oscog-eem.2295  Dec 21 2017
StackToRegisterMappingCogit VMMaker.oscog-eem.2297 Dec 21 2017
VM: 201712211450 
Unix built on Dec 21 2017 14:53:19 Compiler: 4.8.4

cheers -ben



--
_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: 1.0 largeIdentityHash fails on 64-bit Linux

Max Leske
That seems to fix it. SmallFloat64 needs to implement #basicIdentityHash with primitive 171. Thanks Eliot.

 

On 7 January 2018 at 06:19:18, Eliot Miranda ([hidden email]) wrote:

Hi Ben,

On Sat, Jan 6, 2018 at 8:47 PM, Ben Coman <[hidden email]> wrote:
With Linux 64 bit image 
TestRunner running FLBinaryFileStreamSerializationTest
produces error "PrimitiveFailed: primitive #basicIdentityHash in SmallFloat64 failed"

I suspect the SmallFloat64 basicIdentityHash method is missing or using the wrong primitive number.  Here's what happens in Squeak:

1.0 class -> 1.0 identityHash hex -> ((1.0 class whichClassIncludesSelector: #identityHash) >> #identityHash) primitive SmallFloat64->'16r7F0000000000000'->171

And primitive 171 is the primitiveImmediateAsInteger primitive that converts SmallIntegers to themselves, Characters to their integer codes, and SmallFloat64 to an integer representing their bits.  e.g.

#(-0.0 0.0 -1.0 1.0) collect: [:n| n -> n identityHash hex -> (n identityHash bitAnd: 2 << 64 - 1) hex]
{-0.0->'-16r1000000000000000'->'16r1F000000000000000' .
  0.0->'16r0'->'16r0' .
 -1.0->'-16r810000000000000'->'16r1F7F0000000000000' .
  1.0->'16r7F0000000000000'->'16r7F0000000000000'}

SmallFloat64>>identityHash
"Answer an integer unique to the receiver."
<primitive: 171>
^self primitiveFailed

HTH


The same error occurs evaluating...
   1.0 largeIdentityHash
which works fine on 32-bit.


Build information: 
Pharo-7.0+alpha.build.409.sha.bb4eaaf976e3fb148b33b6d87598022b77329768 (64 Bit)
CoInterpreter VMMaker.oscog-eem.2295  Dec 21 2017
StackToRegisterMappingCogit VMMaker.oscog-eem.2297 Dec 21 2017
VM: 201712211450 
Unix built on Dec 21 2017 14:53:19 Compiler: 4.8.4

cheers -ben



--
_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: 1.0 largeIdentityHash fails on 64-bit Linux

Stephane Ducasse-3
Tx I added the discussion to
https://pharo.fogbugz.com/f/cases/20936/64bit-primitiveFailure-for-1-0-largeIdentityHash

Stef

On Sun, Jan 7, 2018 at 11:18 AM, Max Leske <[hidden email]> wrote:

> That seems to fix it. SmallFloat64 needs to implement #basicIdentityHash
> with primitive 171. Thanks Eliot.
>
>
>
> On 7 January 2018 at 06:19:18, Eliot Miranda ([hidden email])
> wrote:
>
> Hi Ben,
>
> On Sat, Jan 6, 2018 at 8:47 PM, Ben Coman <[hidden email]> wrote:
>>
>> With Linux 64 bit image
>> TestRunner running FLBinaryFileStreamSerializationTest
>> produces error "PrimitiveFailed: primitive #basicIdentityHash in
>> SmallFloat64 failed"
>
>
> I suspect the SmallFloat64 basicIdentityHash method is missing or using the
> wrong primitive number.  Here's what happens in Squeak:
>
> 1.0 class -> 1.0 identityHash hex -> ((1.0 class whichClassIncludesSelector:
> #identityHash) >> #identityHash) primitive
> SmallFloat64->'16r7F0000000000000'->171
>
> And primitive 171 is the primitiveImmediateAsInteger primitive that converts
> SmallIntegers to themselves, Characters to their integer codes, and
> SmallFloat64 to an integer representing their bits.  e.g.
>
> #(-0.0 0.0 -1.0 1.0) collect: [:n| n -> n identityHash hex -> (n
> identityHash bitAnd: 2 << 64 - 1) hex]
> {-0.0->'-16r1000000000000000'->'16r1F000000000000000' .
>   0.0->'16r0'->'16r0' .
>  -1.0->'-16r810000000000000'->'16r1F7F0000000000000' .
>   1.0->'16r7F0000000000000'->'16r7F0000000000000'}
>
> SmallFloat64>>identityHash
> "Answer an integer unique to the receiver."
> <primitive: 171>
> ^self primitiveFailed
>
> HTH
>
>>
>> The same error occurs evaluating...
>>    1.0 largeIdentityHash
>> which works fine on 32-bit.
>>
>>
>> https://pharo.fogbugz.com/f/cases/20936/64bit-primitiveFailure-for-1-0-largeIdentityHash
>>
>> Build information:
>> Pharo-7.0+alpha.build.409.sha.bb4eaaf976e3fb148b33b6d87598022b77329768 (64
>> Bit)
>> CoInterpreter VMMaker.oscog-eem.2295  Dec 21 2017
>> StackToRegisterMappingCogit VMMaker.oscog-eem.2297 Dec 21 2017
>> VM: 201712211450
>> Unix built on Dec 21 2017 14:53:19 Compiler: 4.8.4
>>
>> cheers -ben
>
>
>
>
> --
> _,,,^..^,,,_
> best, Eliot

Reply | Threaded
Open this post in threaded view
|

Re: 1.0 largeIdentityHash fails on 64-bit Linux

Stephane Ducasse-3
https://github.com/pharo-project/pharo/pull/653



On Sun, Jan 7, 2018 at 3:14 PM, Stephane Ducasse
<[hidden email]> wrote:

> Tx I added the discussion to
> https://pharo.fogbugz.com/f/cases/20936/64bit-primitiveFailure-for-1-0-largeIdentityHash
>
> Stef
>
> On Sun, Jan 7, 2018 at 11:18 AM, Max Leske <[hidden email]> wrote:
>> That seems to fix it. SmallFloat64 needs to implement #basicIdentityHash
>> with primitive 171. Thanks Eliot.
>>
>>
>>
>> On 7 January 2018 at 06:19:18, Eliot Miranda ([hidden email])
>> wrote:
>>
>> Hi Ben,
>>
>> On Sat, Jan 6, 2018 at 8:47 PM, Ben Coman <[hidden email]> wrote:
>>>
>>> With Linux 64 bit image
>>> TestRunner running FLBinaryFileStreamSerializationTest
>>> produces error "PrimitiveFailed: primitive #basicIdentityHash in
>>> SmallFloat64 failed"
>>
>>
>> I suspect the SmallFloat64 basicIdentityHash method is missing or using the
>> wrong primitive number.  Here's what happens in Squeak:
>>
>> 1.0 class -> 1.0 identityHash hex -> ((1.0 class whichClassIncludesSelector:
>> #identityHash) >> #identityHash) primitive
>> SmallFloat64->'16r7F0000000000000'->171
>>
>> And primitive 171 is the primitiveImmediateAsInteger primitive that converts
>> SmallIntegers to themselves, Characters to their integer codes, and
>> SmallFloat64 to an integer representing their bits.  e.g.
>>
>> #(-0.0 0.0 -1.0 1.0) collect: [:n| n -> n identityHash hex -> (n
>> identityHash bitAnd: 2 << 64 - 1) hex]
>> {-0.0->'-16r1000000000000000'->'16r1F000000000000000' .
>>   0.0->'16r0'->'16r0' .
>>  -1.0->'-16r810000000000000'->'16r1F7F0000000000000' .
>>   1.0->'16r7F0000000000000'->'16r7F0000000000000'}
>>
>> SmallFloat64>>identityHash
>> "Answer an integer unique to the receiver."
>> <primitive: 171>
>> ^self primitiveFailed
>>
>> HTH
>>
>>>
>>> The same error occurs evaluating...
>>>    1.0 largeIdentityHash
>>> which works fine on 32-bit.
>>>
>>>
>>> https://pharo.fogbugz.com/f/cases/20936/64bit-primitiveFailure-for-1-0-largeIdentityHash
>>>
>>> Build information:
>>> Pharo-7.0+alpha.build.409.sha.bb4eaaf976e3fb148b33b6d87598022b77329768 (64
>>> Bit)
>>> CoInterpreter VMMaker.oscog-eem.2295  Dec 21 2017
>>> StackToRegisterMappingCogit VMMaker.oscog-eem.2297 Dec 21 2017
>>> VM: 201712211450
>>> Unix built on Dec 21 2017 14:53:19 Compiler: 4.8.4
>>>
>>> cheers -ben
>>
>>
>>
>>
>> --
>> _,,,^..^,,,_
>> best, Eliot

Reply | Threaded
Open this post in threaded view
|

Re: 1.0 largeIdentityHash fails on 64-bit Linux

Nicolas Cellier

2018-01-07 15:38 GMT+01:00 Stephane Ducasse <[hidden email]>:
https://github.com/pharo-project/pharo/pull/653



On Sun, Jan 7, 2018 at 3:14 PM, Stephane Ducasse
<[hidden email]> wrote:
> Tx I added the discussion to
> https://pharo.fogbugz.com/f/cases/20936/64bit-primitiveFailure-for-1-0-largeIdentityHash
>
> Stef
>
> On Sun, Jan 7, 2018 at 11:18 AM, Max Leske <[hidden email]> wrote:
>> That seems to fix it. SmallFloat64 needs to implement #basicIdentityHash
>> with primitive 171. Thanks Eliot.
>>
>>
>>
>> On 7 January 2018 at 06:19:18, Eliot Miranda ([hidden email])
>> wrote:
>>
>> Hi Ben,
>>
>> On Sat, Jan 6, 2018 at 8:47 PM, Ben Coman <[hidden email]> wrote:
>>>
>>> With Linux 64 bit image
>>> TestRunner running FLBinaryFileStreamSerializationTest
>>> produces error "PrimitiveFailed: primitive #basicIdentityHash in
>>> SmallFloat64 failed"
>>
>>
>> I suspect the SmallFloat64 basicIdentityHash method is missing or using the
>> wrong primitive number.  Here's what happens in Squeak:
>>
>> 1.0 class -> 1.0 identityHash hex -> ((1.0 class whichClassIncludesSelector:
>> #identityHash) >> #identityHash) primitive
>> SmallFloat64->'16r7F0000000000000'->171
>>
>> And primitive 171 is the primitiveImmediateAsInteger primitive that converts
>> SmallIntegers to themselves, Characters to their integer codes, and
>> SmallFloat64 to an integer representing their bits.  e.g.
>>
>> #(-0.0 0.0 -1.0 1.0) collect: [:n| n -> n identityHash hex -> (n
>> identityHash bitAnd: 2 << 64 - 1) hex]
>> {-0.0->'-16r1000000000000000'->'16r1F000000000000000' .
>>   0.0->'16r0'->'16r0' .
>>  -1.0->'-16r810000000000000'->'16r1F7F0000000000000' .
>>   1.0->'16r7F0000000000000'->'16r7F0000000000000'}
>>
>> SmallFloat64>>identityHash
>> "Answer an integer unique to the receiver."
>> <primitive: 171>
>> ^self primitiveFailed
>>
>> HTH
>>
>>>
>>> The same error occurs evaluating...
>>>    1.0 largeIdentityHash
>>> which works fine on 32-bit.
>>>
>>>
>>> https://pharo.fogbugz.com/f/cases/20936/64bit-primitiveFailure-for-1-0-largeIdentityHash
>>>
>>> Build information:
>>> Pharo-7.0+alpha.build.409.sha.bb4eaaf976e3fb148b33b6d87598022b77329768 (64
>>> Bit)
>>> CoInterpreter VMMaker.oscog-eem.2295  Dec 21 2017
>>> StackToRegisterMappingCogit VMMaker.oscog-eem.2297 Dec 21 2017
>>> VM: 201712211450
>>> Unix built on Dec 21 2017 14:53:19 Compiler: 4.8.4
>>>
>>> cheers -ben
>>
>>
>>
>>
>> --
>> _,,,^..^,,,_
>> best, Eliot