|Anonymous | Login||11-13-2019 04:33 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|
|0007430||[Squeak] Squeak 64 bit||crash||always||12-17-09 00:52||04-18-10 21:59|
|Summary||0007430: CompiledMethod>> initialPC calculation is wrong for 64bit images|
Needs to consider Smalltalk wordsize (cached value) versus the hard coded 4, because on a 64bit image it's 8.
CompiledMethod-initialPC.st [^] (306 bytes) 12-17-09 13:12
Smalltalk-wordSize-dtl-M7430.1.cs [^] (3,629 bytes) 12-18-09 05:44
Smalltalk-wordSize-dtl-M7430.2.cs [^] (1,172 bytes) 12-18-09 23:14
(0013436 - 404 - 424 - 424 - 424 - 424 - 424)
|For reference, I uploaded CompiledMethod-initialPC.st, which contains the version of this method from the original "dist 3" 64-bit image. This uses "Smalltalk wordSize", which is correct (but slow). Presumably this version of the method was added to the 32-bit image prior to tracing the 64-bit image. See discussion on Squeak/Pharo lists concerning the best way to do this without impacting performance.|
(0013437 - 545 - 612 - 612 - 612 - 612 - 612)
Laval Jannik posted fixes on vm-dev and pharo lists. The attached Smalltalk-wordSize-dtl-M7430.1.cs is a variation on Laval's proposal.
This uses "Smalltalk wordSize" (not "SystemDictionary wordSize"), and clears the cached value immediately prior to a snapshot.
Cache Smalltalk wordSize in class var in SystemDictionary. Clear the cached value prior to an image snapshot, and initialize it on image restart.
Update CompiledMethod>>initialPC to use #wordSize. This is the method as implemented in the original 64-bit image (author di)."
(0013438 - 629 - 652 - 652 - 652 - 652 - 652)
I don't think we need the Smalltalk clearWordSize in snapshot: save andQuit: quit embedded: embeddedFlag. Based on the discussion of what is going on, all existing images start out as 32bit images so they need the WordSize on SystemDictionary, which will get set to 4, and of course the change to CompiledMethod>> initialPC
But as pointed out when the SystemTracer2 converts it to a 64bit image we then change the value to 8 as part of the bootstrapping. Now there is no need to nill or swap back to 4, because 8 is the only correct answer for a 64bit image so there is no need to nil and reload 8 back into the class var.
(0013439 - 374 - 380 - 423 - 423 - 423 - 423)
|Agreed, setting WordSize should be done only by system trace as per Bert's suggestion. Corrected change set attached (Smalltalk-wordSize-dtl-M7430.2.cs), which caches #wordSize but does not affect snapshot/resume. Need to confirm that this matches changes for Pharo by Laval Jannik <email@example.com>, or just use Laval's changes directly (I don't have the change set).|
(0013455 - 435 - 469 - 469 - 469 - 469 - 469)
edited on: 01-05-10 02:55
Smalltalk-wordSize-dtl-M7430.2.cs has been added to Squeak trunk. I also updated the method comment for #wordSize to explain:
"Answer the size in bytes of an object pointer or word in the object memory. The value does not change for a given image, but may be modified by a SystemTracer when converting the image to another format. The value is cached in WordSize to avoid the performance overhead of repeatedly consulting the VM."
(0013484 - 31 - 31 - 31 - 31 - 31 - 31)
|Fixed in Squeak trunk and Pharo|
|12-17-09 00:52||johnmci||New Issue|
|12-17-09 02:02||lewis||Issue Monitored: lewis|
|12-17-09 13:12||lewis||File Added: CompiledMethod-initialPC.st|
|12-17-09 13:16||lewis||Note Added: 0013436|
|12-18-09 05:44||lewis||File Added: Smalltalk-wordSize-dtl-M7430.1.cs|
|12-18-09 05:49||lewis||Note Added: 0013437|
|12-18-09 06:24||johnmci||Note Added: 0013438|
|12-18-09 23:14||lewis||File Added: Smalltalk-wordSize-dtl-M7430.2.cs|
|12-18-09 23:18||lewis||Note Added: 0013439|
|12-20-09 22:42||johnmci||Relationship added||related to 0005239|
|01-05-10 02:54||lewis||Note Added: 0013455|
|01-05-10 02:55||lewis||Note Edited: 0013455|
|01-16-10 18:55||lewis||Status||new => resolved|
|01-16-10 18:55||lewis||Resolution||open => fixed|
|01-16-10 18:55||lewis||Assigned To||=> lewis|
|01-16-10 18:55||lewis||Note Added: 0013484|
|04-18-10 21:59||andreas||Status||resolved => closed|
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
73 total queries executed.|
43 unique queries executed.