pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

How do I remove old classes?

CS
Clacton Server
Fri, Jul 23, 2021 1:56 PM

I have been having an enduring problem with Pharo "disappearing" on any machine I try it on. In an effort to resolve that it isn't my code, I want to remove the Package that contains all my Seaside code so that I can install a minimal home page under Seaside. This will, at least exonerate my code. However, I have removed the offending package, executed Smalltalk cleanUp: true but I can still get into the old code. A debugger comes up when I try the old code and it shows "AnObsoleteCNWMeetingsGalleries(AnObsoleteCNWBasic)" so the code is still there and all the bots that have the address will still be calling it. How do I finally remove the code?

David Pennington

I have been having an enduring problem with Pharo "disappearing" on any machine I try it on. In an effort to resolve that it isn't my code, I want to remove the Package that contains all my Seaside code so that I can install a minimal home page under Seaside. This will, at least exonerate my code. However, I have removed the offending package, executed Smalltalk cleanUp: true but I can still get into the old code. A debugger comes up when I try the old code and it shows "AnObsoleteCNWMeetingsGalleries(AnObsoleteCNWBasic)" so the code is still there and all the bots that have the address will still be calling it. How do I finally remove the code? David Pennington
KO
Kasper Osterbye
Fri, Jul 23, 2021 2:23 PM

Not knowing your specific usage, this tends to happen if you have an instance of class X, and then remove the class. To save the instance from going stale, Smalltalk has always made an Obsolete class.

You can find the offending X instance by inspecting this:
ReferenceFinder findAllPathsTo: X allInstances first

This examines the first instance, you might want to print
X allInstances size
to see how big your issue is.

Also, perhaps you need to force a garbage collect first:
Smalltalk image garbageCollect

Tracing the back-references can be a bit overwhelming the first times. For me the culprit has often been some global variable I thought I had under control.

Best,

Kasper

On 23 Jul 2021, at 15.56, Clacton Server david@totallyobjects.com wrote:

I have been having an enduring problem with Pharo "disappearing" on any machine I try it on. In an effort to resolve that it isn't my code, I want to remove the Package that contains all my Seaside code so that I can install a minimal home page under Seaside. This will, at least exonerate my code. However, I have removed the offending package, executed Smalltalk cleanUp: true but I can still get into the old code. A debugger comes up when I try the old code and it shows "AnObsoleteCNWMeetingsGalleries(AnObsoleteCNWBasic)" so the code is still there and all the bots that have the address will still be calling it. How do I finally remove the code?

David Pennington

Not knowing your specific usage, this tends to happen if you have an instance of class X, and then remove the class. To save the instance from going stale, Smalltalk has always made an Obsolete class. You can find the offending X instance by inspecting this: ReferenceFinder findAllPathsTo: X allInstances first This examines the first instance, you might want to print X allInstances size to see how big your issue is. Also, perhaps you need to force a garbage collect first: Smalltalk image garbageCollect Tracing the back-references can be a bit overwhelming the first times. For me the culprit has often been some global variable I thought I had under control. Best, Kasper > On 23 Jul 2021, at 15.56, Clacton Server <david@totallyobjects.com> wrote: > > I have been having an enduring problem with Pharo "disappearing" on any machine I try it on. In an effort to resolve that it isn't my code, I want to remove the Package that contains all my Seaside code so that I can install a minimal home page under Seaside. This will, at least exonerate my code. However, I have removed the offending package, executed Smalltalk cleanUp: true but I can still get into the old code. A debugger comes up when I try the old code and it shows "AnObsoleteCNWMeetingsGalleries(AnObsoleteCNWBasic)" so the code is still there and all the bots that have the address will still be calling it. How do I finally remove the code? > > David Pennington
RS
Richard Sargent
Fri, Jul 23, 2021 3:34 PM

On Fri, Jul 23, 2021, 06:57 Clacton Server david@totallyobjects.com wrote:

I have been having an enduring problem with Pharo "disappearing" on any
machine I try it on. In an effort to resolve that it isn't my code, I want
to remove the Package that contains all my Seaside code so that I can
install a minimal home page under Seaside. This will, at least exonerate my
code. However, I have removed the offending package, executed Smalltalk
cleanUp: true but I can still get into the old code. A debugger comes up
when I try the old code and it shows
"AnObsoleteCNWMeetingsGalleries(AnObsoleteCNWBasic)" so the code is still
there and all the bots that have the address will still be calling it. How
do I finally remove the code?

I would venture that you previously registered the class as a Seaside
handler/application/whatever and the registry holds the class despite it
being removed from the Smalltalk global dictionary.

If so, you would need to remove it from the registry.

David Pennington

On Fri, Jul 23, 2021, 06:57 Clacton Server <david@totallyobjects.com> wrote: > I have been having an enduring problem with Pharo "disappearing" on any > machine I try it on. In an effort to resolve that it isn't my code, I want > to remove the Package that contains all my Seaside code so that I can > install a minimal home page under Seaside. This will, at least exonerate my > code. However, I have removed the offending package, executed Smalltalk > cleanUp: true but I can still get into the old code. A debugger comes up > when I try the old code and it shows > "AnObsoleteCNWMeetingsGalleries(AnObsoleteCNWBasic)" so the code is still > there and all the bots that have the address will still be calling it. How > do I finally remove the code? > I would venture that you previously registered the class as a Seaside handler/application/whatever and the registry holds the class despite it being removed from the Smalltalk global dictionary. If so, you would need to remove it from the registry. > David Pennington
CS
Clacton Server
Fri, Jul 23, 2021 4:02 PM

Good thinking. I will check that out.
Thank you.
David

On 23 Jul 2021, at 16:34, Richard Sargent richard.sargent@gemtalksystems.com wrote:

On Fri, Jul 23, 2021, 06:57 Clacton Server <david@totallyobjects.com mailto:david@totallyobjects.com> wrote:
I have been having an enduring problem with Pharo "disappearing" on any machine I try it on. In an effort to resolve that it isn't my code, I want to remove the Package that contains all my Seaside code so that I can install a minimal home page under Seaside. This will, at least exonerate my code. However, I have removed the offending package, executed Smalltalk cleanUp: true but I can still get into the old code. A debugger comes up when I try the old code and it shows "AnObsoleteCNWMeetingsGalleries(AnObsoleteCNWBasic)" so the code is still there and all the bots that have the address will still be calling it. How do I finally remove the code?

I would venture that you previously registered the class as a Seaside handler/application/whatever and the registry holds the class despite it being removed from the Smalltalk global dictionary.

If so, you would need to remove it from the registry.

David Pennington

Good thinking. I will check that out. Thank you. David > On 23 Jul 2021, at 16:34, Richard Sargent <richard.sargent@gemtalksystems.com> wrote: > > > > On Fri, Jul 23, 2021, 06:57 Clacton Server <david@totallyobjects.com <mailto:david@totallyobjects.com>> wrote: > I have been having an enduring problem with Pharo "disappearing" on any machine I try it on. In an effort to resolve that it isn't my code, I want to remove the Package that contains all my Seaside code so that I can install a minimal home page under Seaside. This will, at least exonerate my code. However, I have removed the offending package, executed Smalltalk cleanUp: true but I can still get into the old code. A debugger comes up when I try the old code and it shows "AnObsoleteCNWMeetingsGalleries(AnObsoleteCNWBasic)" so the code is still there and all the bots that have the address will still be calling it. How do I finally remove the code? > > I would venture that you previously registered the class as a Seaside handler/application/whatever and the registry holds the class despite it being removed from the Smalltalk global dictionary. > > If so, you would need to remove it from the registry. > > > David Pennington