KernelMC
I encountered an unhandled exception after clicking the "Start PLC Simulator" button. The full bug report is as follows:

app-title:
beremiz

app-version:
3.0
Release: 2024-08-12

cwd:
C:\Users\openplc\OpenPLC_Editor

date:
Tue Aug 27 13:10:17 2024

e-type:
<class 'RuntimeError'>

e-value:
wrapped C/C++ object of type ComboBox has been deleted

locals:
    self: <controls.VariablePanel.VariablePanel object at 0x000001D04691D550>
    returnType: None
    description: None
    words: ['C', 'Config0']

platform:
Windows-10-10.0.22631-SP0

python-version:
3.9.10

self:
    VARIABLE_CHOICES_DICT: {'All': 'All', 'Interface': 'Interface', '   Input': '   Input', '   Output': '   Output', '   InOut': '   InOut', '   External': '   External', 'Variables': 'Variables', '   Local': '   Local', '   Temp': '   Temp', 'Global': 'Global'}
    MainSizer: <wx._core.FlexGridSizer object at 0x000001D04691D790>
    ReturnTypeLabel: <wx._core.StaticText object at 0x000001D04691D700>
    ReturnType: <wx._core.ComboBox object at 0x000001D04691D8B0>
    DescriptionLabel: <wx._core.StaticText object at 0x000001D04691D4C0>
    Description: <wx._core.TextCtrl object at 0x000001D04691D430>
    ClassFilter: <wx._core.ComboBox object at 0x000001D04691D1F0>
    AddButton: <wx.lib.buttons.GenBitmapButton object at 0x000001D04691D160>
    DeleteButton: <wx.lib.buttons.GenBitmapButton object at 0x000001D04691D0D0>
    UpButton: <wx.lib.buttons.GenBitmapButton object at 0x000001D046912CA0>
    DownButton: <wx.lib.buttons.GenBitmapButton object at 0x000001D046912940>
    VariablesGrid: <controls.CustomGrid.CustomGrid object at 0x000001D04691D3A0>
    ParentWindow: <editors.ProjectNodeEditor.ProjectNodeEditor object at 0x000001D0490C9E50>
    Controler: <ProjectController.ProjectController object at 0x000001D046A7D3A0>
    ElementType: 'config'
    Debug: False
    RefreshHighlightsTimer: <wx._core.Timer object at 0x000001D046912700>
    Filter: 'All'
    FilterChoices: ['All', 'Global']
    FilterChoiceTransfer: {'All': 'All', 'Interface': 'Interface', '   Input': 'Input', '   Output': 'Output', '   InOut': 'InOut', '   External': 'External', 'Variables': 'Variables', '   Local': 'Local', '   Temp': 'Temp', 'Global': 'Global'}
    DefaultValue: <plcopen.VariableInfoCollector._VariableInfos object at 0x000001D046A9DAC0>
    DefaultTypes: {'All': 'Global'}
    Table: <controls.VariablePanel.VariableTable object at 0x000001D046A87C10>
    ColSettings: {'size': [40, 80, 100, 80, 110, 120, 100, 160], 'alignement': [2304, 0, 0, 0, 0, 0, 0, 0], 'fixed_size': [True, False, True, False, True, True, True, False]}
    PanelWidthMin: 790
    BodyType: None
    ClassList: ['Global']
    TagName: 'C::Config0'
    PouNames: ['hydroblunder']
    Values: []

traceback:
  File "C:\Users\openplc\OpenPLC_Editor\.\editor\BeremizIDE.py", line 836, in OnMenu
    getattr(self.CTR, method)()
  File "C:\Users\openplc\OpenPLC_Editor\.\editor\ProjectController.py", line 2003, in _Run
    if (self._Connect() is False):
  File "C:\Users\openplc\OpenPLC_Editor\.\editor\ProjectController.py", line 2073, in _Connect
    self._View.RefreshView()
  File "C:\Users\openplc\OpenPLC_Editor\.\editor\editors\ProjectNodeEditor.py", line 83, in RefreshView
    ConfTreeNodeEditor.RefreshView(self)
  File "C:\Users\openplc\OpenPLC_Editor\.\editor\editors\ConfTreeNodeEditor.py", line 280, in RefreshView
    EditorPanel.RefreshView(self)
  File "C:\Users\openplc\OpenPLC_Editor\.\editor\editors\EditorPanel.py", line 141, in RefreshView
    self.RefreshVariablePanel()
  File "C:\Users\openplc\OpenPLC_Editor\.\editor\editors\EditorPanel.py", line 145, in RefreshVariablePanel
    self.VariableEditor.RefreshView()
  File "C:\Users\openplc\OpenPLC_Editor\.\editor\controls\VariablePanel.py", line 727, in RefreshView
    self.ReturnType.Enable(False)
<class 'RuntimeError'>: wrapped C/C++ object of type ComboBox has been deleted

wx-platform:
__WXMSW__

wx-version:
4.2.0
 
It appears an object was accessed whose destructor had already run. Interestingly, the exception did not occur the second time I clicked the "Start PLC Simulator" button, and I've not been able to reproduce it.
Reply 0 0
thiagoralves
This is odd... I can't reproduce this on my system. I'm wondering if you had any antivirus or protection software that blocked some action of the editor which caused the crash.
Reply 0 0
KernelMC
This occurred on a fresh install of Windows 11, so Windows Defender was active. What makes you think this is AV related? AV usually hooks into the FS interface, but this looks like a use-after-free issue (a python reference to a C++ object which outlived the object).

Regardless, until we can nail down a way to reproduce it, its not worth spending time on. At least now it's searchable on the forum in case it happens again.
Reply 1 0
Write a reply...
Reply