[ 
https://issues.apache.org/jira/browse/HAWQ-218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ruilong Huo updated HAWQ-218:
-----------------------------
    Description: 
HAWQ core dumps while calling UDF with EXPLAIN statement in it.

Reproduction steps:

Step 1: prepare schema and data
{noformat}
create table foo(a int, b int, c int) partition by range (b) (start (1) end 
(101) every (10));

insert into foo select generate_series(1,5), generate_series(1,100), 
generate_series(1,10);

analyze foo;
{noformat}

Step 2: run query
{noformat}
gptest=# select * from foo where b = 150;
FATAL:  Unexpected internal error (dispatcher.c:456)
DETAIL:  FailedAssertion("!(resource)", File: "dispatcher.c", Line: 456)
HINT:  Process 29088 will wait for gp_debug_linger=120 seconds before 
termination.
Note that its locks and other resources will not be released until then.
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
{noformat}

Step 3: call stack in core dump
{noformat}
(gdb) bt
#0  0x00000038cbe32625 in raise () from /lib64/libc.so.6
#1  0x00000038cbe33e05 in abort () from /lib64/libc.so.6
#2  0x00000000009dc10c in ExceptionalCondition (conditionName=0xe06c0e 
"!(resource)", errorType=0xe06be3 "FailedAssertion", fileName=0xe06bc0 
"dispatcher.c", lineNumber=456) at assert.c:60
#3  0x0000000000b82260 in initialize_dispatch_data (resource=0x0, 
dispatch_to_all_cached_executors=0 '\000') at dispatcher.c:456
#4  0x000000000071ac23 in ExecutorStart (queryDesc=0x28b5460, eflags=0) at 
execMain.c:908
#5  0x00000000008ff7df in PortalStart (portal=0x28d3498, params=0x0, 
snapshot=0x0, seqServerHost=0x0, seqServerPort=-1) at pquery.c:1222
#6  0x00000000008f5e76 in exec_simple_query (query_string=0x26b0198 "select * 
from foo where b = 150;", seqServerHost=0x0, seqServerPort=-1) at 
postgres.c:1680
#7  0x00000000008fab80 in PostgresMain (argc=4, argv=0x25fac28, 
username=0x25faa80 "gpadmin") at postgres.c:4688
#8  0x00000000008a0ec3 in BackendRun (port=0x25adc80) at postmaster.c:5834
#9  0x00000000008a034d in BackendStartup (port=0x25adc80) at postmaster.c:5427
#10 0x000000000089a9d9 in ServerLoop () at postmaster.c:2129
#11 0x0000000000899a9c in PostmasterMain (argc=9, argv=0x25c4940) at 
postmaster.c:1421
#12 0x00000000007b3472 in main (argc=9, argv=0x25c4940) at main.c:226
{noformat}

  was:
HAWQ core dumps while calling UDF with EXPLAIN statement in it.

Reproduction steps:

Step 1: prepare schema and data
{noformat}
create table foo(a int, b int, c int) partition by range (b) (start (1) end 
(101) every (10));

insert into foo select generate_series(1,5), generate_series(1,100), 
generate_series(1,10);

analyze foo;
{noformat}

Step 2: run query
{noformat}
select get_selected_parts('explain select * from foo where b = 150;');
 get_selected_parts
--------------------
 [0, 10]
(1 row)

select * from foo where b = 150;
psql:/data/gpadmin/pulse2-agent/agents/agent1/work/HAWQ-main-TINC-QUERY-LDAP/TINC/cdbunit/tincrepo/partitioning/staticselection/output/static_selection_6_orca.sql:18:
 server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
psql:/data/gpadmin/pulse2-agent/agents/agent1/work/HAWQ-main-TINC-QUERY-LDAP/TINC/cdbunit/tincrepo/partitioning/staticselection/output/static_selection_6_orca.sql:18:
 connection to server was lost
{noformat}

