Skip to content

Use safe march flags for AUTOBAHN#932

Merged
RazvanLiviuVarzaru merged 1 commit intoMariaDB:devfrom
RazvanLiviuVarzaru:fix-rh10-armbuild
Mar 18, 2026
Merged

Use safe march flags for AUTOBAHN#932
RazvanLiviuVarzaru merged 1 commit intoMariaDB:devfrom
RazvanLiviuVarzaru:fix-rh10-armbuild

Conversation

@RazvanLiviuVarzaru
Copy link
Copy Markdown
Collaborator

@RazvanLiviuVarzaru RazvanLiviuVarzaru commented Mar 17, 2026

Setting AUTOBAHN_ARCH_TARGET=safe will determine the autobahn nvx sources to be compiled with safe march flags as per:
https://github.com/crossbario/autobahn-python/blob/1c7d45cd2129b1fa6daacb0ed7051448fed3ec0d/src/autobahn/nvx/_compile_args.py#L215

In our scenario the RH10 ARM build compiled
_utf8validator with PAC support, being tricked by the QEMU emulation under buildx. PAC was introduced on ARMv8.3-A while our arm hosts are ARMv8.2-A

The CI built image passes the GH Actions tests under emulation, while on our ARM hosts we can see that it crashes when trying to push the RETAA instruction, during a buildbot-worker startup.

[buildbot@6d98845070da ~]$ twistd --pidfile= -ny /home/buildbot/buildbot.tac
Illegal instruction (core dumped)

=> 0xfffedeb72120 <PyInit__nvx_utf8validator+184>:  retaa

Setting `AUTOBAHN_ARCH_TARGET=safe` will determine the autobahn nvx sources
to be compiled with save march flags as per:
https://github.com/crossbario/autobahn-python/blob/1c7d45cd2129b1fa6daacb0ed7051448fed3ec0d/src/autobahn/nvx/_compile_args.py#L215

In our scenario the `RH10 ARM` build compiled
`_utf8validator` with `PAC` support, being tricked by the QEMU emulation under buildx.
`PAC` was introduced on `ARMv8.3-A` while our arm hosts are `ARMv8.2-A`

The CI built image passes the GH Actions tests under emulation, while
on our ARM hosts we can see that it crashes when trying to push the `RETAA` instruction,
during a `buildbot-worker` startup.

```
[buildbot@6d98845070da ~]$ twistd --pidfile= -ny /home/buildbot/buildbot.tac
Illegal instruction (core dumped)

=> 0xfffedeb72120 <PyInit__nvx_utf8validator+184>:  retaa
```
Copy link
Copy Markdown
Collaborator

@fauust fauust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@grooverdan
Copy link
Copy Markdown
Member

Yike. Well done. Its a good quick fix for this problem.

cat /proc/sys/fs/binfmt_misc//qemu-aarch64
enabled
interpreter /usr/bin/qemu-aarch64-static
..
$ /usr/bin/qemu-aarch64-static --help
usage: qemu-aarch64 [options] program [arguments...]
Linux CPU emulator (compiled for aarch64 emulation)

Options and associated environment variables:

Argument             Env-variable         Description
-h                                        print this help
-help                                     
-g port              QEMU_GDB             wait gdb connection to 'port'
-L path              QEMU_LD_PREFIX       set the elf interpreter prefix to 'path'
-s size              QEMU_STACK_SIZE      set the stack size to 'size' bytes
-cpu model           QEMU_CPU             select CPU (-cpu help for list)

If QEMU_CPU=cortex-a72 (or what we have) is exposed to buildx and the emulated execution respects this we'll be a bit more protected against future and more subtle build/runtime effects.

@RazvanLiviuVarzaru RazvanLiviuVarzaru merged commit 4f61aaf into MariaDB:dev Mar 18, 2026
12 of 15 checks passed
@RazvanLiviuVarzaru
Copy link
Copy Markdown
Collaborator Author

Solved!

@hz-arm-bbw2:~$ docker run -it --rm quay.io/mariadb-foundation/bb-worker:dev_rhel10 bash
[buildbot@42a4e4ba1e9d ~]$ twistd --pidfile= -ny /home/buildbot/buildbot.tac
2026-03-18 09:01:06+0000 [-] Loading /home/buildbot/buildbot.tac...
2026-03-18 09:01:07+0000 [-] Loaded.
2026-03-18 09:01:07+0000 [-] twistd 25.5.0 (/usr/bin/python3 3.12.12) starting up.
2026-03-18 09:01:07+0000 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2026-03-18 09:01:07+0000 [-] Starting Worker -- version: 4.3.0
2026-03-18 09:01:07+0000 [-] recording hostname in twistd.hostname
2026-03-18 09:01:07+0000 [-] Starting factory <buildbot_worker.pb.BotFactory object at 0xffff0f7e4c20>
2026-03-18 09:01:07+0000 [-] Scheduling retry 1 to connect <twisted.internet.endpoints.TCP4ClientEndpoint object at 0xffff0f7e4e00> in 2.4361218204535717 seconds.
2026-03-18 09:01:07+0000 [-] Stopping factory <buildbot_worker.pb.BotFactory object at 0xffff0f7e4c20>
2026-03-18 09:01:09+0000 [-] Starting factory <buildbot_worker.pb.BotFactory object at 0xffff0f7e4c20>
2026-03-18 09:01:09+0000 [-] Scheduling retry 2 to connect <twisted.internet.endpoints.TCP4ClientEndpoint object at 0xffff0f7e4e00> in 2.964904724448062 seconds.
2026-03-18 09:01:09+0000 [-] Stopping factory <buildbot_worker.pb.BotFactory object at 0xffff0f7e4c20>
2026-03-18 09:01:12+0000 [-] Starting factory <buildbot_worker.pb.BotFactory object at 0xffff0f7e4c20>
2026-03-18 09:01:12+0000 [-] Scheduling retry 3 to connect <twisted.internet.endpoints.TCP4ClientEndpoint object at 0xffff0f7e4e00> in 3.4368867318039515 seconds.
2026-03-18 09:01:12+0000 [-] Stopping factory <buildbot_worker.pb.BotFactory object at 0xffff0f7e4c20>
^C2026-03-18 09:01:13+0000 [-] Received SIGINT, shutting down.
2026-03-18 09:01:13+0000 [-] Main loop terminated.
2026-03-18 09:01:13+0000 [-] Server Shut Down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants