<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>more osx troubles</title>
		<link>http://www.allegro.cc/forums/view/586345</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 26 Jul 2006 02:14:41 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So I&#39;ve installed allegro for mac osx but I want x11 support.  The configure script keeps telling me I don&#39;t have the X11 developer libs installed because xcode put them in /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib as opposed to their normal home in /usr/X11R6/lib</p><p>Anyone know how to get this thing find the libraries?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mike Farrell)</author>
		<pubDate>Sat, 08 Jul 2006 04:50:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Would putting a symlink to the library in /usr/X11R6/lib work?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Number Six)</author>
		<pubDate>Sat, 08 Jul 2006 07:39:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So I symlinked /Developer/SDk-whatever/usr/X11R6 into /usr and that <i>sort</i> of worked.</p><p>I&#39;m using this darwin ports thing to compile a library now and I&#39;m getting this ridiculous error.</p><div class="source-code snippet"><div class="inner"><pre>Scott-Lozanoffs-Computer-4:~<span class="k3">/</span>Desktop<span class="k3">/</span>gtk_devel scottlozanoff$ sudo port install gtk2
<span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">&gt;</span>  Staging pango into destroot
Error: Target com.apple.destroot returned: shell command <span class="s">"env LANG=C DYLD_LIBRARY_PATH=/opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_x11_pango/work/destroot/opt/local/lib  /opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_x11_pango/work/destroot/opt/local/bin/pango-querymodules /opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_x11_pango/work/destroot/opt/local/lib/pango/1.5.0/modules/*.so &gt;/opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_x11_pango/work/destroot/opt/local/etc/pango/pango.modules"</span> returned error <span class="n">133</span>
Command output: dyld: Library <span class="k1">not</span> loaded: <span class="k3">/</span>usr<span class="k3">/</span>X11R6<span class="k3">/</span>lib<span class="k3">/</span>libX11.6.dylib
  Referenced from: <span class="k3">/</span>opt<span class="k3">/</span>local<span class="k3">/</span>var<span class="k3">/</span>db<span class="k3">/</span>dports<span class="k3">/</span>build<span class="k3">/</span>_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_x11_pango<span class="k3">/</span>work<span class="k3">/</span>destroot<span class="k3">/</span>opt<span class="k3">/</span>local<span class="k3">/</span>bin<span class="k3">/</span>pango-querymodules
  Reason: no suitable image found.  Did find:
        <span class="k3">/</span>usr<span class="k3">/</span>X11R6<span class="k3">/</span>lib<span class="k3">/</span>libX11.6.dylib: can<span class="s">'t map</span>
<span class="s"></span>
<span class="s">Error: The following dependencies failed to build: pango tiff jpeg</span>
</pre></div></div><p>

Anyone seen the likes of this before?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mike Farrell)</author>
		<pubDate>Tue, 11 Jul 2006 01:40:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>MIKE!!!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (superstar4410)</author>
		<pubDate>Tue, 11 Jul 2006 04:44:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Anyone seen the likes of this before?
</p></div></div><p>
No, but as I understand it the problem is that <i>libX11.6.dylib</i> can&#39;t be found. That isn&#39;t surprising, since both the 10.4 SDK that you&#39;re using and the 10.3 SDK call the file <i>libX11.6.2.dylib</i>. The 10.2 SDK doesn&#39;t seem to have any X11 at all and earlier SDKs are no longer available.</p><p>So, this looks like a ports issue. Perhaps it wants you to download and install a ports-friendly version of the X11 libraries? DarwinPorts, Fink, etc are all about pretending that the OS is a vanilla UNIX so it wouldn&#39;t be surprising if they&#39;re not very well integrated with the Apple stuff — especially as they&#39;re meant to work with plain Darwin and don&#39;t require full-OS X.</p><p>If you want to try a quick fix, perhaps try another symbolic link but I wouldn&#39;t be surprised if there are more problems ahead.</p><p>Out of curiousity, why do you want an X11 version of Allegro on OS X?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Harte)</author>
		<pubDate>Tue, 11 Jul 2006 23:16:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Because the allegro program keeps freezing when I click down on the mouse.  I thought maybe the x11 code would run better.  Also sometimes instead of freezing allegro programs will print &quot;bus error&quot; and quit.</p><p>Ah, I fixed the gtk2 install problem.  I removed the symlink of /usr/X11R6 to the one in /developer and now ports is installing its own xfree.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mike Farrell)</author>
		<pubDate>Tue, 18 Jul 2006 01:03:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Because the allegro program keeps freezing when I click down on the mouse.
