pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: PoC/WIP: Extended statistics on expressions
Date: Wed, 24 Mar 2021 09:54:22 +0100
Message-ID: <b8359875-b91f-ff48-4c6c-9b3c1c35d880@enterprisedb.com> (raw)
In-Reply-To: <20210324081402.GB28335@telsasoft.com>
References: <1913c1fe-13da-7250-adf4-befeda397536@enterprisedb.com>
	<CAEZATCUooH7uPsPkMJEyf-KY_3Om7TTVo7Fo31JiXXgGCb=97g@mail.gmail.com>
	<f0f7e00c-7ccb-9412-0147-a06a60777f06@enterprisedb.com>
	<CAEZATCWF66BWJq-OwLuP5LGK6W9LDYxCQwLxqB36qmq3b1Ch8Q@mail.gmail.com>
	<f4dac079-6bc4-ccc0-0fd8-3e2e2da28d92@enterprisedb.com>
	<CAEZATCXz2WO9ZctRL68_HrsPbpre0GRmip83TgznoeLoWm4=Dg@mail.gmail.com>
	<CAEZATCXcX0gm2LMb+xObroS-C+a5FXEqgR5RgQ9NWKjPC=9sNA@mail.gmail.com>
	<ce50ee26-7135-c435-cae8-073ad59eba60@enterprisedb.com>
	<CAEZATCWgZPJGbj2ndXsoD6_MuJ=H1Y-gdTMdkE=n1VsA6WX+RA@mail.gmail.com>
	<9f6654b1-ca31-f979-0fe8-137683818273@enterprisedb.com>
	<20210324081402.GB28335@telsasoft.com>

Hi Justin,

Unfortunately the query is incomplete, so I can't quite determine what
went wrong. Can you extract the full query causing the crash, either
from the server log or from a core file?

thanks

On 3/24/21 9:14 AM, Justin Pryzby wrote:
> I got this crash running sqlsmith:
> 
> #1  0x00007f907574b801 in __GI_abort () at abort.c:79
> #2  0x00005646b95a35f8 in ExceptionalCondition (conditionName=conditionName@entry=0x5646b97411db "bms_num_members(varnos) == 1", errorType=errorType@entry=0x5646b95fa00b "FailedAssertion", 
>     fileName=fileName@entry=0x5646b9739dbe "selfuncs.c", lineNumber=lineNumber@entry=3332) at assert.c:69
> #3  0x00005646b955c9a1 in add_unique_group_expr (vars=0x5646bbd9e200, expr=0x5646b9eb0c30, exprinfos=0x5646bbd9e100, root=0x5646ba9a0cb0) at selfuncs.c:3332
> #4  add_unique_group_expr (root=0x5646ba9a0cb0, exprinfos=0x5646bbd9e100, expr=0x5646b9eb0c30, vars=0x5646bbd9e200) at selfuncs.c:3307
> #5  0x00005646b955d560 in estimate_num_groups () at selfuncs.c:3558
> #6  0x00005646b93ad004 in create_distinct_paths (input_rel=<optimized out>, root=0x5646ba9a0cb0) at planner.c:4808
> #7  grouping_planner () at planner.c:2238
> #8  0x00005646b93ae0ef in subquery_planner (glob=glob@entry=0x5646ba9a0b98, parse=parse@entry=0x5646ba905d80, parent_root=parent_root@entry=0x0, hasRecursion=hasRecursion@entry=false, tuple_fraction=tuple_fraction@entry=0)
>     at planner.c:1024
> #9  0x00005646b93af543 in standard_planner (parse=0x5646ba905d80, query_string=<optimized out>, cursorOptions=256, boundParams=<optimized out>) at planner.c:404
> #10 0x00005646b94873ac in pg_plan_query (querytree=0x5646ba905d80, 
>     query_string=0x5646b9cd87e0 "select distinct \n  \n    pg_catalog.variance(\n      cast(pg_catalog.pg_stat_get_bgwriter_timed_checkpoints() as int8)) over (partition by subq_0.c2 order by subq_0.c0) as c0, \n  subq_0.c2 as c1, \n  sub"..., cursorOptions=256, boundParams=0x0) at postgres.c:821
> #11 0x00005646b94874a1 in pg_plan_queries (querytrees=0x5646baaba250, 
>     query_string=query_string@entry=0x5646b9cd87e0 "select distinct \n  \n    pg_catalog.variance(\n      cast(pg_catalog.pg_stat_get_bgwriter_timed_checkpoints() as int8)) over (partition by subq_0.c2 order by subq_0.c0) as c0, \n  subq_0.c2 as c1, \n  sub"..., cursorOptions=cursorOptions@entry=256, boundParams=boundParams@entry=0x0) at postgres.c:912
> #12 0x00005646b9487888 in exec_simple_query () at postgres.c:1104
> 
> 2021-03-24 03:06:12.489 CDT postmaster[11653] LOG:  server process (PID 11696) was terminated by signal 6: Aborted
> 2021-03-24 03:06:12.489 CDT postmaster[11653] DETAIL:  Failed process was running: select distinct 
>           
>             pg_catalog.variance(
>               cast(pg_catalog.pg_stat_get_bgwriter_timed_checkpoints() as int8)) over (partition by subq_0.c2 order by subq_0.c0) as c0, 
>           subq_0.c2 as c1, 
>           subq_0.c0 as c2, 
>           subq_0.c2 as c3, 
>           subq_0.c1 as c4, 
>           subq_0.c1 as c5, 
>           subq_0.c0 as c6
>         from 
>           (select  
>                 ref_1.foreign_server_catalog as c0, 
>                 ref_1.authorization_identifier as c1, 
>                 sample_2.tgname as c2, 
>                 ref_1.foreign_server_catalog as c3
>               from 
>                 pg_catalog.pg_stat_database_conflicts as ref_0
>                         left join information_schema._pg_user_mappings as ref_1
>                         on (ref_0.datname < ref_0.datname)
>                       inner join pg_catalog.pg_amproc as sample_0 tablesample system (5) 
>                       on (cast(null as uuid) < cast(null as uuid))
>                     left join pg_catalog.pg_aggregate as sample_1 tablesample system (2.9) 
>                     on (sample_0.amprocnum = sample_1.aggnumdirectargs )
>                   inner join pg_catalog.pg_trigger as sample_2 tablesampl
> 

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (107+ messages)  latest in thread

Message-ID: <b8359875-b91f-ff48-4c6c-9b3c1c35d880@enterprisedb.com>
Permalink:  ../b8359875-b91f-ff48-4c6c-9b3c1c35d880@enterprisedb.com/
Also on:    postgresql.org/message-id/b8359875-b91f-ff48-4c6c-9b3c1c35d880@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, pryzby@telsasoft.com, dean.a.rasheed@gmail.com
  Subject: Re: PoC/WIP: Extended statistics on expressions
  In-Reply-To: <b8359875-b91f-ff48-4c6c-9b3c1c35d880@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox