[lkml]   [2012]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Memory corruption due to word sharing

    Jan Kara <> writes:
    > we've spotted the following mismatch between what kernel folks expect
    > from a compiler and what GCC really does, resulting in memory corruption on
    > some architectures. Consider the following structure:
    > struct x {
    > long a;
    > unsigned int b1;
    > unsigned int b2:1;
    > };

    If this structure were volatile, you could try
    -fstrict-volatile-bitfields, which forces GCC to use the C type to
    define the access width, instead of doing whatever it thinks is optimal.

    Note: that flag is enabled by default for some targets already, most
    notably ARM.

     \ /
      Last update: 2012-02-03 07:49    [W:0.020 / U:8.136 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site