BUG #16050: Server crash on CREATE TEXT SEARCH DICTIONARY with a wrong AffFile

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: exclusion(at)gmail(dot)com
Subject: BUG #16050: Server crash on CREATE TEXT SEARCH DICTIONARY with a wrong AffFile
Date: 2019-10-11 15:05:38
Message-ID: 16050-024ae722464ab604@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16050
Logged by: Alexander Lakhin
Email address: exclusion(at)gmail(dot)com
PostgreSQL version: 12.0
Operating system: Ubuntu 18.04
Description:

The following query:
CREATE TEXT SEARCH DICTIONARY hunspell_num (Template=ispell,
DictFile=hunspell_sample_num, AffFile=hunspell_sample_long);

crashes postgres with the stack trace:
Core was generated by `postgres: law regression [local] CREATE TEXT SEARCH
DICTIONARY '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000056512c61b72e in getCompoundAffixFlagValue
(Conf=Conf(at)entry=0x56512e9d9f70, s=<optimized out>) at spell.c:1126
1126 while (*flagcur)
(gdb) bt
#0 0x000056512c61b72e in getCompoundAffixFlagValue
(Conf=Conf(at)entry=0x56512e9d9f70, s=<optimized out>) at spell.c:1126
#1 0x000056512c61c00b in makeCompoundFlags (Conf=Conf(at)entry=0x56512e9d9f70,
affix=<optimized out>) at spell.c:1608
#2 0x000056512c61c16e in mkSPNode (Conf=Conf(at)entry=0x56512e9d9f70,
low=low(at)entry=0, high=high(at)entry=1,
level=level(at)entry=3) at spell.c:1680
#3 0x000056512c61c22b in mkSPNode (Conf=Conf(at)entry=0x56512e9d9f70,
low=low(at)entry=0, high=high(at)entry=1,
level=level(at)entry=2) at spell.c:1692
#4 0x000056512c61c116 in mkSPNode (Conf=Conf(at)entry=0x56512e9d9f70,
low=low(at)entry=0, high=high(at)entry=4,
level=level(at)entry=1) at spell.c:1652
#5 0x000056512c61c116 in mkSPNode (Conf=Conf(at)entry=0x56512e9d9f70,
low=low(at)entry=0, high=9, level=level(at)entry=0)
at spell.c:1652
#6 0x000056512c61d9eb in NISortDictionary (Conf=Conf(at)entry=0x56512e9d9f70)
at spell.c:1785
#7 0x000056512c61936d in dispell_init (fcinfo=<optimized out>) at
dict_ispell.c:89
#8 0x000056512c73c7c9 in FunctionCall1Coll
(flinfo=flinfo(at)entry=0x7ffc6b41a860, collation=collation(at)entry=0,
arg1=arg1(at)entry=94906674394208) at fmgr.c:1140
#9 0x000056512c73cffb in OidFunctionCall1Coll
(functionId=functionId(at)entry=3731, collation=collation(at)entry=0,
arg1=94906674394208) at fmgr.c:1418
#10 0x000056512c46c88b in verify_dictoptions (tmplId=tmplId(at)entry=3733,
dictoptions=<optimized out>,
dictoptions(at)entry=0x56512e9d59e8) at tsearchcmds.c:402
#11 0x000056512c46e6b1 in DefineTSDictionary (names=<optimized out>,
parameters=<optimized out>) at tsearchcmds.c:463
#12 0x000056512c610c6d in ProcessUtilitySlow
(pstate=pstate(at)entry=0x56512e9d32f8, pstmt=pstmt(at)entry=0x56512e9b3a08,
queryString=queryString(at)entry=0x56512e9b2628 "CREATE TEXT SEARCH
DICTIONARY hunspell_num (Template=ispell, DictFile=hunspell_sample_num,
AffFile=hunspell_sample_long);",
context=context(at)entry=PROCESS_UTILITY_TOPLEVEL,
params=params(at)entry=0x0, queryEnv=queryEnv(at)entry=0x0,
dest=0x56512e9b3b00, completionTag=0x7ffc6b41af50 "")
at utility.c:1272
#13 0x000056512c61042e in standard_ProcessUtility (pstmt=0x56512e9b3a08,
queryString=0x56512e9b2628 "CREATE TEXT SEARCH DICTIONARY hunspell_num
(Template=ispell, DictFile=hunspell_sample_num,
AffFile=hunspell_sample_long);", context=PROCESS_UTILITY_TOPLEVEL,
params=0x0, queryEnv=0x0, dest=0x56512e9b3b00,
completionTag=0x7ffc6b41af50 "") at utility.c:927
#14 0x000056512c6104dc in ProcessUtility (pstmt=pstmt(at)entry=0x56512e9b3a08,
queryString=<optimized out>,
context=context(at)entry=PROCESS_UTILITY_TOPLEVEL, params=<optimized out>,
queryEnv=<optimized out>,
dest=dest(at)entry=0x56512e9b3b00, completionTag=0x7ffc6b41af50 "") at
utility.c:360
#15 0x000056512c60c983 in PortalRunUtility
(portal=portal(at)entry=0x56512ea198d8, pstmt=pstmt(at)entry=0x56512e9b3a08,
isTopLevel=isTopLevel(at)entry=true,
setHoldSnapshot=setHoldSnapshot(at)entry=false, dest=dest(at)entry=0x56512e9b3b00,

completionTag=completionTag(at)entry=0x7ffc6b41af50 "") at pquery.c:1175
#16 0x000056512c60d5d2 in PortalRunMulti
(portal=portal(at)entry=0x56512ea198d8, isTopLevel=isTopLevel(at)entry=true,
setHoldSnapshot=setHoldSnapshot(at)entry=false,
dest=dest(at)entry=0x56512e9b3b00, altdest=altdest(at)entry=0x56512e9b3b00,
completionTag=completionTag(at)entry=0x7ffc6b41af50 "") at pquery.c:1321
#17 0x000056512c60e342 in PortalRun (portal=portal(at)entry=0x56512ea198d8,
count=count(at)entry=9223372036854775807,
isTopLevel=isTopLevel(at)entry=true, run_once=run_once(at)entry=true,
dest=dest(at)entry=0x56512e9b3b00,
altdest=altdest(at)entry=0x56512e9b3b00, completionTag=0x7ffc6b41af50 "")
at pquery.c:796
#18 0x000056512c60a5f2 in exec_simple_query (
query_string=query_string(at)entry=0x56512e9b2628 "CREATE TEXT SEARCH
DICTIONARY hunspell_num (Template=ispell, DictFile=hunspell_sample_num,
AffFile=hunspell_sample_long);") at postgres.c:1215
#19 0x000056512c60c5c2 in PostgresMain (argc=<optimized out>,
argv=argv(at)entry=0x56512e9dd9d8, dbname=<optimized out>,
username=<optimized out>) at postgres.c:4236
#20 0x000056512c57ea53 in BackendRun (port=port(at)entry=0x56512e9d60b0) at
postmaster.c:4437
#21 0x000056512c581d19 in BackendStartup (port=port(at)entry=0x56512e9d60b0) at
postmaster.c:4128
#22 0x000056512c582030 in ServerLoop () at postmaster.c:1704
#23 0x000056512c583421 in PostmasterMain (argc=3, argv=<optimized out>) at
postmaster.c:1377
#24 0x000056512c4dec13 in main (argc=3, argv=0x56512e9aca00) at main.c:228

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Vondra 2019-10-11 17:27:39 Re: BUG #16050: Server crash on CREATE TEXT SEARCH DICTIONARY with a wrong AffFile
Previous Message Tom Lane 2019-10-11 14:36:54 Re: BUG #16049: log_line_prefix=%a and log_connections - application_name missing