Hi Gregor,
On Mon, 2025-10-13 at 23:46 +0200, Gregor Riepl wrote:
> In specific circumstances, xdelta3 produces a bus error on sparc64,
> presumably because of unaligned memory access.
>
> This makes the tool practically unusable on this architecture.
>
> Example stack trace:
>
> (gdb) run encode -0 -f -D -s fromfile tofile delta
> Starting program: /usr/bin/xdelta3 encode -0 -f -D -s fromfile tofile delta
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/sparc64-linux-gnu/libthread_db.so.1".
>
> Program received signal SIGBUS, Bus error.
> 0x000000000010ce60 in xd3_forward_match (n=9213, s2c=0x2306a3 "clude
> <stdio.h>\n\nint main(int argc, char** argv) {\n return 0;\n}\n",
> s1c=0xfffff80100c10413 "clude <stdio.h>\n\nint main(int argc, char**
> argv) {\n return 0;\n}\n") at xdelta3.c:3891
> warning: 3891 xdelta3.c: No such file or directory
> (gdb) bt
> #0 0x000000000010ce60 in xd3_forward_match (n=9213, s2c=0x2306a3 "clude
> <stdio.h>\n\nint main(int argc, char** argv) {\n return 0;\n}\n",
> s1c=0xfffff80100c10413 "clude <stdio.h>\n\nint main(int argc, char**
> argv) {\n return 0;\n}\n") at xdelta3.c:3891
> #1 xd3_source_extend_match (stream=stream@entry=0x7feffffe270) at
> xdelta3.c:4045
> #2 0x000000000010dd98 in xd3_string_match_fastest (stream=0x7feffffe270) at
> xdelta3.c:4729
> #3 0x000000000011105c in xd3_encode_input (stream=0x7feffffe270) at
> xdelta3.c:3226
> #4 0x0000000000116ca4 in main_input (cmd=cmd@entry=CMD_ENCODE,
> ifile=ifile@entry=0x7feffffe800, ofile=ofile@entry=0x7feffffe860,
> sfile=sfile@entry=0x7feffffe8c0) at xdelta3-main.h:3201
> #5 0x0000000000104fc8 in main (argc=<optimized out>, argv=<optimized out>)
> at xdelta3-main.h:3912
>
> The test files are attached, they originate from the pristine-tar build
> process.
This should be reported upstream, see:
https://github.com/jmacd/xdelta/issues
The testsuite also fails with unaligned access:
https://buildd.debian.org/status/fetch.php?pkg=xdelta3&arch=sparc64&ver=3.0.11-dfsg-1.2&stamp=1757507449&raw=0
I can file the bug report.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913