[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crash at unalign access

From: Nick Clifton
Subject: Re: crash at unalign access
Date: Fri, 05 May 2006 18:24:02 +0100
User-agent: Thunderbird 1.5 (X11/20051201)

Hi Mehmet,

We have a global variable which is initialized to 1 and named AMLogging.
When we compile our source it does not cause any problem but when we change
AMLogging = 0;
and compile, if at run time we try to access to this variable it is causing
system to crash with a floating point exception to 4-byte aligned address.

Is it really a "floating point" exception ? I would assume, based on the name of the variable and the values you are using to initialise it, that it is an integer variable and that there would not be any accesses of it as a floating point value.

gcc version 3.4.3

It is possible that this is a gcc bug, not a binutils one. If gcc is emitting the assembler code to create your AMLogging variable without also emitting the assembler code to ensure its correct alignment, then this would cause the problem.

        .globl  AMLoggingClearedAlarms
        .section        .bss
        .align  2
        .type   AMLoggingClearedAlarms, @object
        .size   AMLoggingClearedAlarms, 4
        .space  4

This appears to be correct. The ".align 2" directive will ensure that the location counter is aligned to the next 4 byte boundary before the ".space 4" directive creates a four byte entry for the AMLoggingClearedAlarms object.

Do you have a small, simple test case that reproduces the problem ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]