Isotropix Forums

Constant UI Crashes

Clarisse Scripting related topics

Constant UI Crashes

Unread postby tsn » Fri Feb 25, 2022 7:01 pm

Hi there,

Just want to address this issue here before I file a bug. Whenever I run a script with a custom UI two times in quick succession, Clarisse 5 crashes. Same applies when I run two different scripts with UIs. I don't remember having those problems in v4, but it's 100% reproducible and 200% annoying.

Is there perhaps something I'm missing here, e.g. a destroyer command in the EventRewire class or anything else? The only way I know to destroy a window is this one after calling EventRewire:

Code: Select all
window.show()
while window.is_shown(): ix.application.check_for_events()
window.destroy()

Not sure if the error message helps here, but I think it's not very specific:

Code: Select all
Program received exception EXCEPTION_ACCESS_VIOLATION (0xC0000005).
Memory statistics: Used = 694 MiB, Peak = 694 MiB, Free = 56388 MiB
#  0 0x7FFBAE8CB069 core_debug_seh_filter (0x7FFBAE8CB069:0x7FFBAE8CB060+0x9) in C:\Program Files\Isotropix\Clarisse 5.0 SP7b\Clarisse\ix_core.dll (0x7FFBAE8C0000)
#  1 0x7FF70B4B5F1F Es wurde versucht, auf eine unzulässige Adresse zuzugreifen. (0xA5F1F) in C:\Program Files\Isotropix\Clarisse 5.0 SP7b\Clarisse\clarisse.exe (0x7FF70B410000)
#  2 0x7FFBA7F9ECD0 _C_specific_handler (0x7FFBA7F9ECD0:0x7FFBA7F9EC30+0xA0) in C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll (0x7FFBA7F90000)
#  3 0x7FFBC12F20CF _chkstk (0x7FFBC12F20CF:0x7FFBC12F1FB0+0x11F) in C:\WINDOWS\SYSTEM32\ntdll.dll (0x7FFBC1250000)
#  4 0x7FFBC12A1454 RtlRaiseException (0x7FFBC12A1454:0x7FFBC12A1020+0x434) in C:\WINDOWS\SYSTEM32\ntdll.dll (0x7FFBC1250000)
#  5 0x7FFBC12F0BFE KiUserExceptionDispatcher (0x7FFBC12F0BFE:0x7FFBC12F0BD0+0x2E) in C:\WINDOWS\SYSTEM32\ntdll.dll (0x7FFBC1250000)
#  6 0x7FFBAE8DC918 CoreVersion::epsilon (0x7FFBAE8DC918:0x7FFBAE8DBFE0+0x938) in C:\Program Files\Isotropix\Clarisse 5.0 SP7b\Clarisse\ix_core.dll (0x7FFBAE8C0000)

Thx!
tsn
 
Posts: 35
Joined: Tue Mar 31, 2015 5:04 pm

Re: Constant UI Crashes

Unread postby tsn » Mon Feb 28, 2022 4:15 pm

Seems I was able to find the issue: it was obviously not a related to the UI, but to an error inside a try-except routine.Sorry for the alarm, but it was really extremely annoying. Anyway, I'm hoping that was really the reason for all those crashes I had ;)
tsn
 
Posts: 35
Joined: Tue Mar 31, 2015 5:04 pm

Re: Constant UI Crashes

Unread postby anemoff » Mon Feb 28, 2022 5:17 pm

No worries! Don't hesitate if you stumble on a real Python issue.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 482
Joined: Wed Jan 13, 2016 10:10 am

Re: Constant UI Crashes

Unread postby tsn » Mon Feb 28, 2022 7:46 pm

Will do!
tsn
 
Posts: 35
Joined: Tue Mar 31, 2015 5:04 pm

Re: Constant UI Crashes

Unread postby tsn » Tue Mar 01, 2022 4:59 pm

Seems I was cheering to early... At least I was able to boil the problem down to the basic script below. To make Clarisse crash you only have to load the script to an empty scene and execute it several times. Sometimes it'll crash after the 2nd run, sometimes it takes 10+ runs, but in the end Clarisse will definitely crash. The code structure is from a v4 script and is used on a Windows 10 machine.

Thanks for any help!

Code: Select all
class EventRewire(ix.api.EventObject):

    def cancel(self, sender, evtid):
        sender.get_window().hide()

        print("Script cancelled.")

    def run(self, sender, evtid):

        sender.get_window().hide()

        self.inp1 = in1.get_value()
        self.inp2 = in2.get_value()
        self.inp3 = in3.get_value()

# ----- Draw the window

clarisse_win = ix.application.get_event_window()
window = ix.api.GuiWindow(clarisse_win, 900, 400, 500, 200)
window.set_title("Crash on Demand")

panel = ix.api.GuiPanel(window, 0, 0, window.get_width(), window.get_height())
panel.set_constraints(ix.api.GuiWidget.CONSTRAINT_LEFT, ix.api.GuiWidget.CONSTRAINT_TOP,
                      ix.api.GuiWidget.CONSTRAINT_RIGHT, ix.api.GuiWidget.CONSTRAINT_BOTTOM)

label1 = ix.api.GuiLabel(panel, 20, 20, 100, 20, "Value 1")
label2 = ix.api.GuiLabel(panel, 100, 20, 100, 20, "Value 2")
label3 = ix.api.GuiLabel(panel, 180, 20, 100, 20, "Value 3")

in1 = ix.api.GuiNumberField(panel, 20, 60, 50, "")
in2 = ix.api.GuiNumberField(panel, 100, 60, 50, "")
in3 = ix.api.GuiNumberField(panel, 180, 60, 50, "")

in1.set_value(1)
in2.set_value(2)
in3.set_value(3)

run_button= ix.api.GuiPushButton(panel, 20, 120, 100, 25, "OK")
cancel_button = ix.api.GuiPushButton(panel, 200, 120, 100, 25, "Cancel")

event_rewire = EventRewire()
event_rewire.connect(run_button, 'EVT_ID_PUSH_BUTTON_CLICK', event_rewire.run)
event_rewire.connect(cancel_button, 'EVT_ID_PUSH_BUTTON_CLICK', event_rewire.cancel)

window.show()

while window.is_shown():
    ix.application.check_for_events()

window.destroy()
tsn
 
Posts: 35
Joined: Tue Mar 31, 2015 5:04 pm

Re: Constant UI Crashes

Unread postby anemoff » Tue Mar 01, 2022 5:47 pm

I've reproduced the crash on my side. Would you my mind creating a bug report for proper tracking?
Thanks for the script.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 482
Joined: Wed Jan 13, 2016 10:10 am

Re: Constant UI Crashes

Unread postby tsn » Tue Mar 01, 2022 6:52 pm

Thanks so much for checking the script so quickly. Glad to hear that you're able to reproduce the error! And, yes, I'll create a bug report, of course.
tsn
 
Posts: 35
Joined: Tue Mar 31, 2015 5:04 pm

Re: Constant UI Crashes

Unread postby tsn » Tue Mar 01, 2022 6:59 pm

Bug report is done ;)
tsn
 
Posts: 35
Joined: Tue Mar 31, 2015 5:04 pm

Re: Constant UI Crashes

Unread postby anemoff » Tue Mar 01, 2022 7:07 pm

Thanks!
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 482
Joined: Wed Jan 13, 2016 10:10 am


Return to Scripting