Ticket #842: xapian_crash.heap_corruption.py

File xapian_crash.heap_corruption.py, 9.3 KB (added by veloman-yunkan, 3 days ago)
Line 
1#!/usr/bin/env python3
2
3stopwords = """'ll
4'tis
5'twas
6've
710
839
9a
10a's
11able
12ableabout
13about
14above
15abroad
16abst
17accordance
18according
19accordingly
20across
21act
22actually
23ad
24added
25adj
26adopted
27ae
28af
29affected
30affecting
31affects
32after
33afterwards
34ag
35again
36against
37ago
38ah
39ahead
40ai
41ain't
42aint
43al
44all
45allow
46allows
47almost
48alone
49along
50alongside
51already
52also
53although
54always
55am
56amid
57amidst
58among
59amongst
60amoungst
61amount
62an
63and
64announce
65another
66any
67anybody
68anyhow
69anymore
70anyone
71anything
72anyway
73anyways
74anywhere
75ao
76apart
77apparently
78appear
79appreciate
80appropriate
81approximately
82aq
83ar
84are
85area
86areas
87aren
88aren't
89arent
90arise
91around
92arpa
93as
94aside
95ask
96asked
97asking
98asks
99associated
100at
101au
102auth
103available
104aw
105away
106awfully
107az
108b
109ba
110back
111backed
112backing
113backs
114backward
115backwards
116bb
117bd
118be
119became
120because
121become
122becomes
123becoming
124been
125before
126beforehand
127began
128begin
129beginning
130beginnings
131begins
132behind
133being
134beings
135believe
136below
137beside
138besides
139best
140better
141between
142beyond
143bf
144bg
145bh
146bi
147big
148bill
149billion
150biol
151bj
152bm
153bn
154bo
155both
156bottom
157br
158brief
159briefly
160bs
161bt
162but
163buy
164bv
165bw
166by
167bz
168c
169c'mon
170c's
171ca
172call
173came
174can
175can't
176cannot
177cant
178caption
179case
180cases
181cause
182causes
183cc
184cd
185certain
186certainly
187cf
188cg
189ch
190changes
191ci
192ck
193cl
194clear
195clearly
196click
197cm
198cmon
199cn
200co
201co.
202com
203come
204comes
205computer
206con
207concerning
208consequently
209consider
210considering
211contain
212containing
213contains
214copy
215corresponding
216could
217could've
218couldn
219couldn't
220couldnt
221course
222cr
223cry
224cs
225cu
226currently
227cv
228cx
229cy
230cz
231d
232dare
233daren't
234darent
235date
236de
237dear
238definitely
239describe
240described
241despite
242detail
243did
244didn
245didn't
246didnt
247differ
248different
249differently
250directly
251dj
252dk
253dm
254do
255does
256doesn
257doesn't
258doesnt
259doing
260don
261don't
262done
263dont
264doubtful
265down
266downed
267downing
268downs
269downwards
270due
271during
272dz
273e
274each
275early
276ec
277ed
278edu
279ee
280effect
281eg
282eh
283eight
284eighty
285either
286eleven
287else
288elsewhere
289empty
290end
291ended
292ending
293ends
294enough
295entirely
296er
297es
298especially
299et
300et-al
301etc
302even
303evenly
304ever
305evermore
306every
307everybody
308everyone
309everything
310everywhere
311ex
312exactly
313example
314except
315f
316face
317faces
318fact
319facts
320fairly
321far
322farther
323felt
324few
325fewer
326ff
327fi
328fifteen
329fifth
330fifty
331fify
332fill
333find
334finds
335fire
336first
337five
338fix
339fj
340fk
341fm
342fo
343followed
344following
345follows
346for
347forever
348former
349formerly
350forth
351forty
352forward
353found
354four
355fr
356free
357from
358front
359full
360fully
361further
362furthered
363furthering
364furthermore
365furthers
366fx
367g
368ga
369gave
370gb
371gd
372ge
373general
374generally
375get
376gets
377getting
378gf
379gg
380gh
381gi
382give
383given
384gives
385giving
386gl
387gm
388gmt
389gn
390go
391goes
392going
393gone
394good
395goods
396got
397gotten
398gov
399gp
400gq
401gr
402great
403greater
404greatest
405greetings
406group
407grouped
408grouping
409groups
410gs
411gt
412gu
413gw
414gy
415h
416had
417hadn't
418hadnt
419half
420happens
421hardly
422has
423hasn
424hasn't
425hasnt
426have
427haven
428haven't
429havent
430having
431he
432he'd
433he'll
434he's
435hed
436hell
437hello
438help
439hence
440her
441here
442here's
443hereafter
444hereby
445herein
446heres
447hereupon
448hers
449herself
450herse”
451hes
452hi
453hid
454high
455higher
456highest
457him
458himself
459himse”
460his
461hither
462hk
463hm
464hn
465home
466homepage
467hopefully
468how
469how'd
470how'll
471how's
472howbeit
473however
474hr
475ht
476htm
477html
478http
479hu
480hundred
481i
482i'd
483i'll
484i'm
485i've
486i.e.
487id
488ie
489if
490ignored
491ii
492il
493ill
494im
495immediate
496immediately
497importance
498important
499in
500inasmuch
501inc
502inc.
503indeed
504index
505indicate
506indicated
507indicates
508information
509inner
510inside
511insofar
512instead
513int
514interest
515interested
516interesting
517interests
518into
519invention
520inward
521io
522iq
523ir
524is
525isn
526isn't
527isnt
528it
529it'd
530it'll
531it's
532itd
533itll
534its
535itself
536itse”
537ive
538j
539je
540jm
541jo
542join
543jp
544just
545k
546ke
547keep
548keeps
549kept
550keys
551kg
552kh
553ki
554kind
555km
556kn
557knew
558know
559known
560knows
561kp
562kr
563kw
564ky
565kz
566l
567la
568large
569largely
570last
571lately
572later
573latest
574latter
575latterly
576lb
577lc
578least
579length
580less
581lest
582let
583let's
584lets
585li
586like
587liked
588likely
589likewise
590line
591little
592lk
593ll
594long
595longer
596longest
597look
598looking
599looks
600low
601lower
602lr
603ls
604lt
605ltd
606lu
607lv
608ly
609m
610ma
611made
612mainly
613make
614makes
615making
616man
617many
618may
619maybe
620mayn't
621maynt
622mc
623md
624me
625mean
626means
627meantime
628meanwhile
629member
630members
631men
632merely
633mg
634mh
635microsoft
636might
637might've
638mightn't
639mightnt
640mil
641mill
642million
643mine
644minus
645miss
646mk
647ml
648mm
649mn
650mo
651more
652moreover
653most
654mostly
655move
656mp
657mq
658mr
659mrs
660ms
661msie
662mt
663mu
664much
665mug
666must
667must've
668mustn't
669mustnt
670mv
671mw
672mx
673my
674myself
675myse”
676mz
677n
678na
679name
680namely
681nay
682nc
683nd
684ne
685near
686nearly
687necessarily
688necessary
689need
690needed
691needing
692needn't
693neednt
694needs
695neither
696net
697netscape
698never
699neverf
700neverless
701nevertheless
702new
703newer
704newest
705next
706nf
707ng
708ni
709nine
710ninety
711nl
712no
713no-one
714nobody
715non
716none
717nonetheless
718noone
719nor
720normally
721nos
722not
723noted
724nothing
725notwithstanding
726novel
727now
728nowhere
729np
730nr
731nu
732null
733number
734numbers
735nz
736o
737obtain
738obtained
739obviously
740of
741off
742often
743oh
744ok
745okay
746old
747older
748oldest
749om
750omitted
751on
752once
753one
754one's
755ones
756only
757onto
758open
759opened
760opening
761opens
762opposite
763or
764ord
765order
766ordered
767ordering
768orders
769org
770other
771others
772otherwise
773ought
774oughtn't
775oughtnt
776our
777ours
778ourselves
779out
780outside
781over
782overall
783owing
784own
785p
786pa
787page
788pages
789part
790parted
791particular
792particularly
793parting
794parts
795past
796pe
797per
798perhaps
799pf
800pg
801ph
802pk
803pl
804place
805placed
806places
807please
808plus
809pm
810pmid
811pn
812point
813pointed
814pointing
815points
816poorly
817possible
818possibly
819potentially
820pp
821pr
822predominantly
823present
824presented
825presenting
826presents
827presumably
828previously
829primarily
830probably
831problem
832problems
833promptly
834proud
835provided
836provides
837pt
838put
839puts
840pw
841py
842q
843qa
844que
845quickly
846quite
847qv
848r
849ran
850rather
851rd
852re
853readily
854really
855reasonably
856recent
857recently
858ref
859refs
860regarding
861regardless
862regards
863related
864relatively
865research
866reserved
867respectively
868resulted
869resulting
870results
871right
872ring
873ro
874room
875rooms
876round
877ru
878run
879rw
880s
881sa
882said
883same
884saw
885say
886saying
887says
888sb
889sc
890sd
891se
892sec
893second
894secondly
895seconds
896section
897see
898seeing
899seem
900seemed
901seeming
902seems
903seen
904sees
905self
906selves
907sensible
908sent
909serious
910seriously
911seven
912seventy
913several
914sg
915sh
916shall
917shan't
918shant
919she
920she'd
921she'll
922she's
923shed
924shell
925shes
926should
927should've
928shouldn
929shouldn't
930shouldnt
931show
932showed
933showing
934shown
935showns
936shows
937si
938side
939sides
940significant
941significantly
942similar
943similarly
944since
945sincere
946site
947six
948sixty
949sj
950sk
951sl
952slightly
953sm
954small
955smaller
956smallest
957sn
958so
959some
960somebody
961someday
962somehow
963someone
964somethan
965something
966sometime
967sometimes
968somewhat
969somewhere
970soon
971sorry
972specifically
973specified
974specify
975specifying
976sr
977st
978state
979states
980still
981stop
982strongly
983su
984sub
985substantially
986successfully
987such
988sufficiently
989suggest
990sup
991sure
992sv
993sy
994system
995sz
996t
997t's
998take
999taken
1000taking
1001tc
1002td
1003tell
1004ten
1005tends
1006test
1007text
1008tf
1009tg
1010th
1011than
1012thank
1013thanks
1014thanx
1015that
1016that'll
1017that's
1018that've
1019thatll
1020thats
1021thatve
1022the
1023their
1024theirs
1025them
1026themselves
1027then
1028thence
1029there
1030there'd
1031there'll
1032there're
1033there's
1034there've
1035thereafter
1036thereby
1037thered
1038therefore
1039therein
1040therell
1041thereof
1042therere
1043theres
1044thereto
1045thereupon
1046thereve
1047these
1048they
1049they'd
1050they'll
1051they're
1052they've
1053theyd
1054theyll
1055theyre
1056theyve
1057thick
1058thin
1059thing
1060things
1061think
1062thinks
1063third
1064thirty
1065this
1066thorough
1067thoroughly
1068those
1069thou
1070though
1071thoughh
1072thought
1073thoughts
1074thousand
1075three
1076throug
1077through
1078throughout
1079thru
1080thus
1081til
1082till
1083tip
1084tis
1085tj
1086tk
1087tm
1088tn
1089to
1090today
1091together
1092too
1093took
1094top
1095toward
1096towards
1097tp
1098tr
1099tried
1100tries
1101trillion
1102truly
1103try
1104trying
1105ts
1106tt
1107turn
1108turned
1109turning
1110turns
1111tv
1112tw
1113twas
1114twelve
1115twenty
1116twice
1117two
1118tz
1119u
1120ua
1121ug
1122uk
1123um
1124un
1125under
1126underneath
1127undoing
1128unfortunately
1129unless
1130unlike
1131unlikely
1132until
1133unto
1134up
1135upon
1136ups
1137upwards
1138us
1139use
1140used
1141useful
1142usefully
1143usefulness
1144uses
1145using
1146usually
1147uucp
1148uy
1149uz
1150v
1151va
1152value
1153various
1154vc
1155ve
1156versus
1157very
1158vg
1159vi
1160via
1161viz
1162vn
1163vol
1164vols
1165vs
1166vu
1167w
1168want
1169wanted
1170wanting
1171wants
1172was
1173wasn
1174wasn't
1175wasnt
1176way
1177ways
1178we
1179we'd
1180we'll
1181we're
1182we've
1183web
1184webpage
1185website
1186wed
1187welcome
1188well
1189wells
1190went
1191were
1192weren
1193weren't
1194werent
1195weve
1196wf
1197what
1198what'd
1199what'll
1200what's
1201what've
1202whatever
1203whatll
1204whats
1205whatve
1206when
1207when'd
1208when'll
1209when's
1210whence
1211whenever
1212where
1213where'd
1214where'll
1215where's
1216whereafter
1217whereas
1218whereby
1219wherein
1220wheres
1221whereupon
1222wherever
1223whether
1224which
1225whichever
1226while
1227whilst
1228whim
1229whither
1230who
1231who'd
1232who'll
1233who's
1234whod
1235whoever
1236whole
1237wholl
1238whom
1239whomever
1240whos
1241whose
1242why
1243why'd
1244why'll
1245why's
1246widely
1247width
1248will
1249willing
1250wish
1251with
1252within
1253without
1254won
1255won't
1256wonder
1257wont
1258words
1259work
1260worked
1261working
1262works
1263world
1264would
1265would've
1266wouldn
1267wouldn't
1268wouldnt
1269ws
1270www
1271x
1272y
1273ye
1274year
1275years
1276yes
1277yet
1278you
1279you'd
1280you'll
1281you're
1282you've
1283youd
1284youll
1285young
1286younger
1287youngest
1288your
1289youre
1290yours
1291yourself
1292yourselves
1293youve
1294yt
1295yu
1296z
1297za
1298zero
1299zm
1300zr
1301"""
1302
1303import xapian
1304db = xapian.WritableDatabase("test.xapiandb.tmp", xapian.DB_CREATE_OR_OVERWRITE | xapian.DB_NO_TERMLIST)
1305db.set_metadata("valuesmap", "title:0;targetPath:1")
1306db.set_metadata("kind", "title")
1307db.set_metadata("data", "fullPath")
1308db.set_metadata("language", "en")
1309db.set_metadata("stopwords", stopwords)
1310stemmer = xapian.Stem("en")
1311indexer = xapian.TermGenerator()
1312indexer.set_max_word_length(240)
1313indexer.set_flags(indexer.FLAG_CJK_NGRAM)
1314indexer.set_stemmer(stemmer)
1315indexer.set_stemming_strategy(indexer.STEM_SOME)
1316doc = xapian.Document()
1317doc.clear_values()
1318doc.set_data("C/p")
1319indexer.set_document(doc)
1320doc.add_value(0, "awordthatis240characterslonggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg awordthatis240characterslonggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg")
1321doc.add_value(1, "p")
1322indexer.index_text("0posanchor awordthatis240characterslonggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg awordthatis240characterslonggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg", 1)
1323db.add_document(doc)
1324db.commit()
1325db.compact("test.xapiandb", xapian.DBCOMPACT_SINGLE_FILE|xapian.Compactor.FULLER)
1326db.close()