<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Primitives addon shutdown code shutting down d3d?</title>
		<link>http://www.allegro.cc/forums/view/615421</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 02 Jun 2015 08:02:17 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m not sure what I&#39;m doing wrong. It&#39;s probably my fault but my program is crashing in <span class="source-code"><a href="http://www.allegro.cc/manual/al_shutdown_primitives_addon"><span class="a">al_shutdown_primitives_addon</span></a></span>, called from al_uninstall_system, called from atexit.</p><p>I&#39;m using a very recent git build, with MinGW 4.8.1 and Vista.</p><p>Here&#39;s the backtrace :
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>Program received <a href="http://www.delorie.com/djgpp/doc/libc/libc_724.html" target="_blank">signal</a> SIGSEGV, Segmentation fault.
<span class="number">  2</span><span class="n">0x00402de0</span> in AssertHandler <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_299.html" target="_blank">exp</a><span class="k3">=</span><span class="n">0x678671b0</span> <span class="k3">&lt;</span>__func__.6213<span class="k3">+</span><span class="n">193</span><span class="k3">&gt;</span> <span class="s">"display"</span>, file<span class="k3">=</span><span class="n">0x678671b8</span> <span class="k3">&lt;</span>__func__.6213<span class="k3">+</span><span class="n">201</span><span class="k3">&gt;</span> <span class="s">"C:\\mingw\\LIBS\\A5GIT\\allegro\\src\\display.c"</span>, <a href="http://www.allegro.cc/manual/line"><span class="a">line</span></a><span class="k3">=</span><span class="n">310</span>, func<span class="k3">=</span><span class="n">0x678673fd</span> <span class="k3">&lt;</span>__func__.35368&gt; <span class="s">"al_get_display_flags"</span><span class="k2">)</span> at C:\Research\RawInput\InputTest\MouseTestMain.cpp:12
<span class="number">  3</span><span class="n">12</span>         <span class="k3">*</span>i <span class="k3">=</span> <span class="n">1</span><span class="k2">;</span>
<span class="number">  4</span><span class="k2">(</span>gdb<span class="k2">)</span> bt
<span class="number">  5</span><span class="p">#0  0x00402de0 in AssertHandler (exp=0x678671b0 &lt;__func__.6213+193&gt; "display", file=0x678671b8 &lt;__func__.6213+201&gt; "C:\\mingw\\LIBS\\A5GIT\\allegro\\src\\display.c", line=310, func=0x678673fd &lt;__func__.35368&gt; "al_get_display_flags") at C:\Research\RawInput\InputTest\MouseTestMain.cpp:12</span>
<span class="number">  6</span><span class="p">#1  0x6771fa04 in al_get_display_flags (display=0x0) at C:\mingw\LIBS\A5GIT\allegro\src\display.c:310</span>
<span class="number">  7</span><span class="p">#2  0x67801c30 in al_destroy_index_buffer (buffer=0x2812be8) at C:\mingw\LIBS\A5GIT\allegro\addons\primitives\primitives.c:327</span>
<span class="number">  8</span><span class="p">#3  0x677f9c6e in destroy_display_local_data () at C:\mingw\LIBS\A5GIT\allegro\addons\primitives\prim_directx.cpp:197</span>
<span class="number">  9</span><span class="p">#4  0x677f9d22 in _al_shutdown_d3d_driver () at C:\mingw\LIBS\A5GIT\allegro\addons\primitives\prim_directx.cpp:222</span>
<span class="number"> 10</span><span class="p">#5  0x67800e47 in al_shutdown_primitives_addon () at C:\mingw\LIBS\A5GIT\allegro\addons\primitives\primitives.c:62</span>
<span class="number"> 11</span><span class="p">#6  0x677260ab in _al_run_exit_funcs () at C:\mingw\LIBS\A5GIT\allegro\src\exitfunc.c:92</span>
<span class="number"> 12</span><span class="p">#7  0x67732ef3 in al_uninstall_system () at C:\mingw\LIBS\A5GIT\allegro\src\system.c:314</span>
<span class="number"> 13</span><span class="p">#8  0x76201fef in msvcrt!_flushall () from C:\Windows\system32\msvcrt.dll</span>
<span class="number"> 14</span><span class="p">#9  0x85fd4fee in ?? ()</span>
<span class="number"> 15</span><span class="p">#10 0x0022fea4 in ?? ()</span>
<span class="number"> 16</span><span class="p">#11 0x76202177 in msvcrt!_cexit () from C:\Windows\system32\msvcrt.dll</span>
<span class="number"> 17</span><span class="p">#12 0x00000000 in ?? ()</span>
<span class="number"> 18</span><span class="k2">(</span>gdb<span class="k2">)</span> quit
</div></div><p>

