OpenClonk Bugtracker - OpenClonk
View Issue Details
0001903OpenClonkEngine - C4Scriptpublic2017-04-09 21:162017-04-12 09:27
Assigned ToIsilkor 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusresolvedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001903: Inconclusive error message "ERROR: internal error: value stack left unbalanced (in Definition.FunctionName)"
DescriptionIn some of my custom scenarios the above mentioned message appears, and it does not really tell me how to fix the error.

It seems to be related to old style effect calls, such as "FxInt...Timer"; Replacing these with a new style effect definition seems to fix the problem, as the error message no longer appears.

Unfortunately, the parser does not tell me about all occurrences in the log: I have to fix one problem at a time, so after fixing one problem I get the next message. This makes getting the objects to a compatible state tiresome.
TagsNo tags attached.
Attached Fileszip (1,152) 2017-04-10 20:06
log OpenClonk.log (1,383) 2017-04-11 18:33

2017-04-10 05:11   
Found the problem: this message occurs if you overload a function call and the parameters are inconsistent between the original and the overloaded function.
2017-04-10 17:17   
(Last edited: 2017-04-10 17:25)
Can you attach a test case for this bug?

> In some of my custom scenarios the above mentioned message appears, and it does not really tell me how to fix the error.
Internal errors happen when the engine made some assumptions about its current state, but finds out that the state is not what it expected. It means the parser got confused at some point; you should not work around it in script, we need to fix it in C++.

2017-04-10 20:08   
Yes, it's a crash in C++. Still, the issues can be fixed by fixing issues in the script, so whatever causes the crash at the moment should ideally give you a warning with a line number later.

I added comments in the script what the actual errors are, because it is not so obvious what is wrong in either file, just by looking at the script.
2017-04-11 17:10   
Don't know if you got the message, the test case is attached in the bug entry :)
2017-04-11 17:33   
I'm getting "C4AulScriptEngine linked - 83098 lines, 15 warnings, 0 errors" with that scenario on the 06a1ebe autobuild, and apparently so does @Clonkonaut.
2017-04-11 17:39   
I was using an older snapshot, so I guess it's fixed then. Should we add the test to the repository nonetheless? I can upload my log, too, if it helps.
2017-04-11 17:41   
Which snapshot was that? I don't believe there has been any changes to the parser recently, so it might have been something on the script side. If so, we can (and should) still fix the parser.
2017-04-11 18:33   
Here is the log file
2017-04-12 09:27   
The crash you're seeing is from passing an invalid parameter to a CRT function which we fixed a month ago. The internal error message is ultimately harmless and doesn't occur in current builds, so I'm going to tentatively mark this one invalid.

Issue History
2017-04-09 21:16MarkyNew Issue
2017-04-10 05:11MarkyNote Added: 0005645
2017-04-10 17:17IsilkorNote Added: 0005646
2017-04-10 17:25IsilkorNote Edited: 0005646bug_revision_view_page.php?bugnote_id=5646#r1320
2017-04-10 17:26IsilkorSeverityblock => major
2017-04-10 20:06MarkyFile Added:
2017-04-10 20:08MarkyNote Added: 0005647
2017-04-11 17:10MarkyNote Added: 0005649
2017-04-11 17:33IsilkorNote Added: 0005650
2017-04-11 17:39MarkyNote Added: 0005651
2017-04-11 17:41IsilkorNote Added: 0005652
2017-04-11 18:33MarkyFile Added: OpenClonk.log
2017-04-11 18:33MarkyNote Added: 0005653
2017-04-12 09:27IsilkorAssigned To => Isilkor
2017-04-12 09:27IsilkorStatusnew => resolved
2017-04-12 09:27IsilkorResolutionopen => no change required
2017-04-12 09:27IsilkorNote Added: 0005654