Anonymous | Login | 02-25-2021 05:48 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||||||
0007605 | [Squeak] VM | crash | always | 02-03-11 18:21 | 01-02-13 21:29 | ||||||||
Reporter | leves | View Status | public | ||||||||||
Assigned To | lewis | ||||||||||||
Priority | normal | Resolution | fixed | ||||||||||
Status | resolved | Product Version | trunk | ||||||||||
Summary | 0007605: VMs assume that Float have two slots and don't check it which may lead to problems | ||||||||||||
Description |
Currently Floats are variableWordSubclasses usually with two slots. But users can create them with any size. A possible typo is to use Float new instead of Float new: 2. If the VM assumes that the size of these objects is 2 without checking it, it leads to various issues. The following code crashes CogVM (r2349) immediately: f := Float new. Array new. f at: 1 put: 0. Cog overwrites the header of the Array created after the Float, then realizes the problem (last object overwritten) and crashes. SqueakVM is safe for this example, but some primitives are not. The following returns a random number (based on the contents of the memory) using SqueakVM: Float new ln It may also crash the VM, though the chance is small. |
||||||||||||
Additional Information | I'm pretty sure that performance is the reason to assume that Float's have two slots. To avoid sacrificing it, the best may be to update the image side code to always create Floats with two slots. | ||||||||||||
Attached Files | |||||||||||||
|
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
48 total queries executed. 36 unique queries executed. |