Error "Stack Level too deep" - command.set_validation_proc() - SU2020 - Mac OSX
Related to #477 - but sounds like it is a SU2020 regression.
Description of reported issue:
I use SU2020-1 on Mac OSX (Catalina), with NO plugins (other that the SU ones) - Ruby console open.
I run a small plugin, here attached. It basically creates a command in a toolbar. The command does nothing (just print "Fredo Execute Menu"). However it has a validation_proc attached, which just print a trace of the current model.
module Test_MenuMac #Create a command with a set_validation_proc def self.startup # Create toolbar curdir = File.dirname __FILE__.gsub("\\", "/") icon_path = File.join('Icon_menu_mac.png') tb = UI::Toolbar.new "Fredo Menu Mac" cmd = UI::Command.new("Test menu Mac") { puts "Fredo Execute Menu" } cmd.large_icon = cmd.small_icon = File.join(curdir, 'Icon_menu_mac.png') cmd.set_validation_proc { (menu_test?) ? MF_ENABLED : MF_GRAYED } tb.add_item cmd UI.menu("Plugins").add_item cmd (tb.get_last_state == -1) ? tb.show : tb.restore end #Test proc for set_validation_proc def self.menu_test? model = Sketchup.active_model puts "\nMenu Test - model = #{model} - valid = #{model.valid?} path = #{(model.path) ? File.basename(model.path) : 'nil'}" true end #Loading the file once unless file_loaded?("menu_mac.rb") startup file_loaded("menu_mac.rb") end end # Module Test_MenuMac
Open Sketchup - You get a new model.
Open an existing model. Traces from the validation proc are shown. Actually multiple ones, pertaining to both the New model and the Existing model.
Make a change to the existing model. I just open and close a group.
Close the model. You get a prompt for Saving - Click Yes.
You get an other bunch of traces from the validation_proc, pertaining both to the existing and new model.
But right after you get an Error: "Stack level too deep"
I attach here all the traces corresponding to the example of the video
From there, you may have problem with Sketchup, for instance indefinite wait. And if you redo steps 2) to 6) again, you may likely get a crash of Sketchup. I logged a bugsplat report #29772.
SU-46193
Hi Fredosixx,
I tried to reproduce this with SU2025.0 with Mac OS (Sonoma), but didnt get the error as 'Stack level too deep'. Tried multiple times and it didnt crash the Sketchup as well. Is this still an issue for you with latest version? Please let us know.
Thanks Kalpana