You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bus error on ARM CPUs (i.MX6) with GCC 12.3.0 #1159
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?
Activity
jhofstee commentedon Mar 29, 2025
I think I encountered the same issue. Openembedded version is Scarthgap (gcc 13.3), brottli 1.1.0 on ARM. It is https://github.com/google/brotli/blob/v1.1.0/c/enc/histogram_inc.h#L47 causing the bus error. Adding -fno-strict-aliasing to the CFLAGS solves it.
brotli: disable strict aliasing
zlib: fix pointer alignment
zlib: fix pointer alignment
zlib: fix pointer alignment
jhofstee commentedon Apr 9, 2025
@eustas or @ChHapp this should be fixed by nodejs/node#57727, so this issue can be closed.
nodejs: backport a patch to prevent brotli crashing nodejs
8 remaining items
zlib: fix pointer alignment
zlib: fix pointer alignment
nodejs: backport a patch to prevent brotli crashing nodejs
zlib: fix pointer alignment
zlib: fix pointer alignment
zlib: fix pointer alignment
zlib: fix pointer alignment
zlib: fix pointer alignment
zlib: fix pointer alignment
zlib: fix pointer alignment
nodejs: backport a patch to prevent brotli crashing nodejs
nodejs: backport a patch to prevent brotli crashing nodejs
nodejs: backport a patch to prevent brotli crashing nodejs