xxdiff segfaults when reading large files

Bug #1840163 reported by Steve Dum
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xxdiff (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have a very large genealogy database (almost 2 million lines) and I use xxdiff to look at changes. The lastest update now crashes when loading the file. For privacy reasons the actual file is not being supplied - and it's very big! However, here is a script that reproduces the problem.

run the following script, say in /tmp or other directory - it generates a semi random file
and then diff's it against a copy of it self. a few seconds after starting xxdiff it dies
 /usr/bin/xxdiff f1 f2
 9357 segmentation fault (core dumped) /usr/bin/xxdiff f1 f2
/usr/bin/xxdiff f1 f2: 0.85s real 0.56s user 0.19s system 89%

warning script will remove and then recreate files named f1 and f2.

#!/bin/bash

rm -f f1 f2
chars=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ9abcdefghijklmnopqrstuvwxyz
chars1=" 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ9 abcdefghijklmnopqrstuvwxyz"

line=1
for (( j=0 ; j < 1700 ; )) do
    for (( i=0 ; i<1000 ; i++ )) ; do
        (( r = RANDOM % 100 + 1 ))
        a="${chars:RANDOM%${#chars}:3}"
        b="${chars:RANDOM%${#chars}:5}"
        c="${chars1:RANDOM%${#chars1}:$r}"
        echo "$cnt $a $b $c" >> f1
        (( cnt++ ))
        (( line++ ))
    done
    (( j++ ))
done
set -x
cp f1 f2
/usr/bin/xxdiff f1 f2

ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: xxdiff 1:4.0.1+hg487+dfsg-1
ProcVersionSignature: Ubuntu 5.0.0-25.26-generic 5.0.18
Uname: Linux 5.0.0-25-generic x86_64
ApportVersion: 2.20.10-0ubuntu27.1
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Aug 14 08:52:01 2019
InstallationDate: Installed on 2018-02-26 (533 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20180105.1)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/usr/bin/zsh
SourcePackage: xxdiff
UpgradeStatus: Upgraded to disco on 2019-04-19 (117 days ago)

Revision history for this message
Steve Dum (dr-doom) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.