Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL][PostGIS] Segmentation fault in ST_ShapeGrid() #11325

Open
def- opened this issue Feb 2, 2022 · 2 comments
Open

[YSQL][PostGIS] Segmentation fault in ST_ShapeGrid() #11325

def- opened this issue Feb 2, 2022 · 2 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@def-
Copy link
Contributor

def- commented Feb 2, 2022

Jira Link: DB-775

Description

See https://docs.yugabyte.com/latest/api/ysql/extensions/#postgis for PostGIS installation instructions.

Can be reproduced against yugabyte-2.11.2.0 on CentOS using https://github.com/def-/postgis/tree/stable-3.1/regress by running PATH=$CWD/bin/:$PATH ./run_test.pl core/regress.sql

tserver log:

2022-02-01 09:36:39.751 UTC [4020] LOG:  server process (PID 6631) was terminated by signal 11: Segmentation fault
2022-02-01 09:36:39.751 UTC [4020] DETAIL:  Failed process was running: select '308', Count(*) FROM ST_HexagonGrid(100000, ST_TileEnvelope(4, 7, 7));

backtrace from gdb:

#0  HeapTupleHeaderGetDatum (tuple=0x0) at ../../../../../../src/postgres/src/backend/executor/execTuples.c:1385
#1  0x00007fa9576bc732 in ST_ShapeGrid () from /nfusr/dev-server/dfelsing/yugabyte-2.11.2.0/postgres/lib/postgis-3.so
#2  0x00000000006da32c in ExecMakeTableFunctionResult (setexpr=0x3b3e9a0, econtext=0x3b3e8a0, argContext=<optimized out>, expectedDesc=0x3b6e248, randomAccess=false)
    at ../../../../../../src/postgres/src/backend/executor/execSRF.c:231
#3  0x00000000006e9a60 in FunctionNext (node=node@entry=0x3b3e790) at ../../../../../../src/postgres/src/backend/executor/nodeFunctionscan.c:94
#4  0x00000000006d95d1 in ExecScanFetch (recheckMtd=0x6e9770 <FunctionRecheck>, accessMtd=0x6e97a0 <FunctionNext>, node=0x3b3e790) at ../../../../../../src/postgres/src/backend/executor/execScan.c:95
#5  ExecScan (node=0x3b3e790, accessMtd=0x6e97a0 <FunctionNext>, recheckMtd=0x6e9770 <FunctionRecheck>) at ../../../../../../src/postgres/src/backend/executor/execScan.c:145
#6  0x00000000006e3ea4 in ExecProcNode (node=0x3b3e790) at ../../../../../../src/postgres/src/include/executor/executor.h:249
#7  fetch_input_tuple (aggstate=0x3b3e328) at ../../../../../../src/postgres/src/backend/executor/nodeAgg.c:411
#8  agg_retrieve_direct (aggstate=0x3b3e328) at ../../../../../../src/postgres/src/backend/executor/nodeAgg.c:2017
#9  ExecAgg (pstate=0x3b3e328) at ../../../../../../src/postgres/src/backend/executor/nodeAgg.c:1766
#10 0x00000000006ce5db in ExecProcNode (node=0x3b3e328) at ../../../../../../src/postgres/src/include/executor/executor.h:249
#11 ExecutePlan (execute_once=<optimized out>, dest=0x3966c78, direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>, operation=CMD_SELECT, use_parallel_mode=<optimized out>, planstate=0x3b3e328,
    estate=0x3b3e118) at ../../../../../../src/postgres/src/backend/executor/execMain.c:1730
#12 standard_ExecutorRun (queryDesc=0x335f118, direction=<optimized out>, count=0, execute_once=<optimized out>) at ../../../../../../src/postgres/src/backend/executor/execMain.c:367
#13 0x00007fa96624d8bd in pgss_ExecutorRun (queryDesc=0x335f118, direction=ForwardScanDirection, count=0, execute_once=<optimized out>)
    at ../../../../../src/postgres/contrib/pg_stat_statements/pg_stat_statements.c:947