</p></div></div><p>
Example code?</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I thought maybe the x11 code would run better.
</p></div></div><p>
Unlikely.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Also sometimes instead of freezing allegro programs will print &quot;bus error&quot; and quit.
</p></div></div><p>
Do all Allegro programs do this, or just some?<br />Also, is you Mac a PowerPC Mac or an Intel Mac?</p><p>Anyway, next time, please report problems like these before deciding to try the X11 version. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Tue, 18 Jul 2006 03:08:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry to be brief in the report, I&#39;ve been working on other projects concurrently with trying to port over the allegro programs (just got my gtk2+gtkglext program running on the mac yesterday).</p><p>All the allegro examples do this, some even fade out and switch into a full screen &quot;bogus&quot; video mode where the colors are all wrong (yellow and orange) and the keyboard + mouse doesn&#39;t respond.  At this point, my only way to get out short of unplugging the mac is to hit apple+option+esc.  In the windowed programs, I still get no response from the keyboard or mouse until the terminal finally prints &quot;bus error&quot; and the program quits.  I&#39;m using the following versions of allegro with the same problem in both:</p><p><a href="http://www.allegro.cc/files/4.2.0/allegro-4.2.0.tar.gz">http://www.allegro.cc/files/4.2.0/allegro-4.2.0.tar.gz</a><br /><a href="http://www.allegro.cc/files/svn/allegro-4.3-dev-2006-06-21.tar.bz2">http://www.allegro.cc/files/svn/allegro-4.3-dev-2006-06-21.tar.bz2</a></p><p>I build with &quot;fix.sh macosx &amp;&amp; make&quot;
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mike Farrell)</author>
		<pubDate>Fri, 21 Jul 2006 00:25:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t worry about 4.3 for the moment, but do check the SVN version of 4.2 if you can.<br />Also, please specify the type of Mac you have (Intel or PowerPC). I&#39;m not sure if vanilla 4.2 will compile on an Intel based Mac, but it almost certainly will not work correctly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Fri, 21 Jul 2006 00:29:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>sorry about that, I&#39;m on a powerpc
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mike Farrell)</author>
		<pubDate>Fri, 21 Jul 2006 00:43:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
