Wrong GC



  • Hi, wenn ich mein Programm beende, krieg ich folgende Fehlermeldung
    [Thread debugging using libthread_db enabled]
    [New Thread 0x7ff4c79997e0 (LWP 11285)]
    ./src/gtk/dcclient.cpp(248): assert "wxAssertFailure" failed in wxFreePoolGC(): Wrong GC

    Program received signal SIGTRAP, Trace/breakpoint trap.
    [Switching to Thread 0x7ff4c79997e0 (LWP 11285)]
    0x00007ff4c432169b in raise () from /lib/libpthread.so.0

    backtrace:
    #0 0x00007ff4c432169b in raise () from /lib/libpthread.so.0
    #1 0x00000000005dd48e in wxTrap () at ./src/common/appbase.cpp:672
    #2 0x00000000005dd4cf in DoShowAssertDialog (msg=@0x7fffcfb96ac0) at ./src/common/appbase.cpp:769
    #3 0x00000000005dd63f in ShowAssertDialog (szFile=0x6afbc0, nLine=248, szFunc=0x126b188, szCond=0x6afcc0, szMsg=0x6afdb0, traits=0x0) at ./src/common/appbase.cpp:844
    #4 0x00000000005dd6fc in wxOnAssert (szFile=0x6afbc0, nLine=248, szFunc=0x6b0a80 "wxFreePoolGC", szCond=0x6afcc0, szMsg=0x6afdb0) at ./src/common/appbase.cpp:707
    #5 0x0000000000494da2 in wxFreePoolGC (gc=0xdf5f30) at ./src/gtk/dcclient.cpp:248
    #6 0x0000000000494dd0 in wxWindowDC::Destroy (this=0xdebd00) at ./src/gtk/dcclient.cpp:2362
    #7 0x000000000049b3da in ~wxWindowDC (this=0xdebd00) at ./src/gtk/dcclient.cpp:340
    #8 0x00000000004a08ef in ~wxMemoryDC (this=0xdebd00) at ./src/gtk/dcmemory.cpp:47
    #9 0x000000000043f9ab in boost::checked_delete<wxMemoryDC> (x=0xdebd00) at /usr/include/boost/checked_delete.hpp:34
    #10 0x000000000044013d in boost::detail::sp_counted_impl_p<wxMemoryDC>::dispose (this=0xe03ab0) at /usr/include/boost/detail/sp_counted_impl.hpp:79
    #11 0x0000000000421fe2 in boost::detail::sp_counted_base::release (this=0xe03ab0) at /usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:145
    #12 0x0000000000422012 in ~shared_count (this=0xd1bba8) at /usr/include/boost/detail/shared_count.hpp:205
    #13 0x000000000043f335 in ~shared_ptr (this=0xd1bba0) at /usr/include/boost/shared_ptr.hpp:131
    #14 0x000000000043fc1b in std::_Destroy<boost::shared_ptr<wxMemoryDC> > (__pointer=0xd1bba0) at /usr/include/c++/4.2/bits/stl_construct.h:107
    #15 0x000000000043fc39 in std::__destroy_aux<boost::shared_ptr<wxMemoryDC>> (__first=0xd1bba0, __last=0xd1bbd0) at /usr/include/c++/4.2/bits/stl_construct.h:122
    #16 0x000000000043fc6e in std::_Destroy<boost::shared_ptr<wxMemoryDC>
    > (__first=0xd1bba0, __last=0xd1bbd0) at /usr/include/c++/4.2/bits/stl_construct.h:155
    #17 0x000000000043fc91 in std::_Destroy<boost::shared_ptr<wxMemoryDC>*, boost::shared_ptr<wxMemoryDC> > (__first=0xd1bba0, __last=0xd1bbd0) at /usr/include/c++/4.2/bits/stl_construct.h:182
    #18 0x0000000000440432 in ~vector (this=0xb24610) at /usr/include/c++/4.2/bits/stl_vector.h:268
    #19 0x00000000004732a8 in ~ImageList (this=0xb24520) at Resources/ImageList.h:39
    #20 0x0000000000473536 in boost::checked_delete<ImageList> (x=0xb24520) at /usr/include/boost/checked_delete.hpp:34
    #21 0x0000000000473621 in boost::detail::sp_counted_impl_p<ImageList>::dispose (this=0xb21ce0) at /usr/include/boost/detail/sp_counted_impl.hpp:79
    #22 0x0000000000421fe2 in boost::detail::sp_counted_base::release (this=0xb21ce0) at /usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:145
    #23 0x0000000000422012 in ~shared_count (this=0xa66da8) at /usr/include/boost/detail/shared_count.hpp:205
    #24 0x000000000042202d in ~shared_ptr (this=0xa66da0) at /usr/include/boost/shared_ptr.hpp:131
    #25 0x00000000004687fe in __tcf_0 () at Resources/ImageList.cpp:12
    #26 0x00007ff4c3fe6110 in exit () from /lib/libc.so.6
    #27 0x00007ff4c3fcf1cb in __libc_start_main () from /lib/libc.so.6
    #28 0x00000000004213d9 in _start ()

    Ich benutze wxGTK

    was bedeuted dieser Fehler?(Außer dass wxWidgets irgendwelche Probleme mit dem Garbagecollector hat, der Debugger läuft durch meinen Code problemlos durch)


  • Mod

    Keine Ahnung, was machst du denn das mit boost smartpointern und nem MemoryDC?
    Bzw. wo ist der Source wo der Fehler auftritt?



  • Das ist ja das Problem, laut Debugger tritt der Fehler beim beenden auf und zwar nach all meinem Code.
    Und die Smartpointer verwende ich überall im Code, aber nirgens mit einem Objekt wxWidgets.



  • JustAnotherNoob schrieb:

    Das ist ja das Problem, laut Debugger tritt der Fehler beim beenden auf und zwar nach all meinem Code.

    .< ach. was du nicht sagst. ist irgendwie logisch, wenn verbuggte destruktoren aufgerufen werden und versucht wird fehlerhafte speicherbereiche freizugeben, dass es dann am ende abstürzt 🙄
    der fehler liegt trotzdem in deinem code, auch wenn er erst beim beenden abstürzt. und ohne den wird dir hier keiner weiterhelfen können.


  • Mod

    JustAnotherNoob schrieb:

    Das ist ja das Problem, laut Debugger tritt der Fehler beim beenden auf und zwar nach all meinem Code.
    Und die Smartpointer verwende ich überall im Code, aber nirgens mit einem Objekt wxWidgets.

    Trotzdem muss es ja irgendwie an dem smartpointer und dem Memorydc liegen, wo also tust du die 2 zusammenbringen?
    Es kann durchaussein, das wxWidgets dort das schon freigibt, bevor der Smartpointer sich darum bemüht.


Anmelden zum Antworten