#14 0x00007fa9660463aa in ybpgm_ExecutorRun (queryDesc=0x335f118, direction=ForwardScanDirection, count=0, execute_once=<optimized out>) at ../../../../../src/postgres/contrib/yb_pg_metrics/yb_pg_metrics.c:499
#15 0x000000000088564b in PortalRunSelect (portal=portal@entry=0x365e118, forward=forward@entry=true, count=0, count@entry=9223372036854775807, dest=dest@entry=0x3966c78)
    at ../../../../../../src/postgres/src/backend/tcop/pquery.c:955
#16 0x0000000000887141 in PortalRun (portal=portal@entry=0x365e118, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x3966c78,
    altdest=altdest@entry=0x3966c78, completionTag=0x7ffc0fa760e0 "") at ../../../../../../src/postgres/src/backend/tcop/pquery.c:784
#17 0x0000000000884ad8 in exec_simple_query (query_string=0x358a118 "select '308', Count(*) FROM ST_HexagonGrid(100000, ST_TileEnvelope(4, 7, 7));", query_string@entry=0x7ffc0fa76060 "\030\341e\003")
    at ../../../../../../src/postgres/src/backend/tcop/postgres.c:1161
#18 yb_exec_simple_query_impl (query_string=query_string@entry=0x358a118) at ../../../../../../src/postgres/src/backend/tcop/postgres.c:4434
#19 0x000000000087f8b8 in yb_exec_query_wrapper (exec_context=exec_context@entry=0x358a000, restart_data=restart_data@entry=0x7ffc0fa762b0, functor=functor@entry=0x884620 <yb_exec_simple_query_impl>,
    functor_context=functor_context@entry=0x358a118) at ../../../../../../src/postgres/src/backend/tcop/postgres.c:4419
#20 0x00000000008802ec in yb_exec_simple_query (query_string=query_string@entry=0x358a118 "select '308', Count(*) FROM ST_HexagonGrid(100000, ST_TileEnvelope(4, 7, 7));",
    exec_context=exec_context@entry=0x358a000) at ../../../../../../src/postgres/src/backend/tcop/postgres.c:4449
#21 0x0000000000882213 in PostgresMain (argc=<optimized out>, argv=argv@entry=0x35cd6d8, dbname=0x35cd5b8 "postgis_reg", username=0x3585fe8 "yugabyte")
    at ../../../../../../src/postgres/src/backend/tcop/postgres.c:5084
#22 0x000000000049e292 in BackendRun (port=0x3474960) at ../../../../../../src/postgres/src/backend/postmaster/postmaster.c:4470
#23 BackendStartup (port=0x3474960) at ../../../../../../src/postgres/src/backend/postmaster/postmaster.c:4136
#24 ServerLoop () at ../../../../../../src/postgres/src/backend/postmaster/postmaster.c:1754
#25 0x00000000007ea21f in PostmasterMain (argc=argc@entry=23, argv=argv@entry=0x334e000) at ../../../../../../src/postgres/src/backend/postmaster/postmaster.c:1417
#26 0x000000000073588a in PostgresServerProcessMain (argc=23, argv=0x334e000) at ../../../../../../src/postgres/src/backend/main/main.c:234
#27 0x0000000000735a89 in main ()

Coredump: core.6631.zip

@def- def- added kind/bug This issue is a bug area/ysql Yugabyte SQL (YSQL) labels Feb 2, 2022
@def- def- changed the title [YSQL][Postgis] Segmentation fault in ST_ShapeGrid() [YSQL][PostGIS] Segmentation fault in ST_ShapeGrid() Feb 2, 2022
@andrei-mart
Copy link
Contributor

Can not reproduce

yugabyte=# select '308', Count(*) FROM ST_HexagonGrid(100000, ST_TileEnvelope(4, 7, 7));
 ?column? | count 
----------+-------
 308      |   270
(1 row)

also see #11318 (comment)

@def-
Copy link
Contributor Author

def- commented Feb 17, 2022

See my comment for full instructions: #11318 (comment)
Can still reproduce with:

$ PATH=$PWD/bin:/usr/pgsql-11/bin:$PATH POSTGIS_SCRIPTDIR=/usr/pgsql-11/share/contrib/postgis-3.1 ./run_test.pl core/regress.sql

@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label Jun 8, 2022
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature and removed kind/bug This issue is a bug labels Aug 22, 2022
@kripasreenivasan kripasreenivasan added qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures and removed qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures labels Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

5 participants