Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Feb 2020 07:11:54 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 243974] diff(1) generates core dump when --tabsize is used
Message-ID:  <bug-243974-227-bKSyAHJ91h@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-243974-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-243974-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243974

--- Comment #3 from fehmi noyan isi <fnoyanisi@yahoo.com> ---
POC for the proposed patch

fnoyanisi@patch:~ $ diff A B
1,5c1,3
< same1
< differ1
<=20
<=20
< differ3
---
> same1=20=20
> differ2
> differ4
fnoyanisi@patch:~ $ diff A B --tabsize 4
Segmentation fault (core dumped)

// After the patch
fnoyanisi@patch:~ $ diff A B --tabsize 4
1,5c1,3
< same1
< differ1
<=20
<=20
< differ3
---
> same1=20=20
> differ2
> differ4
fnoyanisi@patch:~ $ uname -a
FreeBSD patch 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r357606: Thu Feb  6 04:4=
0:35
UTC 2020=20=20=20=20
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
fnoyanisi@patch:~ $=20

// No failing ATF tests
root@patch:/usr/tests # kyua test -k /usr/tests/Kyuafile usr.bin/diff
usr.bin/diff/diff_test:Bflag  ->  passed  [0.191s]
usr.bin/diff/diff_test:b230049  ->  passed  [0.054s]
usr.bin/diff/diff_test:brief_format  ->  passed  [0.180s]
usr.bin/diff/diff_test:group_format  ->  passed  [0.064s]
usr.bin/diff/diff_test:header  ->  passed  [0.066s]
usr.bin/diff/diff_test:header_ns  ->  passed  [0.063s]
usr.bin/diff/diff_test:ifdef  ->  passed  [0.060s]
usr.bin/diff/diff_test:side_by_side  ->  passed  [0.130s]
usr.bin/diff/diff_test:simple  ->  passed  [0.230s]
usr.bin/diff/diff_test:unified  ->  passed  [0.097s]
usr.bin/diff/netbsd_diff_test:mallocv  ->  passed  [0.069s]
usr.bin/diff/netbsd_diff_test:nomallocv  ->  passed  [0.070s]
usr.bin/diff/netbsd_diff_test:same  ->  passed  [0.071s]

Results file id is usr_tests.20200213-193818-429125
Results saved to /root/.kyua/store/results.usr_tests.20200213-193818-429125=
.db

13/13 passed (0 failed)
root@patch:/usr/tests #=20

There is another diff(1) patch I am working on [1] but I am reluctant to su=
bmit
more than one patch for the same source file at once.

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243975

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-243974-227-bKSyAHJ91h>