Re: [AD] x color conversion again |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Tue, 2004-07-13 at 20:00 +0200, Evert Glebbeek wrote:
> On Tuesday 13 July 2004 20:01, Elias Pschernig wrote:
> > Is there a way to somehow see more in gdb? Like, if there was a signal
> > before the crash? I'm a bit lost right now.
>
> I think you can build Allegro in a super-debug mode (something like make
> DEBUGMODE=2 instead of make DEBUGMODE=1), but I'm not sure if that helps
> in this case...
> Other than that... adding extra TRACEs is all I can think of at the moment.
>
Well, here's how far I could track this down. Every time the signal
occurs while the program is inside the asm function, there's the crash.
(I put printf commands before and after calling the blitter_func inside
_xwin_private_fast_colorconv ("<" and ">"), and "." inside the signal
handler, and got this:
Lots of: <><><><>.<><><><><>.<>
And on and on, never a . between < and >, until:
<.
Aborted.
So, even if using printf should have all sorts of other sideeffects, I'm
quite convinced this is the cause. Someone who knows how to do it can
probably get gdb to show the same effect in a cleaner way :)
It also doesn't matter if MMX is used or not - but without using MMX,
programs sometimes run a few seconds before crashing.
So, for now, the attached patch makes the signals version not crash
anymore, by simply disabling the 8-bit blitter in case the signals
version is used.
Maybe someone else has more luck with this. The bug is probably related
to something not being set up properly for the palette lookup - I didn't
check anything in that direction - since it's odd that only the signals
version triggers it - but well, not sure. Or is it again related to the
RGB ordering?
--
Elias Pschernig
Index: src/x/xwin.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/x/xwin.c,v
retrieving revision 1.61
diff -u -p -r1.61 xwin.c
--- src/x/xwin.c 11 Jul 2004 10:33:10 -0000 1.61
+++ src/x/xwin.c 13 Jul 2004 20:37:27 -0000
@@ -1461,6 +1461,12 @@ static int _xwin_private_colorconv_usabl
/* For usable true color modes visual must be TrueColor or DirectColor. */
return 0;
}
+ #ifndef ALLEGRO_MULTITHREADED
+ else if (_xwin.screen_depth == 8) {
+ /* TODO: Find out why it crashes otherwise */
+ return 0;
+ }
+ #endif
else if ((_xwin.fast_visual_depth == 16)
&& (_xwin.rsize == 32) && ((_xwin.gsize == 32) || (_xwin.gsize == 64)) && (_xwin.bsize == 32)
&& ((_xwin.rshift == 0) || (_xwin.rshift == 10) || (_xwin.rshift == 11))