REBOL3 tracker
  0.9.12 beta
Ticket #0002190 User: anonymous

Project:

Previous Next
rss
TypeBug Statuspending Date10-Dec-2014 01:23
Versionr3 master CategoryError Handling Submitted byszeng
PlatformAll Severitycrash Prioritynormal

Summary Interaction between Error and HALT/QUIT causes crash
Description See the example and the embedded analysis below.
Example code
REBOL []

	attempt [; this sets Saved_State
		catch/quit [ ;this calls Try_Block_Halt and sets Halt_State
			print x ; this causes an error, and calls "longjmp(*State_State)", which invalidates Halt_State above.
		]
	]
	load %./ ; Just tries to fill up the C stack and messes up "Halt_State".
	halt ; Jumps to the invalid "Halt_State", and crashes

Assigned ton/a Fixed in- Last Update21-Mar-2015 23:31


Comments
(0004545)
szeng
10-Dec-2014 01:56

This is another test case:

REBOL[]

catch/quit [ ;sets Halt_State
    attempt [ ;sets Saved_State
        quit ; jumps to Halt_State, and invalidates "Saved_State"
    ]
]
print x ; Causes a jump to the invalid "Saved_State"
(0004546)
szeng
10-Dec-2014 03:01

This should be fixed by: https://github.com/zsx/r3/commit/6f4545f08ef3e4b6ea6ebae26ccbf156789b844e

The idea is to restore the invalid Halt_State/Saved_State when a jump happens.
(0004547)
szeng
10-Dec-2014 04:24

an updated fix is at: https://github.com/zsx/r3/commit/3a78dbf024743e9b574379fc079cd004cc10f331
(0004559)
abolka
26-Jan-2015 07:33

In the core-tests suite.
(0004610)
abolka
21-Mar-2015 23:30

Pull request pending (of the latest suggested fix): https://github.com/rebol/rebol/pull/229

Date User Field Action Change
21-Mar-2015 23:31 abolka Status Modified reviewed => pending
21-Mar-2015 23:30 abolka Comment : 0004610 Added -
26-Jan-2015 07:33 abolka Status Modified submitted => reviewed
26-Jan-2015 07:33 abolka Comment : 0004559 Added -
10-Dec-2014 04:24 szeng Comment : 0004547 Added -
10-Dec-2014 03:01 szeng Comment : 0004546 Added -
10-Dec-2014 01:57 szeng Comment : 0004545 Modified -
10-Dec-2014 01:56 szeng Comment : 0004545 Added -
10-Dec-2014 01:28 szeng Summary Modified Interaction between Error and QUIT causes crash => Interaction between Error and HALT/QUIT causes crash
10-Dec-2014 01:28 szeng Code Modified -
10-Dec-2014 01:23 szeng Ticket Added -