You are not logged in.

#1 2025-02-28 04:03:48

vicbis
Member
From: Melbourne Australia
Registered: 2018-01-31
Posts: 7

diffutils-3.11 sdiff

Anyone else seeing issues with the sdiff included in diffutils-3.11?

I have downgraded to 3.10

me@www.wattlegum.org [ /home/http/sdiff-test-files ]$ sdiff --version
sdiff (GNU diffutils) 3.10
.
.
me@www.wattlegum.org [ /home/http/sdiff-test-files ]$ sdiff file1 file2
#								#
#								#
#								#
------_----_--_----=---.-.-.-:--8-			      |	------_----_--_----=---.-.-.-:--9-

#-----------------						#-----------------
#-------------------------					#-------------------------
------_---_----_-----=-						------_---_----_-----=-

------_-----_----_----=--					------_-----_----_----=--
------_---_----_----=-						------_---_----_----=-

#-----------------						#-----------------
------_--_-----_-----_----=--					------_--_-----_-----_----=--

------_----_-------=--						------_----_-------=--

me@www.wattlegum.org [ /home/http/sdiff-test-files ]$ sdiff file1.alt file2.alt
#								#
#								#
#								#
------_----_--_----=---.-.-.-:--8-			      |	------_----_--_----=---.-.-.-:--9-

#-----------------						#-----------------
#-------------------------					#-------------------------
------_---_----_-----=-						------_---_----_-----=-

------_-----_----_----=--					------_-----_----_----=--
------_---_----_----=-						------_---_----_----=-
me@emilia [ /tmp ]$ sdiff --version
sdiff (GNU diffutils) 3.11
.
.
me@emilia [ /tmp ]$ sdiff file1 file2
malloc(): invalid size (unsorted)
Aborted (core dumped)
me@emilia [ /tmp ]$ sdiff file1.alt file2.alt 
#								#
#								#
#								#
------_----_--_----=---.-.-.-:--8-			      |	------_----_--_----=---.-.-.-:--9-

#-----------------						#-----------------
#-------------------------					#-------------------------
------_---_----_-----=-						------_---_----_-----=-

------_-----_----_----=--					------_-----_----_----=--
------_---_----_----=-						------_---_----_----=-

sample files here -> sdiff test files

Offline

#2 2025-02-28 10:39:40

eveeee
Member
Registered: 2025-02-24
Posts: 5

Re: diffutils-3.11 sdiff

[eve@Vapor tmp]$ sdiff --version
sdiff (GNU diffutils) 3.11
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Thomas Lord.
[eve@Vapor tmp]$ sdiff file1 file2
malloc(): invalid size (unsorted)
Aborted (core dumped)
[eve@Vapor tmp]$ sdiff file1.alt file2.alt
#								#
#								#
#								#
------_----_--_----=---.-.-.-:--8-			      |	------_----_--_----=---.-.-.-:--9-

#-----------------						#-----------------
#-------------------------					#-------------------------
------_---_----_-----=-						------_---_----_-----=-

------_-----_----_----=--					------_-----_----_----=--
------_---_----_----=-						------_---_----_----=-

same here. You should check if it's reproducible on other distros

Offline

#3 2025-02-28 13:55:39

vicbis
Member
From: Melbourne Australia
Registered: 2018-01-31
Posts: 7

Re: diffutils-3.11 sdiff

No haven't tried another disto, they are too out of date in regard to the diffutils installed on them (on another version of gcc). Pretty much exclusive 'Arch' here smile
Compiled it from source, (from here), (you know ./configure, make ... )
still doing the same thing.

me@amelia [ ~/diffutils-3.11/src ]$ ./sdiff filetests/file2 filetests/file1
malloc(): invalid size (unsorted)
Aborted (core dumped)
me@amelia [ ~/diffutils-3.11/src ]$ ./sdiff filetests/file2.alt filetests/file1.alt 
#								#
#								#
#								#
------_----_--_----=---.-.-.-:--9-			      |	------_----_--_----=---.-.-.-:--8-

#-----------------						#-----------------
#-------------------------					#-------------------------
------_---_----_-----=-						------_---_----_-----=-

------_-----_----_----=--					------_-----_----_----=--
------_---_----_----=-						------_---_----_----=-

'sdiff' does an 'execve' to 'diff' and it's doing the same (by the use of strace) . The problem stems from diff itself