All the allegro examples do this
</p></div></div><p>
That always happens if you start them from the Finder. If you open a terminal and start them from their home directory then they should work. It&#39;s a side effect of the course that the Allegro team have charted between pretending that OS X is a vanilla UNIX and dealing with it properly. I don&#39;t know exactly what is going on (perhaps the startup code that decides which directory to switch to can&#39;t cope if the binary isn&#39;t in an application bundle? Just a guess!) but crucially this is not a limitation that affects programs built in XCode or probably in other more verbose ways.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
sorry about that, I&#39;m on a powerpc
</p></div></div><p>
Me too, so if you don&#39;t want to share source I could at least give your binary a go on my machine. There were quite a few bugs uncovered in Allegro in the run up to 4.2.0, including some to do with mouse handling, so it may be worth investigating further.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Harte)</author>
		<pubDate>Fri, 21 Jul 2006 03:37:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was starting them from the terminal.  That problem was unique to the 4.3 svn branch though like you predicted.  The 4.2 svn works ok in the examples, but my &quot;proven&quot; working allegro programs for work still lock up when I click down on the mouse in some cases.  I can&#39;t seem to trace where the lockup is happening but I will work more on it today.  I&#39;d send you some binaries but they are way too complicated with dynamic dependancies to other libraries and whatnot.  I may try to write a simple allegro mouse program that reproduces the problem.</p><p>Later:</p><p>I got the test program that&#39;ll cause the freeze.  It doesn&#39;t always occur with this one, but always within the first 10 tries.  All I do is run it and drag the mouse around until it locks up.  If it doesn&#39;t lock up after awhile, I can make it happen by quitting and starting again.  It also might help to note that I&#39;m on a dual core cpu.</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>&#160;</td></tr><tr><td class="number">2</td><td><span class="p">#include &lt;allegro.h&gt;</span></td></tr><tr><td class="number">3</td><td>&#160;</td></tr><tr><td class="number">4</td><td><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span></td></tr><tr><td class="number">5</td><td><span class="k2">{</span></td></tr><tr><td class="number">6</td><td>  <span class="k1">int</span> mouse_down <span class="k3">=</span> FALSE, recording <span class="k3">=</span> FALSE, x, y<span class="k2">;</span></td></tr><tr><td class="number">7</td><td>  </td></tr><tr><td class="number">8</td><td>  <a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td>  <a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/desktop_color_depth" target="_blank"><span class="a">desktop_color_depth</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>  <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span>GFX_AUTODETECT_WINDOWED, <span class="n">640</span>, <span class="n">480</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span></td></tr><tr><td class="number">11</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">12</td><td>    <a href="http://www.allegro.cc/manual/allegro_message" target="_blank"><span class="a">allegro_message</span></a><span class="k2">(</span><span class="s">"Total malfunction in the system!"</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>  <span class="k1">return</span> <span class="n">1</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">15</td><td>&#160;</td></tr><tr><td class="number">16</td><td>  <a href="http://www.allegro.cc/manual/install_timer" target="_blank"><span class="a">install_timer</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">17</td><td>  <a href="http://www.allegro.cc/manual/install_mouse" target="_blank"><span class="a">install_mouse</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>  </td></tr><tr><td class="number">18</td><td>  <a href="http://www.allegro.cc/manual/install_keyboard" target="_blank"><span class="a">install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td>  </td></tr><tr><td class="number">20</td><td>  <a href="http://www.allegro.cc/manual/show_mouse" target="_blank"><span class="a">show_mouse</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">21</td><td>  <span class="k1">while</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span></td></tr><tr><td class="number">22</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">23</td><td>    <span class="c">//clear_bitmap(screen);</span></td></tr><tr><td class="number">24</td><td>  </td></tr><tr><td class="number">25</td><td>  <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/mouse_b" target="_blank"><span class="a">mouse_b</span></a> <span class="k3">&amp;</span> <span class="n">1</span><span class="k2">)</span></td></tr><tr><td class="number">26</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">27</td><td>    <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span>mouse_down<span class="k2">)</span></td></tr><tr><td class="number">28</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">29</td><td>      mouse_down <span class="k3">=</span> TRUE<span class="k2">;</span></td></tr><tr><td class="number">30</td><td>    recording <span class="k3">=</span> TRUE<span class="k2">;</span></td></tr><tr><td class="number">31</td><td>    x <span class="k3">=</span> <a href="http://www.allegro.cc/manual/mouse_x" target="_blank"><span class="a">mouse_x</span></a><span class="k2">;</span></td></tr><tr><td class="number">32</td><td>    y <span class="k3">=</span> <a href="http://www.allegro.cc/manual/mouse_y" target="_blank"><span class="a">mouse_y</span></a><span class="k2">;</span></td></tr><tr><td class="number">33</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">34</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">35</td><td>  <span class="k1">else</span> mouse_down <span class="k3">=</span> recording <span class="k3">=</span> FALSE<span class="k2">;</span></td></tr><tr><td class="number">36</td><td>  </td></tr><tr><td class="number">37</td><td>  <span class="k1">if</span><span class="k2">(</span>recording<span class="k2">)</span></td></tr><tr><td class="number">38</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">39</td><td>    <span class="c">//drawing_mode(DRAW_MODE_XOR, NULL, 0, 0);</span></td></tr><tr><td class="number">40</td><td>    <span class="c">//acquire_screen();</span></td></tr><tr><td class="number">41</td><td>    <a href="http://www.allegro.cc/manual/line" target="_blank"><span class="a">line</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, x, y, <a href="http://www.allegro.cc/manual/mouse_x" target="_blank"><span class="a">mouse_x</span></a>, <a href="http://www.allegro.cc/manual/mouse_y" target="_blank"><span class="a">mouse_y</span></a>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">0</span>, <span class="n">255</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">42</td><td>    <span class="c">//release_screen();</span></td></tr><tr><td class="number">43</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">44</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">45</td><td>&#160;</td></tr><tr><td class="number">46</td><td>  <a href="http://www.allegro.cc/manual/allegro_exit" target="_blank"><span class="a">allegro_exit</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">47</td><td>  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">48</td><td><span class="k2">}</span></td></tr><tr><td class="number">49</td><td><a href="http://www.allegro.cc/manual/END_OF_MAIN" target="_blank"><span class="a">END_OF_MAIN</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr></tbody></table></div></div><p>


