Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007705 [Squeak] VM major always 08-29-12 22:57 09-01-12 21:45
Reporter lewis View Status public  
Assigned To lewis
Priority normal Resolution open  
Status testing   Product Version
Summary 0007705: Three bugs in LargeInteger primitives
Description Date: Wed, 29 Aug 2012 12:18:28 +0200
From: Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com>
To: Squeak Virtual Machine Development Discussion
Subject: [Vm-dev] 3 Bugs in LargeInteger primitives
I found 3 bugs in LargeInteger primitives
 
(1<<63) negated quo: -1.
(1<<63) negated / -1.
(1<<63) negated * -1.
 
They are all related to the impossible task of taking absolute value
of INT_MIN (or more exactly it's 64 bits equivalent).
Currently, it takes the form (0 - INT_MIN) whose behaviour is
undefined according to C standards but generally answer INT_MIN.
Additional Information See discussion at http://lists.squeakfoundation.org/pipermail/vm-dev/2012-August/011161.html [^]

In addition to the symptoms reported there, a VM compiled in 64-bit mode will crash on evaluating "(1<<63) negated / -1"

Attached Files

- Relationships
related to 0006987assigned lewis signed32BitValueOf:, signed64BitValueOf: etc. broken 

- Notes
(0014253 - 249 - 249 - 395 - 395 - 395 - 395)
nicolas cellier
08-30-12 08:12

See also http://code.google.com/p/cog/issues/detail?id=92 [^] which has a proposed patch attached using proper and simpler sign/magnitude representation which better fit LageInt representation anyway and rely on well defined unsigned behavior arithmetic
 
(0014254 - 396 - 414 - 560 - 560 - 560 - 560)
lewis
09-01-12 21:45

The Nicolas Cellier changes have been added to trunk VMM in VMMaker-dtl.286. Original changes were posted at http://code.google.com/p/cog/issues/detail?id=92 [^] and the relevant InterpreterPrimitives changes were adopted from that posting.

With this update, LargeNegativeIntegerTest>>testMinimumNegativeIntegerArithmetic passes. Performance is apparently improved (and is definitely not reduced).
 

- Issue History
Date Modified Username Field Change
08-29-12 22:57 lewis New Issue
08-29-12 22:57 lewis Status new => assigned
08-29-12 22:57 lewis Assigned To  => lewis
08-29-12 22:59 lewis Relationship added related to 0006987
08-30-12 08:12 nicolas cellier Note Added: 0014253
09-01-12 21:45 lewis Note Added: 0014254
09-01-12 21:45 lewis Status assigned => testing


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
44 total queries executed.
33 unique queries executed.
Powered by Mantis Bugtracker