me@amelia [ ~/diffutils-3.11/grep execv /tmp/difftest.1861324
/tmp/difftest.1861324:execve("./diff", ["diff", "-y", "--", "filetests/file2", "filetests/file1"], 0x7fff9ef87398 /* 78 vars */) = 0

me@amelia [ ~/diffutils-3.11/src ]$ ./diff -y -- filetests/file2 filetests/file1
malloc(): invalid size (unsorted)
Aborted (core dumped)
me@amelia [ ~/diffutils-3.11/src ]$ ./diff --version
diff (GNU diffutils) 3.11
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Eggert, Mike Haertel, David Hayes,
Richard Stallman, and Len Tower.

Both use the 'standard' libraries, (along with gcc version on this box 'amelia' as I'm yet to update it)

me@amelia [ ~/diffutils-3.11/src ]$ ldd ./diff
	linux-vdso.so.1 (0x00007feb0f357000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007feb0f0e0000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007feb0f359000)
me@amelia [ ~/diffutils-3.11/src ]$ gcc --version
gcc (GCC) 14.2.1 20240910
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Additional ( access on non-arch box ), same thing

vb@cdafd.cloudserverpanel.com [ ~/diffutils-3.11/src ]$ uname -a
Linux cdafd.cloudserverpanel.com 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
vb@cdafd.cloudserverpanel.com [ ~/diffutils-3.11/src ]$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

vb@cdafd.cloudserverpanel.com [ ~/diffutils-3.11/src ]$ ./diff -y -- testfiles/file1 testfiles/file2
#								#
#								#
#								#
------_----_--_----=---.-.-.-:--8-			      |	------_----_--_----=---.-.-.-:--9-

#-----------------						#-----------------
#-------------------------					#-------------------------
------_---_----_-----=-						------_---_----_-----=-

------_-----_----_----=--					------_-----_----_----=--
------_---_----_----=-						------_---_----_----=-

#-----------------						#-----------------
------_--_-----_-----_----=--					------_--_-----_-----_----=--

------_----_-------=--						------_----_-------=--

*** Error in `./diff': free(): invalid next size (normal): 0x00000000015237d0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81329)[0x7fe72bd52329]
./diff[0x410f68]
./diff[0x4069ed]
./diff[0x408b57]
./diff[0x405079]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fe72bcf3555]
./diff[0x40513e]
======= Memory map: ========
00400000-00434000 r-xp 00000000 fd:01 274942                             /home/vb/diffutils-3.11/src/diff
00633000-00634000 r--p 00033000 fd:01 274942                             /home/vb/diffutils-3.11/src/diff
00634000-00635000 rw-p 00034000 fd:01 274942                             /home/vb/diffutils-3.11/src/diff
00635000-00646000 rw-p 00000000 00:00 0 
0151e000-0153f000 rw-p 00000000 00:00 0                                  [heap]
7fe720000000-7fe720021000 rw-p 00000000 00:00 0 
7fe720021000-7fe724000000 ---p 00000000 00:00 0 
7fe725578000-7fe72558d000 r-xp 00000000 fd:01 24044                      /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fe72558d000-7fe72578c000 ---p 00015000 fd:01 24044                      /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fe72578c000-7fe72578d000 r--p 00014000 fd:01 24044                      /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fe72578d000-7fe72578e000 rw-p 00015000 fd:01 24044                      /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fe72578e000-7fe72bcd1000 r--p 00000000 fd:01 23873                      /usr/lib/locale/locale-archive
7fe72bcd1000-7fe72be95000 r-xp 00000000 fd:01 4736                       /usr/lib64/libc-2.17.so
7fe72be95000-7fe72c094000 ---p 001c4000 fd:01 4736                       /usr/lib64/libc-2.17.so
7fe72c094000-7fe72c098000 r--p 001c3000 fd:01 4736                       /usr/lib64/libc-2.17.so
7fe72c098000-7fe72c09a000 rw-p 001c7000 fd:01 4736                       /usr/lib64/libc-2.17.so
7fe72c09a000-7fe72c09f000 rw-p 00000000 00:00 0 
7fe72c09f000-7fe72c0c1000 r-xp 00000000 fd:01 4108                       /usr/lib64/ld-2.17.so
7fe72c2b0000-7fe72c2b3000 rw-p 00000000 00:00 0 
7fe72c2bd000-7fe72c2c0000 rw-p 00000000 00:00 0 
7fe72c2c0000-7fe72c2c1000 r--p 00021000 fd:01 4108                       /usr/lib64/ld-2.17.so
7fe72c2c1000-7fe72c2c2000 rw-p 00022000 fd:01 4108                       /usr/lib64/ld-2.17.so
7fe72c2c2000-7fe72c2c3000 rw-p 00000000 00:00 0 
7ffc12eda000-7ffc12efb000 rw-p 00000000 00:00 0                          [stack]
7ffc12fc5000-7ffc12fc7000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted
vb@cdafd.cloudserverpanel.com [ ~/diffutils-3.11/src ]$ 

... I'll keep digging...

Last edited by vicbis (2025-02-28 14:25:30)

Offline

#4 2025-02-28 14:30:30

loqs
Member
Registered: 2014-03-06
Posts: 18,449

Offline

#5 2025-02-28 14:33:24

vicbis
Member
From: Melbourne Australia
Registered: 2018-01-31
Posts: 7

Re: diffutils-3.11 sdiff

Thanks for that, I was about 30 seconds off on sending an email to them.

Offline

#6 2025-03-01 16:50:31

loqs
Member
Registered: 2014-03-06
Posts: 18,449

Re: diffutils-3.11 sdiff

I would suggest opening an issue on Arch's gitlab instance asking for the following to be backported now that a fix has been committed upstream:
58e734d tests: make seq replacement more available
e9f8e6a diff: fix allocation typo leading to crashes
362a759 tests: test for diff -y crash

Offline

Board footer

Powered by FluxBB