Page MenuHomeFeedback Tracker

64 bit crashes when deleting a control from inside an event handler with INT_DIVIDE_BY_ZERO
Closed, ResolvedPublic

Description

64 bit crashes when deleting a control from inside an event handler on that control.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
10.0.14393
Category
Scripting
Steps To Reproduce
  1. Go into a mission with debug console.
  2. Paste in debug console:
[] spawn {
disableSerialization;
sleep 2; 
createDialog "RscDisplayCommon";
_dialog = findDisplay 999;  
_control = _dialog ctrlCreate ["RscButton", 420];
_control ctrlSetPosition [0,0,1,1];
_control ctrlSetText "CRASH";
_control ctrlCommit 0;
_control ctrlAddEventHandler ["MouseButtonDown", "ctrlDelete ((findDisplay 999) displayCtrl 420)"];
};
  1. Click local exec, and then ESC straight away (within the 2 second sleep)
  2. Click 'CRASH'.
Additional Information

Note the sleep/spawn etc. is just to let you close the debug console to display the dialog. Last line is the issue.

Works (deletes the control and doesn't crash) in 32bit, not 64bit.

Log entry shows:

=======================================================


Exception code: C0000094 INT_DIVIDE_BY_ZERO at 026FC05C
graphics: D3D11, Device: NVIDIA GeForce GTX 1080

Workaround is
_control ctrlAddEventHandler ["MouseButtonDown", "[] spawn {ctrlDelete ((findDisplay 999) displayCtrl 420)}"];

Event Timeline

Lecks created this task.Mar 17 2017, 7:46 AM
Pi closed this task as Resolved.Jun 8 2021, 7:24 PM
Pi claimed this task.
Pi added a subscriber: Pi.

Closing due to age