hpi-swa / Squot

Squeak Object Tracker - Version control for arbitrary objects, currently with Git storage
Other
61 stars 29 forks source link

MessageNotUnderstood: UndefinedObject>>key from GitRefCache>>#allWithPrefix:ifAbsentPutAll: #408

Open LinqLover opened 11 months ago

LinqLover commented 11 months ago

This debugger appeared in my image while I switched on the command line to another branch:

Bug report

26 December 2023 10:13:51.545344 pm

VM: Win32 - Smalltalk
Image: Squeak6.1alpha [latest update: #22911]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir C:\Users\Christoph\OneDrive\Dokumente\Squeak
Trusted Dir C:\Users\Christoph\OneDrive\Dokumente\Squeak\Christoph
Untrusted Dir C:\Users\Christoph\OneDrive\Dokumente\My Squeak

UndefinedObject(Object)>>doesNotUnderstand: #key
    Receiver: nil
    Arguments and temporary variables: 
        aMessage:   key
        exception:  MessageNotUnderstood: UndefinedObject>>key
        resumeValue:    nil
    Receiver's instance variables: 
nil

Dictionary>>add:
    Receiver: a Dictionary()
    Arguments and temporary variables: 
        anAssociation:  nil
        index:  nil
        element:    nil
    Receiver's instance variables: 
        tally:  0
        array:  #(nil nil nil nil nil)

[] in GitRefCache>>allWithPrefix:ifAbsentPutAll:
    Receiver: a GitRefCache
    Arguments and temporary variables: 
        aString:    'refs/heads/'
        aBlock:     [closure] in GitUnitOfWork>>allReferencesPrefixedWith:do:
        newRefs:    an OrderedCollection(nil 'refs/heads/fix-baseline'->'f6104d3685d243f61...etc...
        each:   nil
    Receiver's instance variables: 
        refs:   a Dictionary()
        symbolicRefs:   nil
        resolvedRefs:   a Dictionary()
        prefixesCompletelyEnumerated:   an OrderedCollection()

OrderedCollection>>do:
    Receiver: an OrderedCollection(nil 'refs/heads/fix-baseline'->'f6104d3685d243f6134583048a96edb8dc2d6...etc...
    Arguments and temporary variables: 
        aBlock:     [closure] in GitRefCache>>allWithPrefix:ifAbsentPutAll:
        index:  1
    Receiver's instance variables: 
        array:  {nil . 'refs/heads/fix-baseline'->'f6104d3685d243f6134583048a96edb8dc2d6...etc...
        firstIndex:     1
        lastIndex:  51

GitRefCache>>allWithPrefix:ifAbsentPutAll:
    Receiver: a GitRefCache
    Arguments and temporary variables: 
        aString:    'refs/heads/'
        aBlock:     [closure] in GitUnitOfWork>>allReferencesPrefixedWith:do:
        newRefs:    an OrderedCollection(nil 'refs/heads/fix-baseline'->'f6104d3685d243f61...etc...
    Receiver's instance variables: 
        refs:   a Dictionary()
        symbolicRefs:   nil
        resolvedRefs:   a Dictionary()
        prefixesCompletelyEnumerated:   an OrderedCollection()

GitUnitOfWork>>allReferencesPrefixedWith:do:
    Receiver: a GitUnitOfWork on a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebugger...etc...
    Arguments and temporary variables: 
        prefixString:   'refs/heads/'
        aBlock:     [closure] in GitUnitOfWork>>allShortenedRefsIn:
    Receiver's instance variables: 
        repository:     a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebu...etc...
        objectStores:   an OrderedCollection(a GitLooseObjectStore a GitPackedObjectStore...etc...
        refStores:  an OrderedCollection(a GitLooseRefStore a GitPackedRefStore)
        refLogs:    a Dictionary()
        config:     nil
        refCache:   a GitRefCache

GitUnitOfWork>>allShortenedRefsIn:
    Receiver: a GitUnitOfWork on a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebugger...etc...
    Arguments and temporary variables: 
        aString:    'refs/heads'
        names:  an OrderedCollection()
        prefix:     'refs/heads/'
        prefixLength:   11
    Receiver's instance variables: 
        repository:     a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebu...etc...
        objectStores:   an OrderedCollection(a GitLooseObjectStore a GitPackedObjectStore...etc...
        refStores:  an OrderedCollection(a GitLooseRefStore a GitPackedRefStore)
        refLogs:    a Dictionary()
        config:     nil
        refCache:   a GitRefCache

GitUnitOfWork>>branchNames
    Receiver: a GitUnitOfWork on a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebugger...etc...
    Arguments and temporary variables: 

    Receiver's instance variables: 
        repository:     a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebu...etc...
        objectStores:   an OrderedCollection(a GitLooseObjectStore a GitPackedObjectStore...etc...
        refStores:  an OrderedCollection(a GitLooseRefStore a GitPackedRefStore)
        refLogs:    a Dictionary()
        config:     nil
        refCache:   a GitRefCache

FileSystemGitRepository>>branchNames
    Receiver: a FileSystemGitRepository
    Arguments and temporary variables: 

    Receiver's instance variables: 
        repository:     a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebu...etc...

SquitRepository>>historians
    Receiver: a SquitRepository
    Arguments and temporary variables: 

    Receiver's instance variables: 
        gitRepository:  a FileSystemGitRepository
        versionsCache:  a WeakValueDictionary(size 603)
        filesystemsCache:   a Dictionary()
        leastRecentlyRequestedFilesystems:  an OrderedCollection()
        credentials:    a Dictionary('https://github.com/hpi-swa-lab/squeak-tracedebugger'...etc...
        cachedSnapshots:    {commit 7c7d4d4 "update expectedFailures and timeouts for test...etc...

SquitBrowser>>loadBranchList
    Receiver: a SquitBrowser
    Arguments and temporary variables: 
        list:   nil
        project:    TraceDebugger
        historians:     nil
        localHistorians:    nil
        remoteHistorians:   nil
    Receiver's instance variables: 
        dependents:     a DependentsArray(a PluggableSystemWindowan OrderedCollection...etc...

[] in [] in SquitBrowser>>refresh
    Receiver: a SquitBrowser
    Arguments and temporary variables: 

    Receiver's instance variables: 
        dependents:     a DependentsArray(a PluggableSystemWindowan OrderedCollection...etc...

[] in GitCurrentUnitOfWork class(DynamicVariable class)>>value:during:
    Receiver: GitCurrentUnitOfWork
    Arguments and temporary variables: 
        anObject:   a Dictionary(a GitRepository C:\Users\Christoph\Documents\repos\squea...etc...
        aBlock:     [closure] in [] in SquitBrowser>>refresh
        p:  a Process(44380) in MorphicProject>>suspendProcessSafely:
        oldValue:   nil
        outerScopeWasDynamic:   false
    Receiver's instance variables: 
        superclass:     DynamicVariable
        methodDict:     a MethodDictionary()
        format:     0
        instanceVariables:  nil
        organization:   ('as yet unclassified')

        subclasses:     nil
        name:   #GitCurrentUnitOfWork
        classPool:  nil
        sharedPools:    nil
        environment:    Smalltalk
        category:   #'FileSystem-Git-Plumbing-Core'
        hash:   99344143

FullBlockClosure(BlockClosure)>>ensure:
    Receiver: [closure] in GitCurrentUnitOfWork class(DynamicVariable class)>>value:during:
    Arguments and temporary variables: 
        aBlock:     [closure] in GitCurrentUnitOfWork class(DynamicVariable class)>>value:during:...etc...
        complete:   nil
        returnValue:    nil
    Receiver's instance variables: 
        outerContext:   GitCurrentUnitOfWork class(DynamicVariable class)>>value:during:
        startpcOrMethod:    ([] in DynamicVariable class>>#value:during: "a CompiledBlock(...etc...
        numArgs:    0
        receiver:   GitCurrentUnitOfWork

GitCurrentUnitOfWork class(DynamicVariable class)>>value:during:
    Receiver: GitCurrentUnitOfWork
    Arguments and temporary variables: 
        anObject:   a Dictionary(a GitRepository C:\Users\Christoph\Documents\repos\squea...etc...
        aBlock:     [closure] in [] in SquitBrowser>>refresh
        p:  a Process(44380) in MorphicProject>>suspendProcessSafely:
        oldValue:   nil
        outerScopeWasDynamic:   false
    Receiver's instance variables: 
        superclass:     DynamicVariable
        methodDict:     a MethodDictionary()
        format:     0
        instanceVariables:  nil
        organization:   ('as yet unclassified')

        subclasses:     nil
        name:   #GitCurrentUnitOfWork
        classPool:  nil
        sharedPools:    nil
        environment:    Smalltalk
        category:   #'FileSystem-Git-Plumbing-Core'
        hash:   99344143

GitCurrentUnitOfWork class>>value:for:during:
    Receiver: GitCurrentUnitOfWork
    Arguments and temporary variables: 
        aGitUnitOfWork:     a GitUnitOfWork on a GitRepository C:\Users\Christoph\Documents...etc...
        anObject:   a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebugg...etc...
        aBlock:     [closure] in [] in SquitBrowser>>refresh
    Receiver's instance variables: 
        superclass:     DynamicVariable
        methodDict:     a MethodDictionary()
        format:     0
        instanceVariables:  nil
        organization:   ('as yet unclassified')

        subclasses:     nil
        name:   #GitCurrentUnitOfWork
        classPool:  nil
        sharedPools:    nil
        environment:    Smalltalk
        category:   #'FileSystem-Git-Plumbing-Core'
        hash:   99344143

GitUnitOfWork>>activateDuring:
    Receiver: a GitUnitOfWork on a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebugger...etc...
    Arguments and temporary variables: 
        aBlock:     [closure] in [] in SquitBrowser>>refresh
    Receiver's instance variables: 
        repository:     a GitRepository C:\Users\Christoph\Documents\repos\squeak-tracedebu...etc...
        objectStores:   an OrderedCollection(a GitLooseObjectStore a GitPackedObjectStore...etc...
        refStores:  an OrderedCollection(a GitLooseRefStore a GitPackedRefStore)
        refLogs:    a Dictionary()
        config:     nil
        refCache:   a GitRefCache

SquitUnitOfWork>>activateDuring:
    Receiver: a SquitUnitOfWork
    Arguments and temporary variables: 
        aBlock:     [closure] in [] in SquitBrowser>>refresh
    Receiver's instance variables: 
        repository:     a SquitRepository
        numberOfClients:    1
        gitUnitOfWork:  a GitUnitOfWork on a GitRepository C:\Users\Christoph\Documents\...etc...

[] in SquitBrowser>>withUnitOfWork:
    Receiver: a SquitBrowser
    Arguments and temporary variables: 
        aBlock:     [closure] in [] in SquitBrowser>>refresh
        unitOfWork:     a SquitUnitOfWork
    Receiver's instance variables: 
        dependents:     a DependentsArray(a PluggableSystemWindowan OrderedCollection...etc...

--- The full stack ---
UndefinedObject(Object)>>doesNotUnderstand: #key
Dictionary>>add:
[] in GitRefCache>>allWithPrefix:ifAbsentPutAll:
OrderedCollection>>do:
GitRefCache>>allWithPrefix:ifAbsentPutAll:
GitUnitOfWork>>allReferencesPrefixedWith:do:
GitUnitOfWork>>allShortenedRefsIn:
GitUnitOfWork>>branchNames
FileSystemGitRepository>>branchNames
SquitRepository>>historians
SquitBrowser>>loadBranchList
[] in [] in SquitBrowser>>refresh
[] in GitCurrentUnitOfWork class(DynamicVariable class)>>value:during:
FullBlockClosure(BlockClosure)>>ensure:
GitCurrentUnitOfWork class(DynamicVariable class)>>value:during:
GitCurrentUnitOfWork class>>value:for:during:
GitUnitOfWork>>activateDuring:
SquitUnitOfWork>>activateDuring:
[] in SquitBrowser>>withUnitOfWork:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FullBlockClosure(BlockClosure)>>ensure:
SquitBrowser>>withUnitOfWork:
[] in SquitBrowser>>refresh
FullBlockClosure(BlockClosure)>>ensure:
CursorWithMask(Cursor)>>showWhile:
SquitBrowser>>refresh
SquitBrowser>>stepAt:in:
PluggableSystemWindow(SystemWindow)>>stepAt:
StepMessage(MorphicAlarm)>>value:
[] in WorldState>>runLocalStepMethodsIn:
[] in ActiveWorldVariable class(DynamicVariable class)>>value:during:
FullBlockClosure(BlockClosure)>>ensure:
ActiveWorldVariable class(DynamicVariable class)>>value:during:
[] in ActiveWorldVariable class>>value:during:
FullBlockClosure(BlockClosure)>>ensure:
ActiveWorldVariable class>>value:during:
PasteUpMorph>>becomeActiveDuring:
WorldState>>runLocalStepMethodsIn:
WorldState>>runStepMethodsIn:
PasteUpMorph>>runStepMethods
[] in WorldState>>doOneCycleNowFor:
[] in ActiveWorldVariable class(DynamicVariable class)>>value:during:
FullBlockClosure(BlockClosure)>>ensure:
ActiveWorldVariable class(DynamicVariable class)>>value:during:
[] in ActiveWorldVariable class>>value:during:
FullBlockClosure(BlockClosure)>>ensure:
ActiveWorldVariable class>>value:during:
PasteUpMorph>>becomeActiveDuring:
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
PasteUpMorph>>doOneCycle
[] in MorphicProject>>spawnNewProcess
[] in FullBlockClosure(BlockClosure)>>newProcess

Looks like ref: may answer nil in some situations but GitUnitOfWork>>#allReferencesPrefixedWith:do:/GitRefCache>>#allWithPrefix:ifAbsentPutAll: is not prepared for that?

j4yk commented 11 months ago

Exactly what you concluded.

Now actually I would like to better understand why ref: returned nil here, and avoid that from entering the collection in the first place. Refs shouldn't disappear while enumerating them. Also why would one ref disappear when you switched branches?

LinqLover commented 11 months ago

Also why would one ref disappear when you switched branches?

Very good question! I can imagine that the external git client I used (VS Code VCS) has created some temporary refs or performed a GC ...

(By the way, does Squot honor the lock files of git?)

j4yk commented 11 months ago

(By the way, does Squot honor the lock files of git?)

I don't know. Probably not. If it does, then I didn't implement it.