Here&#39;s the crash log.  After it froze, I sent a force quit to find out where it was stuck.
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>$<span class="k2">:</span>~<span class="k3">/</span>Desktop<span class="k3">/</span>mactest me$ gdb testmouse</td></tr><tr><td class="number">2</td><td>GNU gdb <span class="n">6</span>.<span class="n">3</span>.<span class="n">50</span><span class="k3">-</span><span class="n">20050815</span> <span class="k2">(</span>Apple version gdb-477<span class="k2">)</span> <span class="k2">(</span>Sun Apr <span class="n">30</span> <span class="n">20</span><span class="k2">:</span><span class="n">06</span><span class="k2">:</span><span class="n">22</span> GMT <span class="n">2006</span><span class="k2">)</span></td></tr><tr><td class="number">3</td><td>Copyright <span class="n">2004</span> Free Software Foundation, Inc.</td></tr><tr><td class="number">4</td><td>GDB is <a href="http://www.delorie.com/djgpp/doc/libc/libc_350.html" target="_blank">free</a> software, covered by the GNU General Public License, <span class="k1">and</span> you are</td></tr><tr><td class="number">5</td><td>welcome to change it <span class="k1">and</span><span class="k3">/</span><span class="k1">or</span> distribute copies of it under certain conditions.</td></tr><tr><td class="number">6</td><td>Type <span class="s">"show copying"</span> to see the conditions.</td></tr><tr><td class="number">7</td><td>There is absolutely no warranty <span class="k1">for</span> GDB.  Type <span class="s">"show warranty"</span> <span class="k1">for</span> details.</td></tr><tr><td class="number">8</td><td>This GDB was configured as <span class="s">"powerpc-apple-darwin"</span>...Reading symbols <span class="k1">for</span> shared libraries .... done</td></tr><tr><td class="number">9</td><td>&#160;</td></tr><tr><td class="number">10</td><td><span class="k2">(</span>gdb<span class="k2">)</span> r</td></tr><tr><td class="number">11</td><td>Starting program: <span class="k3">/</span>Users<span class="k3">/</span>me<span class="k3">/</span>Desktop<span class="k3">/</span>mactest<span class="k3">/</span>testmouse </td></tr><tr><td class="number">12</td><td>Reading symbols <span class="k1">for</span> shared libraries . done</td></tr><tr><td class="number">13</td><td>Reading symbols <span class="k1">for</span> shared libraries . done</td></tr><tr><td class="number">14</td><td>Reading symbols <span class="k1">for</span> shared libraries . done</td></tr><tr><td class="number">15</td><td>Reading symbols <span class="k1">for</span> shared libraries . done</td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td>Program received <a href="http://www.delorie.com/djgpp/doc/libc/libc_724.html" target="_blank">signal</a> SIGTERM, Terminated.</td></tr><tr><td class="number">18</td><td><span class="n">0x9002c128</span> in semaphore_wait_signal_trap <span class="k2">(</span><span class="k2">)</span></td></tr><tr><td class="number">19</td><td><span class="k2">(</span>gdb<span class="k2">)</span> bt</td></tr><tr><td class="number">20</td><td><span class="p">#0  0x9002c128 in semaphore_wait_signal_trap ()</span></td></tr><tr><td class="number">21</td><td><span class="p">#1  0x90001990 in pthread_mutex_lock ()</span></td></tr><tr><td class="number">22</td><td><span class="p">#2  0x300d7d94 in _unix_lock_mutex ()</span></td></tr><tr><td class="number">23</td><td><span class="p">#3  0x300d42a8 in osx_update_dirty_lines ()</span></td></tr><tr><td class="number">24</td><td><span class="p">#4  0x00002f70 in -[AllegroAppDelegate applicationDidFinishLaunching:] ()</span></td></tr><tr><td class="number">25</td><td><span class="p">#5  0x92975ad8 in _nsnote_callback ()</span></td></tr><tr><td class="number">26</td><td><span class="p">#6  0x9080b010 in __CFXNotificationPost ()</span></td></tr><tr><td class="number">27</td><td><span class="p">#7  0x908030ec in _CFXNotificationPostNotification ()</span></td></tr><tr><td class="number">28</td><td><span class="p">#8  0x9295fee0 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()</span></td></tr><tr><td class="number">29</td><td><span class="p">#9  0x93722338 in -[NSApplication _postDidFinishNotification] ()</span></td></tr><tr><td class="number">30</td><td><span class="p">#10 0x93722224 in -[NSApplication _sendFinishLaunchingNotification] ()</span></td></tr><tr><td class="number">31</td><td><span class="p">#11 0x93721d6c in -[NSApplication(NSAppleEventHandling) _handleAEOpen:] ()</span></td></tr><tr><td class="number">32</td><td><span class="p">#12 0x93721914 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] ()</span></td></tr><tr><td class="number">33</td><td><span class="p">#13 0x92976ae4 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()</span></td></tr><tr><td class="number">34</td><td><span class="p">#14 0x92976944 in _NSAppleEventManagerGenericHandler ()</span></td></tr><tr><td class="number">35</td><td><span class="p">#15 0x91534960 in aeDispatchAppleEvent ()</span></td></tr><tr><td class="number">36</td><td><span class="p">#16 0x915347fc in dispatchEventAndSendReply ()</span></td></tr><tr><td class="number">37</td><td><span class="p">#17 0x91534654 in aeProcessAppleEvent ()</span></td></tr><tr><td class="number">38</td><td><span class="p">#18 0x932200e0 in AEProcessAppleEvent ()</span></td></tr><tr><td class="number">39</td><td><span class="p">#19 0x9372005c in _DPSNextEvent ()</span></td></tr><tr><td class="number">40</td><td><span class="p">#20 0x9371fb48 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()</span></td></tr><tr><td class="number">41</td><td><span class="p">#21 0x9371c08c in -[NSApplication run] ()</span></td></tr><tr><td class="number">42</td><td><span class="p">#22 0x000034d0 in main ()</span></td></tr><tr><td class="number">43</td><td><span class="k2">(</span>gdb<span class="k2">)</span> q</td></tr><tr><td class="number">44</td><td>The program is running.  Exit anyway? <span class="k2">(</span>y <span class="k1">or</span> n<span class="k2">)</span> y</td></tr><tr><td class="number">45</td><td>$</td></tr></tbody></table></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mike Farrell)</author>
		<pubDate>Fri, 21 Jul 2006 23:56:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
