Bug#753249: an: Segfaults with Dutch word list

2014-07-01 Thread Paul Martin
On Sun, Jun 29, 2014 at 09:01:05PM +0200, Peter De Wachter wrote:

> an crashes when using the Dutch word list:
> 
> $ an -d /usr/share/dict/dutch anagram
> anagram
> maraan g
> Segmentation fault

I've been able to reproduce. It's a function recursing without limit.

#0  0x755b4095 in _int_malloc (
av=av@entry=0x758dd620 , bytes=bytes@entry=16)
at malloc.c:3790
#1  0x755b6bdc in __libc_calloc (n=,
elem_size=) at malloc.c:3219
#2  0x004019a9 in safe_calloc (nmemb=nmemb@entry=16, size=size@entry=1)
at malloc.c:29
#3  0x004017b6 in bf_subtract (a=0xfa08d0, b=0x607e90)
at bitfield.c:109
#4  0x00401472 in find_anagrams (words=0x607e70, stack=0xfa08f0,
bits=0xfa08d0, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:55
#5  0x0040148f in find_anagrams (words=0x607e70, stack=0xfa0890,
bits=0xfa0870, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#6  0x0040148f in find_anagrams (words=0x607e70, stack=0xfa0830,
bits=0xfa0810, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#7  0x0040148f in find_anagrams (words=0x607e70, stack=0xfa07d0,
bits=0xfa07b0, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#8  0x0040148f in find_anagrams (words=0x607e70, stack=0xfa0770,
bits=0xfa0750, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#9  0x0040148f in find_anagrams (words=0x607e70, stack=0xfa0710,
bits=0xfa06f0, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#10 0x0040148f in find_anagrams (words=0x607e70, stack=0xfa06b0,
bits=0xfa0690, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#11 0x0040148f in find_anagrams (words=0x607e70, stack=0xfa0650,
bits=0xfa0630, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#12 0x0040148f in find_anagrams (words=0x607e70, stack=0xfa05f0,
bits=0xfa05d0, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#13 0x0040148f in find_anagrams (words=0x607e70, stack=0xfa0590,
bits=0xfa0570, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#14 0x0040148f in find_anagrams (words=0x607e70, stack=0xfa0530,
bits=0xfa0510, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56
#15 0x0040148f in find_anagrams (words=0x607e70, stack=0xfa04d0,
bits=0xfa04b0, maxwords=0, length=1, maxtotal=0x7fffe4a0) at an.c:56

It seems to be caused by the bogus "word" 06 here:

pioniersschop
paardzet
poppenkind
poppenkasterij
privégedrag
pottenbakkersdraaischijf
potroos
's
06
1e
2e
4wd
AAW
ABU
AM
AMAR

This dictionary looks to be of very low quality in places with many
bogus entries:

Artesiër
Arthur
Arthur Conan Doyle
Arwin
As

Axelaar
Axels
Ayaan Hirsi Ali
Ayatollah Khomeini
Ayers Rock
Azerbeidzjaan

Bart
Bartina
Bartolomeüs
Baruch de Spinoza
Bas
Bas-Congo
Base
Basel

Bussums
Buvingen
Byzantium
C
C++
CBS
CDA
CIA
CO₂-emissie
CWI
Caesar

Chalcidice
Chantal
Chaplin
Charkov
Charleroi
Charles
Charles Darwin
Charles Dickens
Charles Lindbergh
Charles de Gaulle
Charlie Chaplin
Charlois
Charlotte
Charlotte Amalie
Che Guevara

verassend
verassende
marcje
lost generations
marctje
plats du jour
stede
arnhemmer


As "06" contains no letters, it's causing an infinite recursion when
it's used.

-- 
Paul Martin 


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#753249: an: Segfaults with Dutch word list

2014-06-29 Thread Peter De Wachter
Package: an
Version: 1.1-1+b1
Severity: normal

Dear Maintainer,

an crashes when using the Dutch word list:

$ an -d /usr/share/dict/dutch anagram
anagram
maraan g
Segmentation fault


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages an depends on:
ii  libc6 2.19-4
ii  libicu52  52.1-4

Versions of packages an recommends:
ii  wamerican [wordlist]  7.1-1
ii  wbritish [wordlist]   7.1-1
ii  wdutch [wordlist] 1:2.10-1

an suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org