pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Dropping an external file, click on Cancel and get a debugger

Open tinchodias opened this issue 1 year ago • 1 comments

To Reproduce

Steps to reproduce the behavior:

  1. Go to OS file browser
  2. Drag a .st file into the Pharo IDE to see the dialog with 2 options
  3. Press on Cancel
  4. See "Instance of DefaultExternalDropHandler did not understand #morphicUIManager" titled debugger

Expected behavior Nothing should happen after selecting Cancel.

Screenshots

Screen recording: fileInCancelError

Version information:

Pharo 12.0.0 Build information: Pharo-12.0.0+SNAPSHOT.build.1510.sha.7efef560919a459de9e2fad384ee4614fdcb1691 (64 Bit)

tinchodias avatar May 24 '24 14:05 tinchodias

I think the problem comes from (some?) Morphic step methods are processed twice:

runStepMethodsIn: aWorld
	"Perform periodic activity inbetween event cycles"

	| queue nextInQueue|
	"If available dispatch some deferred UI Message"
	queue := self deferredUIMessages.
	[(nextInQueue := queue nextOrNil) isNil]
		whileFalse: [ nextInQueue value].
	self runLocalStepMethodsIn: aWorld.
	"The multi-threaded global Transcript needs to be updated periodically and synchronously with the UI."
	Smalltalk tools transcript stepGlobal

It seems that the current implementation of WaitfreeQueue>>#nextOrNilSuchThat: does not remove zombie items from the queue, which can lead to processing them twice.

  • One solution could be removing zombie items from the queue as we encounter them.
  • Another one could be ensuring that makeCircular is atomic, but I don't know if it is related.

hernanmd avatar May 31 '24 17:05 hernanmd

Related to #17480

guillep avatar Dec 20 '24 09:12 guillep