OpenClonk Bugtracker - OpenClonk
View Issue Details
0001696OpenClonkEngine - C4Scriptpublic2016-03-01 01:412017-12-26 14:11
ReporterSven2 
Assigned ToGünther 
PrioritynormalSeveritycrashReproducibilityhave not tried
StatusfeedbackResolutionopen 
PlatformVisual C++ 2008OSWindowsOS Version 
Product Version 
Target Versiongit masterFixed in Version 
Summary0001696: Global->eval("test") crashes
DescriptionDirectExec in global context crashes. This effects several places; e.g. eval in global context (not scenario context) or custom messageboard commands.

The crash happens because the ScriptEngine is set as the owner of the temporarily created function, which results in a NULL ScriptHost in pOrgScript (and then NULL dereference trying to get pOrgScript->Engine).

An easy fix would be to always run DirectExec in the scenario context. But I think a more sensible solution would be to either have a global DirectExec host or make the ScriptEngine a ScriptHost again.

Guenther? I believe the error happens since one of your cleanup commits (Making the ScriptEngine not a ScriptHost). I don't just want to undo the change if there was a good reason for it.
Steps To ReproduceStart Minimal.ocs; then execute Global->eval("test") from the console input.
TagsNo tags attached.
Attached Files

Notes
(0005015)
Zapper   
2016-03-01 19:42   

Reminder sent to: Günther

Just in case Sven didn't tell you and just assigned the bug to you (which does NOT notify afaik? And thus is not really helpful at all).
(0005969)
Luchs   
2017-12-26 14:11   
>An easy fix would be to always run DirectExec in the scenario context.

I think Sven did that for the new editor, so it doesn't seem to be possible to trigger this crash from the UI anymore.

I'm still only moving it from the 8.0 target because the underlying issue is probably still there...

Issue History
2016-03-01 01:41Sven2New Issue
2016-03-01 01:41Sven2Statusnew => assigned
2016-03-01 01:41Sven2Assigned To => Günther
2016-03-01 01:44Sven2Statusassigned => feedback
2016-03-01 01:44Sven2Description Updatedbug_revision_view_page.php?rev_id=1223#r1223
2016-03-01 19:42ZapperNote Added: 0005015
2017-08-05 13:58MaikelTarget Version => 8.0
2017-12-26 14:11LuchsTarget Version8.0 => git master
2017-12-26 14:11LuchsNote Added: 0005969