Step 3: call stack in core dump
{noformat}
Core was generated by `postgres: port 30000, gpadmin gptest [local] con410 cmd6 
SELECT [local]       '.
Program terminated with signal 11, Segmentation fault.
#0  0x0000003c1ec0f5db in raise () from /lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install 
hawq-2.0.0.0_beta-18756.x86_64
(gdb) bt
#0  0x0000003c1ec0f5db in raise () from /lib64/libpthread.so.0
#1  0x0000000000875e62 in SafeHandlerForSegvBusIll (processName=<value 
optimized out>, postgres_signal_arg=11) at elog.c:4497
#2  <signal handler called>
#3  initialize_dispatch_data (resource=0x0, dispatch_to_all_cached_executors=0 
'\000') at dispatcher.c:460
#4  0x000000000065e504 in ExecutorStart (queryDesc=<value optimized out>, 
eflags=<value optimized out>) at execMain.c:908
#5  0x00000000007bd5dd in PortalStart (portal=<value optimized out>, 
params=<value optimized out>, snapshot=<value optimized out>, 
seqServerHost=<value optimized out>, seqServerPort=<value optimized out>) at 
pquery.c:1222
#6  0x00000000007b7549 in exec_simple_query (query_string=<value optimized 
out>, seqServerHost=<value optimized out>, seqServerPort=<value optimized out>) 
at postgres.c:1683
#7  0x00000000007b8aa2 in PostgresMain (argc=<value optimized out>, 
argv=0x19af5a8, username=<value optimized out>) at postgres.c:4691
#8  0x000000000076a0e3 in BackendRun (port=0x1964c80) at postmaster.c:5844
#9  BackendStartup (port=0x1964c80) at postmaster.c:5437
#10 0x000000000076a84d in ServerLoop () at postmaster.c:2139
#11 0x000000000076c65e in PostmasterMain (argc=9, argv=0x19698e0) at 
postmaster.c:1431
#12 0x00000000006c742a in main (argc=9, argv=0x19698a0) at main.c:226
{noformat}


> Core dump in UDF with EXPLAIN statement in it
> ---------------------------------------------
>
>                 Key: HAWQ-218
>                 URL: https://issues.apache.org/jira/browse/HAWQ-218
>             Project: Apache HAWQ
>          Issue Type: Bug
>            Reporter: Ruilong Huo
>            Assignee: Ruilong Huo
>
> HAWQ core dumps while calling UDF with EXPLAIN statement in it.
> Reproduction steps:
> Step 1: prepare schema and data
> {noformat}
> create table foo(a int, b int, c int) partition by range (b) (start (1) end 
> (101) every (10));
> insert into foo select generate_series(1,5), generate_series(1,100), 
> generate_series(1,10);
> analyze foo;
> {noformat}
> Step 2: run query
> {noformat}
> gptest=# select * from foo where b = 150;
> FATAL:  Unexpected internal error (dispatcher.c:456)
> DETAIL:  FailedAssertion("!(resource)", File: "dispatcher.c", Line: 456)
> HINT:  Process 29088 will wait for gp_debug_linger=120 seconds before 
> termination.
> Note that its locks and other resources will not be released until then.
> server closed the connection unexpectedly
>       This probably means the server terminated abnormally
>       before or while processing the request.
> The connection to the server was lost. Attempting reset: Succeeded.
> {noformat}
> Step 3: call stack in core dump
> {noformat}
> (gdb) bt
> #0  0x00000038cbe32625 in raise () from /lib64/libc.so.6
> #1  0x00000038cbe33e05 in abort () from /lib64/libc.so.6
> #2  0x00000000009dc10c in ExceptionalCondition (conditionName=0xe06c0e 
> "!(resource)", errorType=0xe06be3 "FailedAssertion", fileName=0xe06bc0 
> "dispatcher.c", lineNumber=456) at assert.c:60
> #3  0x0000000000b82260 in initialize_dispatch_data (resource=0x0, 
> dispatch_to_all_cached_executors=0 '\000') at dispatcher.c:456
> #4  0x000000000071ac23 in ExecutorStart (queryDesc=0x28b5460, eflags=0) at 
> execMain.c:908
> #5  0x00000000008ff7df in PortalStart (portal=0x28d3498, params=0x0, 
> snapshot=0x0, seqServerHost=0x0, seqServerPort=-1) at pquery.c:1222
> #6  0x00000000008f5e76 in exec_simple_query (query_string=0x26b0198 "select * 
> from foo where b = 150;", seqServerHost=0x0, seqServerPort=-1) at 
> postgres.c:1680
> #7  0x00000000008fab80 in PostgresMain (argc=4, argv=0x25fac28, 
> username=0x25faa80 "gpadmin") at postgres.c:4688
> #8  0x00000000008a0ec3 in BackendRun (port=0x25adc80) at postmaster.c:5834
> #9  0x00000000008a034d in BackendStartup (port=0x25adc80) at postmaster.c:5427
> #10 0x000000000089a9d9 in ServerLoop () at postmaster.c:2129
> #11 0x0000000000899a9c in PostmasterMain (argc=9, argv=0x25c4940) at 
> postmaster.c:1421
> #12 0x00000000007b3472 in main (argc=9, argv=0x25c4940) at main.c:226
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to