Crash when diffoscoping two files
Hey it seems like diffoscope errors out when I compare these two files:
$ diffoscope /var/cache/pacman/pkg/ansible-9.4.0-2-any.pkg.tar.zst /var/cache/pacman/pkg/ansible-9.4.0-4-any.pkg.tar.zst
realloc(): invalid next size
[1] 24531 IOT instruction (core dumped) diffoscope /var/cache/pacman/pkg/ansible-9.4.0-2-any.pkg.tar.zst
I can not really make sense of the backtrace (to me it almost reads like a python bug), so any input would be appreciated
- Version: diffoscope 265
- Python: Python 3.12.2
- OS: Arch Linux (rolling)
Let me know if I should provide any more information!
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1 0x00007ffff76ab393 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2 0x00007ffff765a6c8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff76424b8 in __GI_abort () at abort.c:79
#4 0x00007ffff7643395 in __libc_message_impl (fmt=fmt@entry=0x7ffff77bb2ea "%s\n") at ../sysdeps/posix/libc_fatal.c:132
#5 0x00007ffff76b52a7 in malloc_printerr (str=str@entry=0x7ffff77b9152 "realloc(): invalid next size") at malloc.c:5772
#6 0x00007ffff76b934c in _int_realloc (av=av@entry=0x7ffff77f6ac0 <main_arena>, oldp=oldp@entry=0x5555582128d0, oldsize=oldsize@entry=656, nb=nb@entry=864)
at malloc.c:4939
#7 0x00007ffff76ba1a6 in __GI___libc_realloc (oldmem=oldmem@entry=0x5555582128e0, bytes=bytes@entry=843) at malloc.c:3517
#8 0x00007ffff79b9b92 in _PyMem_RawRealloc (size=843, ptr=0x5555582128e0, _unused_ctx=<optimized out>) at Objects/obmalloc.c:67
#9 PyMem_RawRealloc (new_size=843, ptr=0x5555582128e0) at Objects/obmalloc.c:680
#10 _PyObject_Realloc (ctx=<optimized out>, nbytes=843, ptr=0x5555582128e0) at Objects/obmalloc.c:1944
#11 _PyObject_Realloc (nbytes=843, ptr=0x5555582128e0, ctx=0x0) at Objects/obmalloc.c:1931
#12 PyObject_Realloc (new_size=843, ptr=0x5555582128e0) at Objects/obmalloc.c:823
#13 resize_compact (unicode=unicode@entry=0x5555582128e0, length=length@entry=802) at Objects/unicodeobject.c:1020
#14 0x00007ffff79b8e3f in _PyUnicodeWriter_PrepareInternal (writer=0x7fffdf456fb8, length=<optimized out>, maxchar=<optimized out>)
at Objects/unicodeobject.c:13077
#15 0x00007ffff79bb35e in _PyUnicodeWriter_WriteStr (writer=0x7fffdf456fb8, str=0x7fffdc0b86f0) at Objects/unicodeobject.c:13155
#16 0x00007ffff7ab86dd in write_str (self=0x7fffdf456f80, obj=<optimized out>) at ./Modules/_io/stringio.c:221
#17 0x00007ffff7ab8be8 in _io_StringIO_write (self=<optimized out>, obj=<optimized out>) at ./Modules/_io/stringio.c:550
#18 0x00007ffff79aae5f in cfunction_vectorcall_O (func=0x7fffdc1376a0, args=0x7fffffffcf58, nargsf=<optimized out>, kwnames=0x0)
at ./Include/cpython/methodobject.h:50
#19 0x00007ffff79bb9a6 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=9223372036854775809, args=0x7fffffffcf58, callable=0x7fffdc1376a0,
tstate=0x7ffff7e31788 <_PyRuntime+459656>) at ./Include/internal/pycore_call.h:92
#20 PyObject_CallOneArg (func=0x7fffdc1376a0, arg=<optimized out>) at Objects/call.c:401
#21 0x00007ffff7a62c8d in PyFile_WriteObject (v=0x7fffdc0b86f0, f=<optimized out>, flags=<optimized out>) at Objects/fileobject.c:132
#22 0x00007ffff7a623b1 in builtin_print_impl (module=<optimized out>, flush=0, file=0x7fffdf456f80, end=0x0, sep=0x0, args=0x7fffdf4e0f70)
at Python/bltinmodule.c:2057
#23 builtin_print (module=<optimized out>, args=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Python/clinic/bltinmodule.c.h:1121
#24 0x00007ffff788d083 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=0x7ffff7f9de40, throwflag=<optimized out>) at Python/bytecodes.c:2966
#25 0x00007ffff79dd591 in _PyEval_EvalFrame (throwflag=0, frame=0x7ffff4767f38, tstate=<optimized out>) at ./Include/internal/pycore_ceval.h:89
#26 gen_send_ex2 (closing=0, exc=0, presult=<synthetic pointer>, arg=0x0, gen=0x7ffff4767ef0) at Objects/genobject.c:230
#27 gen_iternext (gen=0x7ffff4767ef0) at Objects/genobject.c:603
#28 0x00007ffff79db625 in list_extend (self=self@entry=0x7fffdc0bf580, iterable=iterable@entry=0x7ffff4767ef0) at Objects/listobject.c:944
#29 0x00007ffff79fb2ea in _PyList_Extend (iterable=0x7ffff4767ef0, self=0x7fffdc0bf580) at Objects/listobject.c:980
#30 PySequence_List (v=0x7ffff4767ef0) at Objects/abstract.c:2121
#31 0x00007ffff79ed3e3 in PySequence_Fast (m=0x7ffff7af4247 "can only join an iterable", v=0x7ffff4767ef0) at Objects/abstract.c:2152
#32 PyUnicode_Join (seq=0x7ffff4767ef0, separator=0x7ffff7dd07b8 <_PyRuntime+62392>) at Objects/unicodeobject.c:9547
#33 unicode_join (self=0x7ffff7dd07b8 <_PyRuntime+62392>, iterable=0x7ffff4767ef0) at Objects/unicodeobject.c:11727
#34 0x00007ffff78907b7 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=0x7ffff7f9dcd8, throwflag=<optimized out>) at Python/bytecodes.c:3085
#35 0x00007ffff7aca755 in starmap_next (lz=0x7ffff6115000) at ./Modules/itertoolsmodule.c:1981
#36 0x00007ffff7a268c6 in filter_next (lz=0x7ffff474b370) at Python/bltinmodule.c:583
#37 0x00007ffff79db625 in list_extend (self=0x7ffff465a8c0, iterable=<optimized out>) at Objects/listobject.c:944
#38 0x00007ffff78907b7 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=0x7ffff7f9d800, throwflag=<optimized out>) at Python/bytecodes.c:3085
#39 0x00007ffff7aca755 in starmap_next (lz=0x7ffff4d14250) at ./Modules/itertoolsmodule.c:1981
#40 0x00007ffff7a268c6 in filter_next (lz=0x7ffff6ea7af0) at Python/bltinmodule.c:583
#41 0x00007ffff79db625 in list_extend (self=0x7ffff60bd780, iterable=<optimized out>) at Objects/listobject.c:944
#42 0x00007ffff79bf62e in method_vectorcall_O (func=0x7ffff714cef0, args=0x7ffff7f9d540, nargsf=<optimized out>, kwnames=0x0) at Objects/descrobject.c:482
#43 0x00007ffff79a2414 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=9223372036854775810, args=0x7ffff7f9d540, callable=0x7ffff714cef0,
tstate=0x7ffff7e31788 <_PyRuntime+459656>) at ./Include/internal/pycore_call.h:92
#44 PyObject_Vectorcall (callable=0x7ffff714cef0, args=0x7ffff7f9d540, nargsf=9223372036854775810, kwnames=0x0) at Objects/call.c:325
#45 0x00007ffff788c81f in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=0x7ffff7f9d4a8, throwflag=<optimized out>) at Python/bytecodes.c:2706
#46 0x00007ffff7a524b7 in PyEval_EvalCode (co=0x7ffff7180030, globals=<optimized out>, locals=0x7ffff71f9c40) at Python/ceval.c:578
#47 0x00007ffff7a75067 in run_eval_code_obj (tstate=tstate@entry=0x7ffff7e31788 <_PyRuntime+459656>, co=co@entry=0x7ffff7180030,
globals=globals@entry=0x7ffff71f9c40, locals=locals@entry=0x7ffff71f9c40) at Python/pythonrun.c:1722
#48 0x00007ffff7a701cc in run_mod (mod=mod@entry=0x55555562c1b8, filename=filename@entry=0x7ffff71f9df0, globals=globals@entry=0x7ffff71f9c40,
locals=locals@entry=0x7ffff71f9c40, flags=flags@entry=0x7fffffffdc10, arena=arena@entry=0x7ffff711be70) at Python/pythonrun.c:1743
#49 0x00007ffff7a87483 in pyrun_file (fp=fp@entry=0x55555555a5a0, filename=filename@entry=0x7ffff71f9df0, start=start@entry=257,
globals=globals@entry=0x7ffff71f9c40, locals=locals@entry=0x7ffff71f9c40, closeit=closeit@entry=1, flags=0x7fffffffdc10) at Python/pythonrun.c:1643
#50 0x00007ffff7a86646 in _PyRun_SimpleFileObject (fp=0x55555555a5a0, filename=0x7ffff71f9df0, closeit=1, flags=0x7fffffffdc10) at Python/pythonrun.c:433
#51 0x00007ffff7a86358 in _PyRun_AnyFileObject (fp=0x55555555a5a0, filename=0x7ffff71f9df0, closeit=1, flags=0x7fffffffdc10) at Python/pythonrun.c:78
#52 0x00007ffff7a80887 in pymain_run_file_obj (skip_source_first_line=0, filename=0x7ffff71f9df0, program_name=0x7ffff71f9db0) at Modules/main.c:360
#53 pymain_run_file (config=0x7ffff7dd4368 <_PyRuntime+77672>) at Modules/main.c:379
#54 pymain_run_python (exitcode=0x7fffffffdbe4) at Modules/main.c:629
#55 Py_RunMain () at Modules/main.c:709
#56 0x00007ffff7a4011b in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:763
#57 0x00007ffff7643cd0 in __libc_start_call_main (main=main@entry=0x555555555120 <main>, argc=argc@entry=4, argv=argv@entry=0x7fffffffde68)
at ../sysdeps/nptl/libc_start_call_main.h:58
#58 0x00007ffff7643d8a in __libc_start_main_impl (main=0x555555555120 <main>, argc=4, argv=0x7fffffffde68, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffde58) at ../csu/libc-start.c:360
#59 0x0000555555555045 in _start ()