Has anyone met the recent error in in copy_uint128 () (stdint library)?

I recently updated to Fedora 33 with OCaml 4.11.1 and recreated opam switch (I was on Fedora 32 with OCaml 4.10.1) but met very strange error on any OCaml program that is linked with stdint library:

[i] ℤ gdb _build/default/tool.exe                                                                                                                                                                                        14:01:47 
Reading symbols from _build/default/tool.exe...
(gdb) run -h
Starting program: /home/user/tool/_build/default/tool.exe -h
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00005555560906c3 in copy_uint128 (i=340282366920938463463374607431768211455) at ../../../../../../.opam/default/.opam-switch/build/stdint.0.6.0/_build/default/lib/uint128_stubs.c:482
482     ../../../../../../.opam/default/.opam-switch/build/stdint.0.6.0/_build/default/lib/uint128_stubs.c: No such file or directory.
(gdb) bt
#0  0x00005555560906c3 in copy_uint128 (i=340282366920938463463374607431768211455) at ../../../../../../.opam/default/.opam-switch/build/stdint.0.6.0/_build/default/lib/uint128_stubs.c:482
#1  uint128_max_int () at ../../../../../../.opam/default/.opam-switch/build/stdint.0.6.0/_build/default/lib/uint128_stubs.c:482
#2  0x0000555555c42283 in camlStdint__entry () at lib/stdint.ml:1450
#3  0x0000555555af5359 in caml_program ()
#4  0x00005555560e66b0 in caml_start_program ()
#5  0x00005555560c44ec in caml_startup_common ()
#6  0x00005555560c456b in caml_main ()
#7  0x0000555555af289e in main ()
(gdb) 

Presumably, this is due to 128-bit integers not being aligned on 128-bit boundaries, thus causing an illegal memory access.

This might be fixed by

1 Like

Updating to stdint-0.7.0 fixed the problem, thanks!