diff options
Diffstat (limited to 'results/classifier/zero-shot/108/other/2935')
| -rw-r--r-- | results/classifier/zero-shot/108/other/2935 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/results/classifier/zero-shot/108/other/2935 b/results/classifier/zero-shot/108/other/2935 new file mode 100644 index 000000000..4f0161059 --- /dev/null +++ b/results/classifier/zero-shot/108/other/2935 @@ -0,0 +1,39 @@ +graphic: 0.824 +device: 0.780 +performance: 0.718 +files: 0.715 +semantic: 0.667 +PID: 0.637 +other: 0.572 +socket: 0.537 +vnc: 0.534 +network: 0.483 +boot: 0.479 +permissions: 0.477 +debug: 0.471 +KVM: 0.319 + +strchrnul detection not suitable for macOS +Description of problem: +When qemu is compiled on macOS 15.4, targeting an earlier macOS version (e.g., 15.1), and then run on this earlier macOS version (15.1), it segfaults. This is because: + +- the meson test for strchrnul succeeds (the function is present in the library) +- the strchrnul function is therefore used +- but that function was introduced in the system's libc in 15.4 only + +The root cause for the bug is that the meson test for strchrnul does not include the appropriate header. Indeed, see the documentation for meson on compiler.has_function (https://mesonbuild.com/Compiler-properties.html#does-a-function-exist) + +> Note that, on macOS programs can be compiled targeting older macOS versions than the one that the program is compiled on. It can't be assumed that the OS version that is compiled on matches the OS version that the binary will run on. +> +> Therefore when detecting function availability with compiler.has_function(), it is important to specify the correct header in the prefix argument. + +The correct fix would be, in qemu's meson.build, to change: + +`cc.has_function('strchrnul')` + +into `cc.has_function('strchrnul', prefix : '#include <string>')` + +This is the recommended best practice and would allow correct detection on all platforms, including macOS. +Steps to reproduce: +1. Install qemu from Homebrew, which is built on macOS 15.4 +2. Run it on a machine with macOS < 15.4 |