Skip to content

bus error on ARM CPUs (i.MX6) with GCC 12.3.0 #1159

@ChHapp

Description

@ChHapp

I have experienced a 'bus-error' with Yocto-Mickledore (gcc 12.3.0)
I am using the brotli lib with nodejs and when I run a simple compress/decompress example I get this 'bus-error'.

This is a generated example:

const zlib = require('zlib');
const inputString = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
const buffer = Buffer.from(inputString, 'utf-8');

// Compress the buffer using Brotli
zlib.brotliCompress(buffer, (err, compressedBuffer) => {
  if (err) {
    console.error('Error compressing data:', err);
    return;
  }
  
  // Convert compressed buffer to string
  const compressedString = compressedBuffer.toString('base64');  
  console.log('Compressed string:', compressedString);  
  // Decompress the compressed buffer to verify
  zlib.brotliDecompress(compressedBuffer, (err, decompressedBuffer) => {
    if (err) {
      console.error('Error decompressing data:', err);
      return;
    }    
    // Convert decompressed buffer back to string
    const decompressedString = decompressedBuffer.toString('utf-8');    
    console.log('Decompressed string:', decompressedString);
  });
});

I have figured out that if I add a bbappend with CFLAGS += " -Og" the 'libbrotlienc.so.1.0.9' works like a charm again.
Alternatively if I compile it with the GCC 11.2.0 (Yocto-Honister) it also works as expected.

I have also tried newer TAGs and the Git HEAD too, with no luck to getting it to work by using '-O2' as a C flag.

Are there any recommended C flags for this project? Yocto is uses '-O2' by default.
Is this a already known?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions