Skip to content

Exceptions inside of blocks #12

@JosephAustin

Description

@JosephAustin

In many cases it appears that exceptions getting thrown within a do block will cause the program to hang, instead of reporting the backtrace. It then continuously increases in memory use. The problem can also be triggered by using a rescue and trying to print out the exception's message, which leads me to think its message is either very large or generates recursively somehow.

ex:

      button "Purge", parent:packer do
        blah = not_existing_variable
        Dir.glob(File.join($window.trashFolder, "*.*")).each do |file|
          if(!File.directory? file)
            File.delete file
          end
        end
      end

The above code crashes like you would expect on that second line, but at that point the code totally freezes. If I print out its backtrace I get:

../lib/fidgit/event.rb:128:in `call'

../lib/fidgit/event.rb:128:in `block in publish'

../lib/fidgit/event.rb:127:in `reverse_each'

../lib/fidgit/event.rb:127:in `publish'

../lib/fidgit/states/gui_state.rb:284:in `redirect_released_mouse_button'

etc...

Seems to me that something goes totally batty in the event handling. I'm on x86-64 Linux using Ruby 2.1.2p95

EDIT

The issue appears to be caused by the destruction order of widgets in any sort of list. An empty list finishes faster, but the problem is exponential. Manually catching issues inside of event blocks and clearing the list widgets with @widget.parent.clear and then setting the widget itself to nil immediately works, and the error can then be thrown. This provides a troublesome but functional work-around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions