<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[Solved] Destruktor von std::shared_ptr führt zu SIGSEGV]]></title><description><![CDATA[<p>Guten Morgen,</p>
<p>ich habe das Problem, dass ich, wie der Titel bereits verrät, einen SIGSEGV erhalte, wenn der Destruktor eines bestimmten <code>std::shared_ptr</code> ausgeführt wird.</p>
<p>Zunächst einmal die Ausgabe von Valgrind:</p>
<blockquote>
<p>==6529== Process terminating with default action of signal 11 (SIGSEGV)<br />
==6529== Bad permissions for mapped region at address 0x3034C03660<br />
==6529== at 0x3034C03660: ???<br />
==6529== by 0x4056D1: std::_Sp_counted_ptr&lt;fabula::MusicTrack*, (__gnu_cxx::_Lock_policy)2&gt;::_M_dispose() (shared_ptr_base.h:147)<br />
==6529== by 0x405BB8: std::_Sp_counted_base&lt;(__gnu_cxx::_Lock_policy)2&gt;::_M_release() (shared_ptr_base.h:147)<br />
==6529== by 0x4C34820: std::__shared_count&lt;(__gnu_cxx::_Lock_policy)2&gt;::~__shared_count() (in /usr/local/lib/libFabula.so)<br />
==6529== by 0x4C3ED4D: std::__shared_ptr&lt;fabula::MusicTrack, (__gnu_cxx::_Lock_policy)2&gt;::~__shared_ptr() (in /usr/local/lib/libFabula.so)<br />
==6529== by 0x4C3ED67: std::shared_ptr<a href="fabula::MusicTrack" rel="nofollow">fabula::MusicTrack</a>::~shared_ptr() (in /usr/local/lib/libFabula.so)<br />
==6529== by 0x4C3ED97: fabula::Music::~Music() (in /usr/local/lib/libFabula.so)<br />
==6529== by 0x318B038BB0: __run_exit_handlers (in /usr/lib64/libc-2.15.so)<br />
==6529== by 0x318B038C34: exit (in /usr/lib64/libc-2.15.so)<br />
==6529== by 0x318B02173B: (below main) (in /usr/lib64/libc-2.15.so)</p>
</blockquote>
<p><code>fabula::MusicTrack</code> ist eine Klasse aus meiner cFabula-Lib, die Instanz des <code>std::shared_ptr&lt;fabula::MusicTrack&gt;</code> , die mir Probleme bereitet, ist Attribut der Singleton-Klasse <code>fabula::Music</code> .</p>
<p>Standardmäßig handelt es sich hierbei um einen <code>nullptr</code> , der ausdrücken soll, dass kein Track geladen ist. Der SIGSEGV tritt bei jedem Programmende auf, falls die Instanz erzeugt wurde.</p>
<p>Hat jemand Ideen, wo der Fehler liegen könnte?</p>
<p>Mit freundlichen Grüßen,</p>
<p>Ki</p>
<p>EDIT:<br />
Fehler gefunden</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/305241/solved-destruktor-von-std-shared_ptr-führt-zu-sigsegv</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Apr 2026 17:15:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/305241.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 24 Jun 2012 14:12:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Solved] Destruktor von std::shared_ptr führt zu SIGSEGV on Sun, 24 Jun 2012 22:35:13 GMT]]></title><description><![CDATA[<p>Guten Morgen,</p>
<p>ich habe das Problem, dass ich, wie der Titel bereits verrät, einen SIGSEGV erhalte, wenn der Destruktor eines bestimmten <code>std::shared_ptr</code> ausgeführt wird.</p>
<p>Zunächst einmal die Ausgabe von Valgrind:</p>
<blockquote>
<p>==6529== Process terminating with default action of signal 11 (SIGSEGV)<br />
==6529== Bad permissions for mapped region at address 0x3034C03660<br />
==6529== at 0x3034C03660: ???<br />
==6529== by 0x4056D1: std::_Sp_counted_ptr&lt;fabula::MusicTrack*, (__gnu_cxx::_Lock_policy)2&gt;::_M_dispose() (shared_ptr_base.h:147)<br />
==6529== by 0x405BB8: std::_Sp_counted_base&lt;(__gnu_cxx::_Lock_policy)2&gt;::_M_release() (shared_ptr_base.h:147)<br />
==6529== by 0x4C34820: std::__shared_count&lt;(__gnu_cxx::_Lock_policy)2&gt;::~__shared_count() (in /usr/local/lib/libFabula.so)<br />
==6529== by 0x4C3ED4D: std::__shared_ptr&lt;fabula::MusicTrack, (__gnu_cxx::_Lock_policy)2&gt;::~__shared_ptr() (in /usr/local/lib/libFabula.so)<br />
==6529== by 0x4C3ED67: std::shared_ptr<a href="fabula::MusicTrack" rel="nofollow">fabula::MusicTrack</a>::~shared_ptr() (in /usr/local/lib/libFabula.so)<br />
==6529== by 0x4C3ED97: fabula::Music::~Music() (in /usr/local/lib/libFabula.so)<br />
==6529== by 0x318B038BB0: __run_exit_handlers (in /usr/lib64/libc-2.15.so)<br />
==6529== by 0x318B038C34: exit (in /usr/lib64/libc-2.15.so)<br />
==6529== by 0x318B02173B: (below main) (in /usr/lib64/libc-2.15.so)</p>
</blockquote>
<p><code>fabula::MusicTrack</code> ist eine Klasse aus meiner cFabula-Lib, die Instanz des <code>std::shared_ptr&lt;fabula::MusicTrack&gt;</code> , die mir Probleme bereitet, ist Attribut der Singleton-Klasse <code>fabula::Music</code> .</p>
<p>Standardmäßig handelt es sich hierbei um einen <code>nullptr</code> , der ausdrücken soll, dass kein Track geladen ist. Der SIGSEGV tritt bei jedem Programmende auf, falls die Instanz erzeugt wurde.</p>
<p>Hat jemand Ideen, wo der Fehler liegen könnte?</p>
<p>Mit freundlichen Grüßen,</p>
<p>Ki</p>
<p>EDIT:<br />
Fehler gefunden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2226714</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2226714</guid><dc:creator><![CDATA[Ki]]></dc:creator><pubDate>Sun, 24 Jun 2012 22:35:13 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Destruktor von std::shared_ptr führt zu SIGSEGV on Sun, 24 Jun 2012 14:18:00 GMT]]></title><description><![CDATA[<blockquote>
<p>Hat jemand Ideen, wo der Fehler liegen könnte?</p>
</blockquote>
<p>In deinem Programm.</p>
<p>Für bessere Antworten: Minimalbeispiel erzeugen. Siehe dritter Link in meiner Signatur.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2226719</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2226719</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 24 Jun 2012 14:18:00 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Destruktor von std::shared_ptr führt zu SIGSEGV on Sun, 24 Jun 2012 14:33:08 GMT]]></title><description><![CDATA[<p>Im Programm liegt der Fehler nicht, so viel weiß ich, er liegt in der Lib und den Code, der dort relevant ist, umschrieb ich verbal. Aber wenn du es unbedingt noch einmal in Codeform haben willst, weil du den Text nicht rekonstruieren kannst, bitte sehr:</p>
<pre><code>class Music final
{
    // VARIABLES
    std::shared_ptr&lt;MusicState&gt; state_;
    std::shared_ptr&lt;MusicTrack&gt; track_; //XXX: Kopie statt Pointer? 

    // SINGLETON
    Music();
    ~Music(){};
    Music(const Music&amp;) = delete;
    Music&amp; operator=(const Music&amp;) = delete;
    Music(Music&amp;&amp;) = delete;
    Music&amp; operator=(Music&amp;&amp;) = delete;

    public:
        // Ausgabe der Instanz und diverse Methoden
};
</code></pre>
<pre><code>Music::Music()
    : state_(new MusicFree)
    , track_(nullptr)
{}
</code></pre>
<p>Anwendungsbeispiel:</p>
<pre><code>std::shared_ptr&lt;fabula::MusicTrack&gt; track
    (new fabula::MusicTrack(&quot;.music/theme.ogg&quot;));
fabula::Music::music().setTrack(track);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2226721</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2226721</guid><dc:creator><![CDATA[Ki]]></dc:creator><pubDate>Sun, 24 Jun 2012 14:33:08 GMT</pubDate></item></channel></rss>