It also might help to note that I&#39;m on a dual core cpu.
</p></div></div><p>
The crash log suggests that it&#39;s a race condition, which would explain why I&#39;ve never seen the problem on my laptop (not that I use it much for Allegro-related stuff; it&#39;s for work).<br />That will also make it hard to debug though. I&#39;m not really familiar with the internals of the MacOS X port (I&#39;m mostly a Linux person); it may be worthwhile to draw Peter Hull&#39;s attention to this thread as well.</p><p>Out of curiosity, what happens if you call show_mouse(NULL) or set_gfx_mode(GFX_TEXT, ...) before allegro_exit()?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 22 Jul 2006 01:56:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Both calls did nothing (exited normally)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mike Farrell)</author>
		<pubDate>Sat, 22 Jul 2006 06:26:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, but it didn&#39;t prevent the crash then...?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 22 Jul 2006 12:01:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve reproduced this on my system, too. It&#39;s a tricky one to debug - the event thread gets deadlocked waiting to update the screen, but there&#39;s no indication of which part of the code took the lock and then didn&#39;t release it.</p><p>I don&#39;t know if this is the cause, but can anyone help with a more robust &#39;counted lock&#39; scheme; at the moment the code looks like this
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="c">/* osx_qz_acquire_win:</span></td></tr><tr><td class="number">2</td><td><span class="c"> *  Bitmap locking for Quartz windowed mode.</span></td></tr><tr><td class="number">3</td><td><span class="c"> */</span></td></tr><tr><td class="number">4</td><td><span class="k1">static</span> <span class="k1">void</span> osx_qz_acquire_win<span class="k2">(</span><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>bmp<span class="k2">)</span></td></tr><tr><td class="number">5</td><td><span class="k2">{</span></td></tr><tr><td class="number">6</td><td>   <span class="c">/* to prevent the drawing threads and the rendering proc</span></td></tr><tr><td class="number">7</td><td><span class="c">      from concurrently accessing the dirty lines array */</span></td></tr><tr><td class="number">8</td><td>  <span class="k1">if</span> <span class="k2">(</span>lock_nesting <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">9</td><td>      _unix_lock_mutex<span class="k2">(</span>osx_window_mutex<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>   bmp-&gt;id <span class="k3">|</span><span class="k3">=</span> BMP_ID_LOCKED<span class="k2">;</span></td></tr><tr><td class="number">11</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">12</td><td>   lock_nesting<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td><span class="k2">}</span></td></tr><tr><td class="number">14</td><td>&#160;</td></tr><tr><td class="number">15</td><td> </td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td><span class="c">/* osx_qz_release_win:</span></td></tr><tr><td class="number">18</td><td><span class="c"> *  Bitmap unlocking for Quartz windowed mode.</span></td></tr><tr><td class="number">19</td><td><span class="c"> */</span></td></tr><tr><td class="number">20</td><td><span class="k1">static</span> <span class="k1">void</span> osx_qz_release_win<span class="k2">(</span><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>bmp<span class="k2">)</span></td></tr><tr><td class="number">21</td><td><span class="k2">{</span></td></tr><tr><td class="number">22</td><td>   <span class="k1">if</span> <span class="k2">(</span>lock_nesting <span class="k3">&gt;</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">23</td><td>      lock_nesting--<span class="k2">;</span></td></tr><tr><td class="number">24</td><td>      <span class="k1">if</span> <span class="k2">(</span><span class="k3">!</span>lock_nesting<span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">25</td><td>        bmp-&gt;id <span class="k3">&amp;</span><span class="k3">=</span> ~BMP_ID_LOCKED<span class="k2">;</span></td></tr><tr><td class="number">26</td><td>         _unix_unlock_mutex<span class="k2">(</span>osx_window_mutex<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">27</td><td>      <span class="k2">}</span></td></tr><tr><td class="number">28</td><td>   <span class="k2">}</span></td></tr><tr><td class="number">29</td><td><span class="k2">}</span></td></tr></tbody></table></div></div><p>
which I think is vulnerable to another thread jumping in between <tt>lock_nesting</tt> being tested, and the mutex being taken.</p><p>Pete
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Hull)</author>
		<pubDate>Sat, 22 Jul 2006 17:54:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
