Anonymous Login
2018-02-23 23:10 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001990OpenClonkEngine - C4Scriptpublic2018-02-04 12:41
ReporterLuchs 
Assigned ToLuchs 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version8.0 
Summary0001990: Warnings in DirectExec crash the game
DescriptionFor some reason, enabledWarnings.empty() crashes. see stack trace below.
Steps To ReproduceExecute f(,) in the script console
Additional InformationStack trace from message board command:

# 10 Source "../src/gui/C4MessageInput.cpp", line 821, in ProcessCommand [0x55e4da85f44a]
        818: if (player) player_num = player->Number;
        819:
        820: // send command to network
      > 821: ::Control.DoInput(CID_MsgBoardCmd, new C4ControlMsgBoardCmd(szCmdName, pCmdPar, player_num), CDT_Decide);
        822:
        823: // ok
        824: return true;
# 9 Source "../src/control/C4GameControl.cpp", line 410, in DoInput [0x55e4da66b436]
        407: else
        408: {
        409: // Local mode: execute at once
      > 410: ExecControlPacket(eCtrlType, pPkt);
        411: delete pPkt;
        412: }
# 8 Source "../src/control/C4GameControl.cpp", line 488, in ExecControlPacket [0x55e4da66beb8]
        485: {
        486: // execute it
        487: if (!pPkt->PreExecute()) Log("Control: PreExecute failed for direct control!");
      > 488: pPkt->Execute();
        489: // record it
        490: if (pRecord)
        491: pRecord->Rec(eCtrlType, pPkt, Game.FrameCounter);
# 7 Source "../src/control/C4Control.cpp", line 341, in Execute [0x55e4da64fddd]
        338: }
        339:
        340: // Run script
      > 341: C4Value rv(::AulExec.DirectExec(::ScriptEngine.GetPropList(), script.getData(), "message board command"));
        342: #ifndef NOAULDEBUG
        343: C4AulDebug* pDebug = C4AulDebug::GetDebugger();
        344: if (pDebug)
# 6 Source "../src/script/C4AulExec.cpp", line 1041, in DirectExec [0x55e4dac43cc2]
       1038: else
       1039: {
       1040: // Expect a single statement (e.g. "bar()")
      >1041: pFunc->ParseDirectExecStatement(&::ScriptEngine, context);
       1042: }
       1043: C4AulParSet Pars;
       1044: C4Value vRetVal(Exec(pFunc.get(), p, Pars.Par, fPassErrors));
# 5 Source "../src/script/C4AulParse.cpp", line 839, in ParseDirectExecStatement [0x55e4dac5f880]
        836: ClearCode();
        837: // parse
        838: C4AulParse state(this, context, Engine);
      > 839: auto func = state.Parse_DirectExec(Script, false);
        840: C4AulCompiler::Compile(this, func.get());
        841: }
# 4 Source "../src/script/C4AulParse.cpp", line 855, in Parse_DirectExec [0x55e4dac5e1f7]
        852: }
        853: else
        854: {
      > 855: auto expr = Parse_Expression();
        856: func = std::make_unique<::aul::ast::FunctionDecl>("$internal$eval");
        857: func->body = std::make_unique<::aul::ast::Block>();
        858: func->body->children.push_back(std::make_unique<::aul::ast::Return>(std::move(expr)));
# 3 Source "../src/script/C4AulParse.cpp", line 1469, in Parse_Expression [0x55e4dac61fe5]
       1466: // Well, it looks like one, at least
       1467: auto func = ::aul::ast::CallExpr::New(NodeStart);
       1468: func->callee = identifier;
      >1469: Parse_CallParams(func.get());
       1470: expr = std::move(func);
       1471: }
       1472: else
# 2 Source "../src/script/C4AulParse.cpp", line 1172, in Parse_CallParams [0x55e4dac70d38]
       1169: {
       1170: case ATT_COMMA:
       1171: // got no parameter before a ","
      >1172: Warn(C4AulWarningId::empty_parameter_in_call, (unsigned)call->args.size(), call->callee.c_str());
       1173: call->args.push_back(::aul::ast::NilLit::New(TokenSPos));
       1174: Shift();
       1175: break;
# 1 Source "../src/script/C4AulParse.cpp", line 134, in Warn [0x55e4dac53b41]
        132: void C4AulParse::Warn(C4AulWarningId warning, ...)
        133: {
      > 134: if (!pOrgScript->IsWarningEnabled(TokenSPos, warning))
        135: return;
        136: va_list args; va_start(args, warning);
        137: StdStrBuf Buf = FormatStringV(C4AulWarningMessages[static_cast<size_t>(warning)], args);
# 0 | Source "../src/script/C4AulParse.cpp", line 1784, in empty
    | 1782: bool C4ScriptHost::IsWarningEnabled(const char *pos, C4AulWarningId warning) const
    | 1783: {
    | >1784: assert(!enabledWarnings.empty());
    | 1785: if (enabledWarnings.empty())
    | 1786: return false;
      Source "/usr/bin/../include/c++/v1/map", line 1016, in IsWarningEnabled [0x55e4dac53d07]
       1013: const_reverse_iterator crend() const _NOEXCEPT {return rend();}
       1014:
       1015: _LIBCPP_INLINE_VISIBILITY
      >1016: bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
       1017: _LIBCPP_INLINE_VISIBILITY
       1018: size_type size() const _NOEXCEPT {return __tree_.size();}
       1019: _LIBCPP_INLINE_VISIBILITY
Segmentation fault (Address not mapped to object [0x148])
[1] 4162 segmentation fault (core dumped)
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0006111

occ (reporter)

Hi! There's been a check-in that references this bug. For more information you can visit the repository browser at this address:
https://git.openclonk.org/openclonk.git/commitdiff/cd2b8370dabf3fc6195af303bd6cdd72240ad510

Changeset cd2b837 by Lukas Werling <lukas.werling@gmail.com>
Fix warnings in DirectExec crashing (0001990)

~0006112

occ (reporter)

Hi! There's been a check-in that references this bug. For more information you can visit the repository browser at this address:
https://git.openclonk.org/openclonk.git/commitdiff/ce9245c55c41731c0643ded35e95b98285c2c84d

Changeset ce9245c by Lukas Werling <lukas.werling@gmail.com>
Fix warnings in DirectExec crashing (0001990)

+Notes

-Issue History
Date Modified Username Field Change
2018-02-04 12:09 Luchs New Issue
2018-02-04 12:34 occ Note Added: 0006111
2018-02-04 12:41 occ Note Added: 0006112
2018-02-04 12:41 Luchs Assigned To => Luchs
2018-02-04 12:41 Luchs Status new => resolved
2018-02-04 12:41 Luchs Resolution open => fixed
2018-02-04 12:41 Luchs Fixed in Version => 8.0
+Issue History