Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image freeze when deprecated:transformWith: is used #12791

Closed
labordep opened this issue Feb 16, 2023 · 8 comments
Closed

Image freeze when deprecated:transformWith: is used #12791

labordep opened this issue Feb 16, 2023 · 8 comments

Comments

@labordep
Copy link
Collaborator

labordep commented Feb 16, 2023

I find a problem when I'm using Object>>deprecated:transformWith: .
Download the zip file to have a code to import into a new Pharo image for reproduce it :

Do the unit test MyClassTest>>testName, the image is freezing. I found no possibility to debug or quit, I'm forced to kill the pharo process.

This is a basic code and I'm using the Object>>deprecated:transformWith: as in ClassDescription>>definition example.

name
	"Example of deprecated rewrite from ClassDescription>>definition"

	self
		deprecated: #name
		transformWith: '`@receiver name:' -> '`@receiver id:'.

	^id

And the test :

testName

	| myClass |
	myClass := MyClass new.
	self assert: myClass name.

My config :

  • Windows 11 Pro
  • Pharo-11.0.0+build.545 (64 Bit)

To reproduce import this code and see MyClass-Tests package with the test :
MyClass-Tests.zip

@labordep
Copy link
Collaborator Author

@tinchodias find a way to explore :

When this checkbox is uncheck : image there is a window with an error at the execution of the test : image

image

@labordep
Copy link
Collaborator Author

labordep commented Feb 16, 2023

And when the checkbox image is checked, the freeze is here :

image

@MarcusDenker
Copy link
Member

Just looking at the code:
the colons are nit correct: "@receiver name:" --> should be "@receiver name", same for id.

@MarcusDenker
Copy link
Member

it freezes I think due to #name on classes being used very very deep in the system, if the rename goes wrong it will call that faulty method for sure during error reporting, leading to a loop.

@labordep
Copy link
Collaborator Author

Thanks @MarcusDenker, but we have the same problem in Bloc (pharo-graphics/Bloc#207) for another message (not name).

@labordep
Copy link
Collaborator Author

It should be better to open a debugger instead of freeze :) I tried to interrupt an eventually loop but this is not working (I have tried MAJ CTRL + . )

@MarcusDenker
Copy link
Member

But the debugger calls #name again, which leads to the same error, which leads to the same error, which leads to the same error...

@MarcusDenker
Copy link
Member

MarcusDenker commented Feb 20, 2023

If I try this on an example that is not #name of Class (which is very special, as it is called a lot and especially during error handling), it works for me as it should. I get a SytnaxErrorDebugger, I can close it, just as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants