[hatari-devel] Hatari patches for bitplane conversion

Thomas Huth huth at users.berlios.de
Wed Jul 22 23:29:25 CEST 2009


On Wed, 22 Jul 2009 22:43:11 +0300
Eero Tamminen <eerot at users.berlios.de> wrote:

> On Wednesday 22 July 2009, Kåre Andersen wrote:
> > -int nFrameSkips;          /* speed up by skipping video frames */
> > +int nFrameSkips=0;        /* speed up by skipping video frames */
> 
> It's possible that because you explicitly set the variable, it goes
> to a different section in the binary (.data instead of .bss)[1], but
> that should not have any effect on it's value as globals are
> automatically zeroed. (Apple documentation I referred in my earlier
> mail already stated that .bss should be zeroed.)

I agree with Eero here. I hardly can believe that the .bss is not
initialized to zero on Mac OS X (it's a BSD/Unix based OS, and all such
systems clear the BSS as far as I know).

So the real problem (a wrong memory access) might still persist, it's
just not visible anymore since the variable has been moved to another
location in memory.

> Once we know where your compiler puts the nFrameSkips variable in BSS,
> I could check whether e.g. any of the variables before or after it
> could be written in a way that overwrites/corrupts nFrameSkips.

For that you don't need the "gcc -S" output, but rather an
"objdump -Drx hatari" of the whole executable (since the linker still
might re-arrange things).
Kåre, could you please create such an objdump of your executable to see
which variables are placed right before the nFrameSkips variable?

 Thomas



More information about the hatari-devel mailing list