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

Crash on using Construct game tiles -> check-tele when the tile layer is not in a game group #9405

Closed
ASKLL-STAR opened this issue Dec 19, 2024 · 2 comments · Fixed by #9499
Labels
bug An unintended feature or error in the code. editor Related to the map editor.

Comments

@ASKLL-STAR
Copy link
Contributor

Steps to reproduce:
1.Add a new group
2.Right click the group -> Add tile layer
3.Use the brush to paint it.(according ur wishes)
4.Right click the tile layer -> Game tile -> check-tele
5.Crash! ;)

Reproduce video:
https://github.com/user-attachments/assets/a09a879c-a8a8-41c9-8649-8a8becf775f9

Since 18.0.3.Maybe caused by Undo/redo feat

@ASKLL-STAR
Copy link
Contributor Author

ASKLL-STAR commented Dec 19, 2024

397451003-a09a879c-a8a8-41c9-8649-8a8becf775f9.mp4

Why can't this video be rendered directly?I have to resend it.

It's better now :D

@Robyt3 Robyt3 added bug An unintended feature or error in the code. editor Related to the map editor. labels Dec 20, 2024
@Robyt3
Copy link
Member

Robyt3 commented Dec 20, 2024

Also crashes on 18.8.2 and current master (168391f). Crashes in particular when no tele layer exists. If you add a tele layer before it does not crash.

DDNet.exe caused an Access Violation at location 00007FF6AA72C293 in module DDNet.exe Reading from location FFFFFFFFFFFFFFFF.

AddrPC           Params
00007FF6AA72C293 90000A0029B0D959 00007FFB1B11B3C7 000001E406800000  DDNet.exe!std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy+0x63  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/ext/atomicity.h @ 71]
    69:   __attribute__((__always_inline__))
    70:   __atomic_add(volatile _Atomic_word* __mem, int __val)
>   71:   { __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
    72: #else
    73:   _Atomic_word
00007FF6AA72B64B 000001E420F01CA0 000001E4090E6F28 0000000000000000  DDNet.exe!std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=+0x3b  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/shared_ptr_base.h @ 1086]
  1084:   {
  1085:     if (__tmp != nullptr)
> 1086:       __tmp->_M_add_ref_copy();
  1087:     if (_M_pi != nullptr)
  1088:       _M_pi->_M_release();
00007FF6AA9D7426 000001E420F01C98 000001E4090E6F20 000000935A30E3D0  DDNet.exe!std::__shared_ptr<CLayer, (__gnu_cxx::_Lock_policy)2>::operator=+0x36  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/shared_ptr_base.h @ 1524]
  1522: 
  1523:       __shared_ptr(const __shared_ptr&) noexcept = default;
> 1524:       __shared_ptr& operator=(const __shared_ptr&) noexcept = default;
  1525:       ~__shared_ptr() = default;
  1526: 
00007FF6AA9D7450 000001E420F01C98 000001E4090E6F20 0000000000000032  DDNet.exe!std::shared_ptr<CLayer>::operator=+0x20  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/shared_ptr.h @ 413]
   411:       constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
   412: 
>  413:       shared_ptr& operator=(const shared_ptr&) noexcept = default;
   414: 
   415:       template<typename _Yp>
00007FF6AAA46E94 000001E420F01B80 000001E408851770 0000000000000002  DDNet.exe!CEditorActionLayerBase::CEditorActionLayerBase+0xa8  [ddnet/src/game/editor/editor_actions.cpp @ 527]
   525: IEditorAction(pEditor), m_GroupIndex(GroupIndex), m_LayerIndex(LayerIndex)
   526: {
>  527: m_pLayer = pEditor->m_Map.m_vpGroups[GroupIndex]->m_vpLayers[LayerIndex];
   528: }
   529: 
00007FF6AAA46EDA 000001E420F01B80 000001E408851770 0000009300000002  DDNet.exe!CEditorActionAddLayer::CEditorActionAddLayer+0x3e  [ddnet/src/game/editor/editor_actions.cpp @ 533]
   531: 
   532: CEditorActionAddLayer::CEditorActionAddLayer(CEditor *pEditor, int GroupIndex, int LayerIndex, bool Duplicate) :