For some reason the display is null at the point when al_get_display_flags is called.</p><p>However, this begs the question, why is the primitives shutdown code shutting down d3d?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 01 Jun 2015 23:34:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/615421/1013717#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> However, this begs the question, why is the primitives shutdown code shutting down d3d? </p></div></div><p>It&#39;s not, it&#39;s just shutting down the D3D driver of the primitives addon. Is this something easily reproducible?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Tue, 02 Jun 2015 06:09:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>No, I can&#39;t reproduce it anymore.</p><p>Now my program is crashing somewhere else, but only in release mode. If I link to the debugging allegro monolith it doesn&#39;t crash.</p><p>I can give you the backtrace, but there are no line numbers. However, it crashes while trying to create an opengl display.</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>Program received <a href="http://www.delorie.com/djgpp/doc/libc/libc_724.html" target="_blank">signal</a> SIGSEGV, Segmentation fault.
<span class="number">  2</span><span class="k2">[</span>Switching to Thread <span class="n">5868</span>.<span class="n">0x100c</span><span class="k2">]</span>
<span class="number">  3</span><span class="n">0x6f15611e</span> in _al_ogl_manage_extensions <span class="k2">(</span><span class="k2">)</span> from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll
<span class="number">  4</span><span class="k2">(</span>gdb<span class="k2">)</span> bt
<span class="number">  5</span><span class="p">#0  0x6f15611e in _al_ogl_manage_extensions () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number">  6</span><span class="p">#1  0x6f15dd68 in create_display_internals () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number">  7</span><span class="p">#2  0x6f15e5a2 in wgl_create_display () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number">  8</span><span class="p">#3  0x6f0e1e38 in al_create_display () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number">  9</span><span class="p">#4  0x0040215a in ?? ()</span>
<span class="number"> 10</span><span class="p">#5  0x0040234f in ?? ()</span>
<span class="number"> 11</span><span class="p">#6  0x00402810 in ?? ()</span>
<span class="number"> 12</span><span class="p">#7  0x00402a0f in ?? ()</span>
<span class="number"> 13</span><span class="p">#8  0x00403cca in ?? ()</span>
<span class="number"> 14</span><span class="p">#9  0x00403d2f in ?? ()</span>
<span class="number"> 15</span><span class="p">#10 0x6f136783 in window_callback@16 () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number"> 16</span><span class="p">#11 0x767ff8d2 in USER32!GetMessageW () from C:\Windows\system32\user32.dll</span>
<span class="number"> 17</span><span class="p">#12 0x767ff794 in USER32!GetWindowLongW () from C:\Windows\system32\user32.dll</span>
<span class="number"> 18</span><span class="p">#13 0x6f136670 in postpone_thread_proc () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number"> 19</span><span class="p">#14 0x76800008 in USER32!PeekMessageW () from C:\Windows\system32\user32.dll</span>
<span class="number"> 20</span><span class="p">#15 0x76800060 in USER32!DispatchMessageW () from C:\Windows\system32\user32.dll</span>
<span class="number"> 21</span><span class="p">#16 0x6f13ee29 in d3d_display_thread_proc(void*) () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number"> 22</span><span class="p">#17 0x6f0eef81 in detached_thread_func_trampoline () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number"> 23</span><span class="p">#18 0x6f138ef4 in thread_proc_trampoline@4 () from c:\Research\RawInput\InputTest\allegro_monolith-5.1.dll</span>
<span class="number"> 24</span><span class="p">#19 0x770a2cce in wcstombs_s () from C:\Windows\system32\msvcrt.dll</span>
<span class="number"> 25</span><span class="p">#20 0x770a2deb in msvcrt!_beginthreadex () from C:\Windows\system32\msvcrt.dll</span>
<span class="number"> 26</span><span class="p">#21 0x77554b29 in KERNEL32!BaseThreadInitThunk () from C:\Windows\system32\kernel32.dll</span>
<span class="number"> 27</span><span class="p">#22 0x773ce1c6 in ntdll!RtlInitializeExceptionChain () from C:\Windows\system32\ntdll.dll</span>
<span class="number"> 28</span><span class="p">#23 0x773ce199 in ntdll!RtlInitializeExceptionChain () from C:\Windows\system32\ntdll.dll</span>
<span class="number"> 29</span><span class="p">#24 0x00000000 in ?? ()</span>
<span class="number"> 30</span><span class="k2">(</span>gdb<span class="k2">)</span> quit
</div></div><p>

I should say, just out of chance, I have created both a main D3D display, and each mouse pointer opens an OpenGL display (which takes way longer, and now crashes for some reason).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 02 Jun 2015 07:53:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I suspect uninitialized variable/memory access.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 02 Jun 2015 08:02:17 +0000</pubDate>
	</item>
</rss>
