Bug#1085257: diffoscope: Compare ar(1) archives

Alejandro Colomar alx at kernel.org
Thu Oct 17 22:22:42 BST 2024


On Thu, Oct 17, 2024 at 10:16:25AM GMT, Chris Lamb wrote:
> Hello Alejandro,

Hi Chris!

> 
> > It would be nice to be able to compare ar(1) archives.
> 
> It should already do!
> 
>   $ diffoscope tests/data/test1.a tests/data/test2.a
> 
>   --- tests/data/test1.a
>   +++ tests/data/test2.a
>   ├── file list
>   │ @@ -1,2 +1,2 @@
>   │ -----------   0        0        0       10 2015-06-24 12:14:19.000000 /
>   │ --rw-r--r--   0     1000     1000     1216 2015-06-24 12:13:47.000000 test.o
>   │ +----------   0        0        0       10 2015-06-24 12:14:29.000000 /
>   │ +-rw-r--r--   0     1000     1000     1216 2015-06-24 12:14:27.000000 test.o
>   ├── test.o
>   │ ├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {}
>   │ │ @@ -3,10 +3,10 @@
>   │ │  
>   │ │  Disassembly of section .text:
>   │ │  
>   │ │  0000000000000000 <f>:
>   │ │  f():
>   │ │  	push   %rbp
>   │ │  	mov    %rsp,%rbp
>   │ │ -	mov    $0x2a,%eax
>   │ │ +	mov    $0xffffffff,%eax
>   │ │  	pop    %rbp
>   │ │  	ret
> 
> Do you not get the same thing? You may need to install the binutils
> package.

Humm.  I might be in front of a bug?  I was trying to see what was the
difference between an archive before and after running ranlib(1) on it.
Maybe that was the issue?

See below.

Have a lovely day!
Alex


alx at debian:~/src/alx/liba2i/contrib$ dpkg -l binutils | tail -n1
ii  binutils       2.43.1-5     amd64        GNU assembler, linker and binary utilities
alx at debian:~/src/alx/liba2i/contrib$ diffoscope liba2i.a liba2i_ranlibbed.a 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/diffoscope/main.py", line 767, in main
    sys.exit(run_diffoscope(parsed_args))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/main.py", line 718, in run_diffoscope
    difference = compare_root_paths(path1, path2)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/utils/compare.py", line 69, in compare_root_paths
    difference = compare_files(file1, file2)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/utils/compare.py", line 149, in compare_files
    return file1.compare(file2, source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/utils/file.py", line 536, in compare
    difference = self._compare_using_details(other, source)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/utils/file.py", line 437, in _compare_using_details
    details.extend(self.compare_details(other, source))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/ar.py", line 71, in compare_details
    Difference.from_text_readers(
  File "/usr/lib/python3/dist-packages/diffoscope/difference.py", line 258, in from_text_readers
    return Difference.from_feeder(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/difference.py", line 214, in from_feeder
    unified_diff = diff(feeder1, feeder2)
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/diff.py", line 334, in diff
    with FIFOFeeder(feeder1, fifo1_path) as fifo1, FIFOFeeder(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/diff.py", line 225, in __exit__
    self.join()
  File "/usr/lib/python3/dist-packages/diffoscope/diff.py", line 258, in join
    raise self._exception
  File "/usr/lib/python3/dist-packages/diffoscope/diff.py", line 249, in run
    end_nl = self.feeder(fifo)
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/feeders.py", line 79, in feeder
    for buf in in_file:
               ^^^^^^^
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/utils/libarchive.py", line 134, in list_libarchive
    for entry in archive:
                 ^^^^^^^
  File "/usr/lib/python3/dist-packages/libarchive/read.py", line 27, in __iter__
    r = read_next_header2(archive_p, entry._entry_p)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/libarchive/ffi.py", line 98, in check_int
    raise archive_error(args[0], retcode)
libarchive.exception.ArchiveError: Invalid string table (errno=22, retcode=-30, archive_p=139655089495440)


-- 
<https://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/reproducible-builds/attachments/20241017/fa43490c/attachment.sig>


More information about the Reproducible-builds mailing list