Bug 13659

Summary: "stack smashing detected", when Zebra indexing a subfield with a very long (1000+) word
Product: Koha Reporter: Olli-Antti Kivilahti <olli-antti.kivilahti>
Component: SearchingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED WORKSFORME QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13660
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 13661    

Description Olli-Antti Kivilahti 2015-02-03 11:38:14 UTC
I encountered this when migrating another library group to Koha:

*** stack smashing detected ***: /usr/bin/zebraidx terminated

After a long search using the rebuild_zebra_sliced.sh I managed to isolate the culprit to a MARCXML Record with a subfield consisting of a single word with a length of ~1000 characters.

A fix for this issue is to sanitate the marc-records to not contain such silly words.
Comment 1 Olli-Antti Kivilahti 2015-02-03 11:42:51 UTC
A word of warning.
Anyone with Cataloguing-permission can nuke Koha-indexing with this subfield content:
"TÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄLTÄÄL"

Having a word like this in your DB will make full reindexing a PITA.