armv7h Chromium and a bug in Node

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

armv7h Chromium and a bug in Node

Postby FelledTreeNo9 » Wed Dec 07, 2022 8:21 pm

The armv7h version of Chromium in the repos dates back to April and doesn't run on an updated system due to some library mismatches (in 'flac' for example). As I prepared to build it myself, I read in this thread that "the build logs are full of errors". Side question - are those logs available to view anywhere? It would have been interesting.

So anyway building this beast myself was a struggle but I got there in the end. The main problem that stopped the build was this:
$this->bbcode_second_pass_code('', '[11039/52239] ACTION //third_party/devtools-frontend/src:compress(//build/toolchain/linux/unbundle:default)

python3 ../../third_party/node/node.py ../../third_party/devtools-frontend/src/scripts/build/compress_files.js --file_list __third_party_devtools-frontend_src_compress___build_toolchain_linux_unbundle_default__rule..rsp

RuntimeError: Command '/mnt/hd/archbuilds/chromium/src/chromium-108.0.5359.94/out/Release/../../third_party/node/linux/node-linux-x64/bin/node ../../third_party/devtools-frontend/src/scripts/build/compress_files.js --file_list __third_party_devtools-frontend_src_compress___build_toolchain_linux_unbundle_default__rule..rsp' failed')
When running that node command from the last line manually, node crashes with a "Bus error".

The underlying bug is in Node doing Brotli compression. Here's a reproducer - running this on my system (which is a Pi 4, by the way) leads to the same kind of crash:
$this->bbcode_second_pass_code('', '
const fs = require('fs');
const writeStream = fs.createWriteStream("brotli.out");

const zlib = require('zlib');
brotliCompress = zlib.createBrotliCompress();
brotliCompress.pipe(writeStream);

brotliCompress.write("hello");
brotliCompress.write("world");

brotliCompress.end();
')

While I haven't delved into that specifically any further yet, I worked around it in the Chromium build by changing compress_files.js to shell out to the 'brotli' command - which works fine - instead of trying to do it within Node. A patch is attached.

With that - notwithstanding a couple of other hiccups that are probably specific to my situation (2 GB RAM is not enough to build this so make sure you have a swapfile!) - the (distcc-assisted) build completed and I now have a working Chromium.
Attachments
workaround_node_brotli_crash.patch
(1.71 KiB) Downloaded 126 times
FelledTreeNo9
 
Posts: 1
Joined: Wed Dec 07, 2022 7:11 pm

Re: armv7h Chromium and a bug in Node

Postby sierratango » Tue Jan 10, 2023 10:23 pm

Thank you for looking into this issue and creating a fix.

Please consider creating a pull request on GitHub: https://github.com/archlinuxarm/PKGBUILDs/pulls
sierratango
 
Posts: 3
Joined: Thu Sep 01, 2022 8:17 pm


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 6 guests