>  533: CEditorActionLayerBase(pEditor, GroupIndex, LayerIndex), m_Duplicate(Duplicate)
   534: {
   535: str_format(m_aDisplayText, sizeof(m_aDisplayText), "%s %s layer in group %d", m_Duplicate ? "Duplicate" : "New", m_pLayer->TypeName(), m_GroupIndex);
00007FF6AAAFB068 000001E420F01B80 000001E4091167A8 000001E4088553C8  DDNet.exe!std::_Construct<CEditorActionAddLayer, CEditor*&, int&, unsigned long long>+0x78  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/stl_construct.h @ 119]
   117: }
   118: #endif
>  119:       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
   120:     }
   121: #else
00007FF6AAAF9FDD 000001E420F01B70 000001E4091167A8 000001E4088553C8  DDNet.exe!std::_Sp_counted_ptr_inplace<CEditorActionAddLayer, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<CEditor*&, int&, unsigned long long>+0xcd  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/alloc_traits.h @ 657]
   655: construct(allocator_type&, _Up* __p, _Args&&... __args)
   656: noexcept(std::is_nothrow_constructible<_Up, _Args...>::value)
>  657: { std::_Construct(__p, std::forward<_Args>(__args)...); }
   658: 
   659:       /**
00007FF6AAAF8A4B 000001E4091167A8 00007FF6AA7290D9 000000935A30E697  DDNet.exe!std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<CEditorActionAddLayer, std::allocator<void>, CEditor*&, int&, unsigned long long>+0xcb  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/shared_ptr_base.h @ 969]
   967:   auto __guard = std::__allocate_guarded(__a2);
   968:   _Sp_cp_type* __mem = __guard.get();
>  969:   auto __pi = ::new (__mem)
   970:     _Sp_cp_type(__a._M_a, std::forward<_Args>(__args)...);
   971:   __guard = nullptr;
00007FF6AAAF6F10 000000935A30E800 000000935A30E697 000001E4091167A8  DDNet.exe!std::__shared_ptr<CEditorActionAddLayer, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<void>, CEditor*&, int&, unsigned long long>+0x80  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/shared_ptr_base.h @ 1713]
  1711:       template<typename _Alloc, typename... _Args>
  1712: __shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
> 1713: : _M_ptr(), _M_refcount(_M_ptr, __tag, std::forward<_Args>(__args)...)
  1714: { _M_enable_shared_from_this_with(_M_ptr); }
  1715: 
00007FF6AAAF55C8 000000935A30E800 000000935A30E697 000001E4091167A8  DDNet.exe!std::shared_ptr<CEditorActionAddLayer>::shared_ptr<std::allocator<void>, CEditor*&, int&, unsigned long long>+0x68  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/shared_ptr.h @ 463]
   461:       template<typename _Alloc, typename... _Args>
   462: shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
>  463: : __shared_ptr<_Tp>(__tag, std::forward<_Args>(__args)...)
   464: { }
   465: 
00007FF6AAAF3E7A 000001E421574AF8 000000935A30E830 000000935A30E7B0  DDNet.exe!std::make_shared<CEditorActionAddLayer, CEditor*&, int&, unsigned long long>+0x7a  [D:/Standalone-Software/msys64/mingw64/include/c++/14.2.0/bits/shared_ptr.h @ 1008]
  1006:       _Alloc __a;
  1007:       return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{__a},
> 1008:      std::forward<_Args>(__args)...);
  1009:     }
  1010: 
00007FF6AAAEEE1B 000001E408851770 00007FF600000009 000000935A30EBD0  DDNet.exe!CLayerTiles::FillGameTiles+0x9a5  [ddnet/src/game/editor/mapitems/layer_tiles.cpp @ 802]
   800: m_pEditor->m_Map.m_pGameGroup->AddLayer(pLayer);
   801: 
>  802: vpActions.push_back(std::make_shared<CEditorActionAddLayer>(m_pEditor, m_pEditor->m_SelectedGroup, m_pEditor->m_Map.m_pGameGroup->m_vpLayers.size() - 1));
   803: 
   804: if(m_Width != pGLayer->m_Width || m_Height > pGLayer->m_Height)
00007FF6AAAEFD89 000000935A30EC20 000001E4FFFFFFFF 0000009300000000  DDNet.exe!CLayerTiles::RenderProperties+0x137  [ddnet/src/game/editor/mapitems/layer_tiles.cpp @ 918]
   916: m_pEditor->PopupSelectGametileOpInvoke(m_pEditor->Ui()->MouseX(), m_pEditor->Ui()->MouseY());
   917: const int Selected = m_pEditor->PopupSelectGameTileOpResult();
>  918: FillGameTiles((EGameTileOp)Selected);
   919: }
   920: 
00007FF6AAB11357 000000935A30ED70 00007FF640800000 0000009300000001  DDNet.exe!CEditor::PopupLayer+0xa19  [ddnet/src/game/editor/popups.cpp @ 793]
   791: s_Tracker.End(Prop, State);
   792: 
>  793: return pCurrentLayer->RenderProperties(&View);
   794: }
   795: 
00007FF6AA97E859 000001E408851770 000000935A30EED0 000000935A30EEB0  DDNet.exe!CUi::RenderPopupMenus+0x245  [ddnet/src/game/client/ui.cpp @ 1619]
  1617: // The popup render function can open/close popups, which may resize the vector and thus
  1618: // invalidate the variable PopupMenu. We therefore store pId in a separate variable.
> 1619: EPopupMenuFunctionResult Result = PopupMenu.m_pfnFunc(PopupMenu.m_pContext, PopupRect, Active);
  1620: if(Result != POPUP_KEEP_OPEN || (Active && ConsumeHotkey(HOTKEY_ESCAPE)))
  1621: ClosePopupMenu(pId, Result == POPUP_CLOSE_CURRENT_AND_DESCENDANTS);
00007FF6AA9C3DEF 000001E408851770 4404EE35C44BAD85 000000935A30EF80  DDNet.exe!CEditor::Render+0x1823  [ddnet/src/game/editor/editor.cpp @ 8182]
  8180: }
  8181: 
> 8182: Ui()->RenderPopupMenus();
  8183: FreeDynamicPopupMenus();
  8184: 
00007FF6AA9C72FE 000001E4086191F8 00000093442AD5C6 000000933F800000  DDNet.exe!CEditor::OnRender+0x17c  [ddnet/src/game/editor/editor.cpp @ 8808]
  8806: Ui()->Update(m_MouseWorldPos);
  8807: 
> 8808: Render();
  8809: 
  8810: m_MouseDeltaWorld = vec2(0.0f, 0.0f);
00007FF6AA7173C5 000000935A30F604 000000935A30F600 0000000000000004  DDNet.exe!CClient::Run+0x1107  [ddnet/src/engine/client/client.cpp @ 3251]
  3249: else
  3250: {
> 3251: m_pEditor->OnRender();
  3252: DebugRender();
  3253: }
00007FF6AA71FC5D 0000000000000001 0000000000000032 00007FF6AAF988C8  DDNet.exe!main+0x103a  [ddnet/src/engine/client/client.cpp @ 4886]
  4884: // run the client
  4885: log_trace("client", "initialization finished after %.2fms, starting...", (time_get() - MainStart) * 1000.0f / (float)time_freq());
> 4886: pClient->Run();
  4887: 
  4888: const bool Restarting = pClient->State() == CClient::STATE_RESTARTING;
00007FF6AA6612E9 0000000000000000 0000000000000000 0000000000000000  DDNet.exe!__tmainCRTStartup+0x169  [C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c @ 259]
00007FF6AA6613D6 0000000000000000 0000000000000000 0000000000000000  DDNet.exe!WinMainCRTStartup+0x16  [C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c @ 149]
00007FFB19C67374 0000000000000000 0000000000000000 0000000000000000  KERNEL32.DLL!BaseThreadInitThunk+0x14
00007FFB1B13CC91 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!RtlUserThreadStart+0x21

@ASKLL-STAR ASKLL-STAR changed the title Using Construct game tiles -> check-tele when the tile layer is not in a game group will cause the game to crash. Crash on using Construct game tiles -> check-tele when the tile layer is not in a game group Dec 21, 2024
@def- def- closed this as completed in #9499 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unintended feature or error in the code. editor Related to the map editor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants