britzl / monarch

Monarch is a Defold screen manager with transition support and a straight forward API
MIT License
163 stars 23 forks source link

Implement monarch.replace() #61

Closed dapetcu21 closed 4 years ago

dapetcu21 commented 4 years ago

Implement being able to replace the top of the stack, as discussed on #60.

Closes #60

dapetcu21 commented 4 years ago

I was expecting to have messed up the tests, but I honestly wasn't expecting an engine crash:

INFO:CRASH: Successfully wrote Crashdump to file: /home/travis/.Defold/_crash
2782
2783./dmengine_headless(+0x259787) [0x562d7531c787]
2784/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7f23fbf41890]
2785./dmengine_headless(+0x1c78fb) [0x562d7528a8fb]
2786./dmengine_headless(+0x1a1b50) [0x562d75264b50]
2787./dmengine_headless(+0x1b0eec) [0x562d75273eec]
2788./dmengine_headless(+0x1b1645) [0x562d75274645]
2789./dmengine_headless(+0x19f837) [0x562d75262837]
2790./dmengine_headless(+0x54708) [0x562d75117708]
2791./dmengine_headless(+0x3f0c6) [0x562d751020c6]
2792./dmengine_headless(+0x320c6) [0x562d750f50c6]
2793./dmengine_headless(+0xa8ab6) [0x562d7516bab6]
2794./dmengine_headless(+0x34ed1) [0x562d750f7ed1]
2795./dmengine_headless(+0x34fb5) [0x562d750f7fb5]
2796./dmengine_headless(+0x30a2b) [0x562d750f3a2b]
2797/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f23fb01cb97]
2798./dmengine_headless(+0x3087a) [0x562d750f387a]
2799
2800./.travis/run.sh: line 41:  7129 Segmentation fault      (core dumped) ./dmengine_headless --config=bootstrap.main_collection=${DEFOLD_BOOSTRAP_COLLECTION}
2801The command "./.travis/run.sh" exited with 139.
dapetcu21 commented 4 years ago

I'll amend this commit and rebase the branch, maybe this kicks Travis to make a new build.

dapetcu21 commented 4 years ago

Yup. I could repro the crash in the editor.

britzl commented 4 years ago

Only when running headless?

dapetcu21 commented 4 years ago

Nope, even when running directly in the editor with the test bootstrap collection.

dapetcu21 commented 4 years ago

Meanwhile, let me rebase this.

britzl commented 4 years ago
# 0 pc   0x137a95fd MetadataUtilities _sigtramp+29
# 1 pc     0x1454a2 dmengine lua_settop+98
# 2 pc     0x116e3f dmengine _ZN8dmScript14InvokeCallbackEPNS_15LuaCallbackInfoEPFvP9lua_StatePvES4_+271
# 3 pc     0x124b0e dmengine _ZN8dmScriptL16LuaTimerCallbackEPNS_10TimerWorldENS_14TimerEventTypeEjfmm+78
# 4 pc     0x1239a6 dmengine _ZN8dmScript12UpdateTimersEPNS_10TimerWorldEf+294
# 5 pc     0x115def dmengine _ZN8dmScript17UpdateScriptWorldEPNS_11ScriptWorldEf+79
# 6 pc      0x152d7 dmengine _ZN12dmGameObject16CompScriptUpdateERKNS_22ComponentsUpdateParamsERNS_22ComponentsUpdateResultE+71
# 7 pc      0x1fa19 dmengine _ZN12dmGameObject6UpdateEPNS_16CollectionHandleEPKNS_13UpdateContextE+617
# 8 pc       0x52ca dmengine _ZN8dmEngine4StepEPNS_6EngineE+906
# 9 pc      0x71246 dmengine _ZN10dmGraphics18RunApplicationLoopEPvPFvS0_EPFiS0_E+38
#10 pc       0x6071 dmengine _ZN8dmEngine6LaunchEiPPcPFvPNS_6EngineEPvES6_S4_+177
#11 pc       0x649f dmengine _Z11engine_mainiPPc+143
codecov[bot] commented 4 years ago

Codecov Report

Merging #61 into master will decrease coverage by 0.11%. The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
- Coverage   83.29%   83.17%   -0.12%     
==========================================
  Files           4        4              
  Lines         838      850      +12     
==========================================
+ Hits          698      707       +9     
- Misses        140      143       +3     
Impacted Files Coverage Δ
monarch/monarch.lua 86.32% <75.00%> (-0.23%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c7fb2ba...4ddfde1. Read the comment docs.

dapetcu21 commented 4 years ago

Apparently the rebase fixed it. Here's the old crashing commit: https://github.com/dapetcu21/monarch/tree/replace-crashing

britzl commented 4 years ago

Very strange indeed. It no longer crashes for me either.