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

Problem proxying BlockClosure >> #value #20

Open
PalumboN opened this issue Oct 17, 2024 · 2 comments · May be fixed by #21
Open

Problem proxying BlockClosure >> #value #20

PalumboN opened this issue Oct 17, 2024 · 2 comments · May be fixed by #21

Comments

@PalumboN
Copy link

PalumboN commented Oct 17, 2024

If I install a method proxy in BlockClosure >> #value:

handler :=  MpCountingHandler new.
p := MpMethodProxy 
	onMethod: BlockClosure >> #value 
	handler: handler.
p install.
p enableInstrumentation.

And then save the image.

I get this error (and the image is broken: it's impossible to close the debugger to escape the bug and the image was saved in this state):

image

It seems like the trapContext is not the expected...

@PalumboN
Copy link
Author

I changed the method to find the correct context using:

			trapContext := thisContext findNextUnwindContextUpTo: nil.
			[
				trapContext ifNil: [ "Nothing to do here"
					'Abort method proxy' traceCr.
					^ nil
				]. 
				trapContext hasTemporaryVariableNamed: 'wasMeta'.
			] whileFalse: [ trapContext := trapContext sender ].

It avoids the bug during the current session (no exception is thrown) 👍
But when you rerun the saved image this error appears 👎
image

Anyway, you can close this debugger and continue using the image normally... I'll send a PR.

@PalumboN PalumboN linked a pull request Oct 17, 2024 that will close this issue
@Gabriel-Darbord
Copy link

Gabriel-Darbord commented Oct 19, 2024

I also get that same first error when closing a debugger after another error occured due to the instrumentation (e.g. #22, or when my own instrumentation code fails).
I did not instrument blocks, and the debugger is not post-mortem.
To close the debugger, I return an empty expression and proceed twice.

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

Successfully merging a pull request may close this issue.

2 participants