Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity 2017.1 WebGL build crashes on Lua script run #212

Open
greymag opened this issue Oct 3, 2017 · 4 comments
Open

Unity 2017.1 WebGL build crashes on Lua script run #212

greymag opened this issue Oct 3, 2017 · 4 comments

Comments

@greymag
Copy link

greymag commented Oct 3, 2017

Any code, for example
Script.RunString("return 5");
crashes in webgl build

abort(150) at jsStackTrace (WebGL.asm.framework.unityweb:1218:21)
stackTrace (WebGL.asm.framework.unityweb:1232:23)
abort (WebGL.asm.framework.unityweb:442185:53)
nullFunc_iiiiiiiii (WebGL.asm.framework.unityweb:28754:7)
b150 (WebGL.asm.framework.unityweb:435234:20)
ftCall_iiiiiiiii
mftCall_iiiiiiiii
_Type_GetProperty_m2186896821
_FrameworkClrBase_GetProperty_m127743816

ftCall_iiiii
invoke_iiiii
_UnityAssetsScriptLoader_LoadResourcesWithReflection_m1513129289
_UnityAssetsScriptLoader__ctor_m2607121316
_PlatformAutoDetector_GetDefaultScriptLoader_m4271947063
_Script__cctor_m248437805
mftCall_vii
__Z30RuntimeInvoker_Void_t208002575PFvvEPK10MethodInfoPvPS4_ [RuntimeInvoker_Void_t208002575(void (*)(), MethodInfo const*, void*, void**)]

ftCall_iiiii
invoke_iiiii
__ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException [il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)]
__ZN6il2cpp2vm7Runtime9ClassInitEP11Il2CppClass [il2cpp::vm::Runtime::ClassInit(Il2CppClass*)]
_Test_MoonSharpTest_m638106588
_Test_Start_m1672059298
mftCall_vii
__Z30RuntimeInvoker_Void_t208002575PFvvEPK10MethodInfoPvPS4_ [RuntimeInvoker_Void_t208002575(void (*)(), MethodInfo const*, void*, void**)]

ftCall_iiiii
invoke_iiiii
__ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException [il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)]
_il2cpp_runtime_invoke

_il2cpp_runtime_invoke (WebGL.asm.framework.unityweb:11525:47)
__Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb (WebGL.asm.code.unityweb:2647480:30)
__ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb (WebGL.asm.code.unityweb:1887963:121)
__ZN13MonoBehaviour30InvokeMethodOrCoroutineCheckedE18ScriptingMethodPtr18ScriptingObjectPtrP21ScriptingExceptionPtr (WebGL.asm.code.unityweb:619456:67)
__ZN13MonoBehaviour30InvokeMethodOrCoroutineCheckedE18ScriptingMethodPtr18ScriptingObjectPtr (WebGL.asm.code.unityweb:1801858:123)
__ZN13MonoBehaviour16DelayedStartCallEP6ObjectPv (WebGL.asm.code.unityweb:2271629:94)
mftCall_iii (WebGL.asm.code.unityweb:2796022:98)
__ZN18DelayedCallManager6UpdateEi (WebGL.asm.code.unityweb:1106497:44)
mftCall_vii (WebGL.asm.code.unityweb:2798095:37)
__ZZ23InitPlayerLoopCallbacksvEN50EarlyUpdateScriptRunDelayedStartupFrameRegistrator7ForwardEv (WebGL.asm.code.unityweb:2689563:13)
mftCall_v (WebGL.asm.code.unityweb:2833458:35)
__Z10PlayerLoopv (WebGL.asm.code.unityweb:811467:23)
__ZL8MainLoopv (WebGL.asm.code.unityweb:2103087:19)
blob:http://localhost:64096/278ca9de-2d78-44ee-8b5e-af0a1d326299:203999:34
ftCall_v (WebGL.asm.framework.unityweb:29725:28)
browserIterationFunc (WebGL.asm.framework.unityweb:2951:23)
runIter (WebGL.asm.framework.unityweb:3054:9)

In console I see error

Invalid function pointer called with signature 'iiiiiiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)

It's stop crashing if I set "Enable Exception" to "Full" in publishing setting (http://d.pr/i/Tmshs), but this is not acceptable for release.

@ancientc
Copy link

ancientc commented Dec 1, 2017

