[Glass] Couple of orphaned class instances after repository upgrade: some questions

Johan Brichau johan at yesplan.be
Wed Feb 16 00:14:02 PST 2022


Hi again,

Following-up on myself ;-)

I suddenly realised I had never cross-checked the output of the same check on a fresh install of our code in a 3.4.5 repository (so not an upgraded one)…
The result is exactly the same list of classes, even when run on a repository with which 3.4.5 ships.

I guess all is well in that case, though there is some air of mystery around these instances ;-)

Sorry for the noise…
Johan


> On 15 Feb 2022, at 18:33, Johan Brichau <johan at yesplan.be> wrote:
> 
> Hi,
> 
> I’m fleshing out the final details of our upgrade from 2.4.4.1 to 3.4.5. 
> At the end of the upgrade process, we do a check for ‘instances of orphaned classes’ (code at the bottom). This allows us to detect if any GsMethod, ExecutableBlock or other instances are still lingering.
> I now end with the results below.
> 
> --transcript--'Orphaned class GsComSelectorLeaf (244225) has 33 instance(s):'
> --transcript--'    #(235454465 235454721 235474433 235474689 235474945 235475201 235475969 235476737 235477761 235478017 235479809 235480321 235481089 235481345 235481601 235482625 235482881 235483905 235484417 235488769 235489793 235490049 235490305 235490561 235491585 235492097 235492353 235493377 235494145 235495169 235495937 235496193 235496449)'
> --transcript--'Orphaned class FSFilePluginPrims (187628033) has 2 instance(s):'
> --transcript--'    #(199312129 200773633)'
> --transcript--'Orphaned class WordArray (187715073) has 13 instance(s):'
> --transcript--'    #(199707393 199708161 200611329 200611585 200611841 200612097 200612353 200612609 201169921 201170433 201938177 201938433 202275841)'
> --transcript--'Orphaned class ZipEncoderTree (187732481) has 2 instance(s):'
> --transcript--'    #(201169665 201170177)'
> --transcript--'Number of orphaned classes with instances: 5’
> 
> Are GsComSelectorLeaf and FSFilePluginPrims class private/hidden classes that I can ignore since they are not in my user’s symbolList?
> 
> When I trace the reference path from an instance of ZipEncoderTree, I get at a ZipConstants but the ZipConstants I can directly reach in the symbolList is a different one. So I am unable to find out where that other ZipConstants is being held.
> It does not yield any issues as far as I can see… but how can I find out where it’s being referenced as the repository reference methods stop at ZipConstants?
> 
> The references to WordArray point me to class variables in FastInflateStream but again the FastInflateStream I can reference from my symbolList is a different one and the class vars are nil.
> So, again, I am wondering what I need to do about these and if I need to do anything about these?
> 
> Thanks for any help
> Johan
> 
> — scripts:
> 
> orphanedClasses
> 	| globalClasses orphanedClasses metaclass metaclassInstances hiddenClassNames |
> 	globalClasses := IdentitySet new.
> 	hiddenClassNames := { #LargeObjectNode . #NscBagLeaf . #NscSetLeaf . #Large4ByteLeaf . #ObsoleteMetaclass }.
> 	(Smalltalk at: #System) myUserProfile symbolList do: [ :symbolDictionary | 
> 		symbolDictionary valuesDo: [ :global | 
> 			global isBehavior ifTrue: [ globalClasses add: global ] ] ].
> 	(Smalltalk at: #System) commitTransaction.
> 	metaclass := Smalltalk at: #Metaclass ifAbsent: [ Smalltalk at: #Metaclass3 ].
> 	metaclassInstances := IdentitySet withAll: metaclass allInstances.
> 	(Smalltalk at: #ObsoleteClasses ifAbsent: [ nil ]) ifNotNil: [ :obsoleteClasses |
> 		obsoleteClasses at: #ObsoleteMetaclass ifPresent: [ :obsoleteMetaclass |
> 			metaclassInstances addAll: obsoleteMetaclass allInstances ] ].
> 	orphanedClasses := IdentitySet new.
> 	metaclassInstances do: [ :metaclassInstance |
> 		| baseclass |
> 		baseclass := metaclassInstance theNonMetaClass.
> 		(globalClasses includes: baseclass) ifFalse: [
> 			orphanedClasses add: baseclass ] ].
> 	^ Array withAll: (orphanedClasses reject:[ :cl | hiddenClassNames includes: cl name  ])
> 
> orphanedClassesWithInstances
> 	| orphanedClasses instancesArrays result |
> 	orphanedClasses := self orphanedClasses.
> 	instancesArrays := (Smalltalk at: #SystemRepository) listInstances: orphanedClasses.
> 	result := OrderedCollection new.
> 	orphanedClasses with: instancesArrays do: [ :orphanedClass :instancesArray |
> 		instancesArray ifNotEmpty: [
> 			result add: (Association key: orphanedClass value: instancesArray) ] ].
> 	^ result

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/archives/glass/attachments/20220216/897692e1/attachment.htm>


More information about the Glass mailing list