which I think is vulnerable to another thread jumping in between lock_nesting being tested, and the mutex being taken.
</p></div></div><p>
Then why not just:
</p><div class="source-code snippet"><div class="inner"><pre>_unix_lock_mutex<span class="k2">(</span>lock_nesting_check_mutex<span class="k2">)</span><span class="k2">;</span>

<span class="k1">if</span> <span class="k2">(</span>lock_nesting <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
      _unix_lock_mutex<span class="k2">(</span>osx_window_mutex<span class="k2">)</span><span class="k2">;</span>
   bmp-&gt;id <span class="k3">|</span><span class="k3">=</span> BMP_ID_LOCKED<span class="k2">;</span>
  <span class="k2">}</span>

_unix_unlock_mutex<span class="k2">(</span>lock_nesting_check_mutex<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Harte)</author>
		<pubDate>Sat, 22 Jul 2006 21:13:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you need me to test any patches on my end, let me know.  I&#39;m more than willing to try to help fix this bug so I can port my apps <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mike Farrell)</author>
		<pubDate>Tue, 25 Jul 2006 05:02:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Dear Mike,</p><p>Thanks for the offer. I&#39;m looking at the mouse stuff now, and also some &#39;sticky&#39; joystick problems that Jay reported.</p><p>Pete
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Hull)</author>
		<pubDate>Wed, 26 Jul 2006 02:14:41 +0000</pubDate>
	</item>
</rss>