It crashes for me too in WebGL with Unity 2017.2.
Would be so great to have a working example.

@ancientc
Copy link

ancientc commented Dec 1, 2017

After eight hours of crashes and javascript error debug I ask for help.
I hereby offer 30 USD (paypal) to anyone who delivers me a project that compiles a working Moonsharp WebGL build on Unity 2017.2. ( Basic script running should work, at least 80% of Moonsharp functionality should work.)
Deadline 3.Dec 2017

@SlimeQ
Copy link

SlimeQ commented Jun 6, 2018

I too am having this issue. Tried both the Unity store plugin and the generic dll with link.xml. No dice.

Here's my stack trace:

An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
uncaught exception: abort(174) at jsStackTrace (WebGL.asm.framework.unityweb:2:27491)
stackTrace (WebGL.asm.framework.unityweb:2:27662)
abort (WebGL.asm.framework.unityweb:4:37710)
B_x (WebGL.asm.code.unityweb:32:1)
d0m (WebGL.asm.code.unityweb:19:1)
dTp (WebGL.asm.code.unityweb:9:1)
LOx (WebGL.asm.code.unityweb:32:1)
invoke_iiiii (WebGL.asm.framework.unityweb:2:343721)
Gwl (WebGL.asm.code.unityweb:17:1)
Fwl (WebGL.asm.code.unityweb:17:1)
Uzl (WebGL.asm.code.unityweb:17:1)
QAl (WebGL.asm.code.unityweb:17:1)
quf (WebGL.asm.code.unityweb:29:1)
LOx (WebGL.asm.code.unityweb:32:1)
invoke_iiiii (WebGL.asm.framework.unityweb:2:343721)
kNw (WebGL.asm.code.unityweb:30:1)
zNw (WebGL.asm.code.unityweb:30:1)
Dzx (WebGL.asm.code.unityweb:30:1)
FIt (WebGL.asm.code.unityweb:8:1)
EIt (WebGL.asm.code.unityweb:8:1)
GIt (WebGL.asm.code.unityweb:8:1)
hzx (WebGL.asm.code.unityweb:30:1)
BDx (WebGL.asm.code.unityweb:30:1)
wDx (WebGL.asm.code.unityweb:30:1)
AGx (WebGL.asm.code.unityweb:32:1)
Sth (WebGL.asm.code.unityweb:4:1)
hLt (WebGL.asm.code.unityweb:7:1)
fLt (WebGL.asm.code.unityweb:7:1)
cLt (WebGL.asm.code.unityweb:7:1)
bLt (WebGL.asm.code.unityweb:7:1)
_Kt (WebGL.asm.code.unityweb:7:1)
ZKt (WebGL.asm.code.unityweb:7:1)
quf (WebGL.asm.code.unityweb:29:1)
LOx (WebGL.asm.code.unityweb:32:1)
invoke_iiiii (WebGL.asm.framework.unityweb:2:343721)
kNw (WebGL.asm.code.unityweb:30:1)
lZw (WebGL.asm.code.unityweb:30:1)
QT (WebGL.asm.code.unityweb:15:1)
PT (WebGL.asm.code.unityweb:15:1)
dIc (WebGL.asm.code.unityweb:11:1)
hIc (WebGL.asm.code.unityweb:11:1)
nsb (WebGL.asm.code.unityweb:23:1)
NHc (WebGL.asm.code.unityweb:11:1)
RHc (WebGL.asm.code.unityweb:11:1)
LHc (WebGL.asm.code.unityweb:11:1)
KHc (WebGL.asm.code.unityweb:11:1)
GHc (WebGL.asm.code.unityweb:11:1)
Pub (WebGL.asm.code.unityweb:21:1)
Pub (WebGL.asm.code.unityweb:21:1)
Iub (WebGL.asm.code.unityweb:21:1)
wub (WebGL.asm.code.unityweb:23:1)
cPx (WebGL.asm.code.unityweb:32:1)
browserIterationFunc (WebGL.asm.framework.unityweb:2:50424)
runIter (WebGL.asm.framework.unityweb:2:53516)
Browser_mainLoop_runner (WebGL.asm.framework.unityweb:2:51961)

If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.```

@SlimeQ
Copy link

SlimeQ commented Jun 6, 2018

@ancientc @greymag

This PR fixes the problem for me, not sure why it was never merged #146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants