You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "Ming LI (JIRA)" <ji...@apache.org> on 2016/11/02 02:13:58 UTC

[jira] [Commented] (HAWQ-1135) MADlib: Raising exception leads to database connection termination

    [ https://issues.apache.org/jira/browse/HAWQ-1135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15627383#comment-15627383 ] 

Ming LI commented on HAWQ-1135:
-------------------------------

1) Execute SQL:
select madlib.lmf_igd_run(
          'LMF_output_table'::varchar,
          'madlibtestdata.mlens100k'::varchar,
          'user_id'::varchar,
          'movie_id'::varchar,
          'rating'::varchar,
          943::integer,
          1682::integer,
          10::integer,
          0.01::double precision,
          NULL::double precision,
          10::integer,
          1e-3::double precision
          );
          

2) gdb executor process:
b planner
c
c 17            
b siglongjmp


(gdb) f 1
(gdb) p *edata
$2 = {elevel = 20, output_to_server = 1 '\001', output_to_client = 1 '\001', show_funcname = 0 '\000',
  omit_location = 1 '\001', fatal_return = 0 '\000', hide_stmt = 0 '\000', send_alert = 0 '\000',
  filename = 0x7f68bf30fd08 "/data/home/gpdbchina/madlib-1.9.1-build/incubator-madlib/src/ports/hawq/../greenplum/dbconnector/../../postgres/dbconnector/UDF_impl.hpp", lineno = 210,
  funcname = 0x7f68bf3104d4 "call", domain = 0xc6b0bb "postgres-8.2", sqlerrcode = 50856066,
  message = 0x1c42950 "Function \"madlib.lmf_igd_transition(double precision[],integer,integer,double precision,double precision[],integer,integer,integer,double precision,double precision)\": Invalid type conversion. Null wh"..., detail = 0x0, detail_log = 0x0, hint = 0x0,
  context = 0x1c42eb0 "SQL statement \"\n", ' ' <repeats 16 times>, "SELECT\n", ' ' <repeats 20 times>, "1 AS _iteration,\n", ' ' <repeats 20 times>, "(\n", ' ' <repeats 16 times>, "SELECT\n", ' ' <repeats 20 times>, "madlib.lmf_igd_step(\n", ' ' <repeats 24 times>, "(_src.user_id)"..., cursorpos = 0,
  internalpos = 0, internalquery = 0x0, saved_errno = 11, stacktracearray = {0x95d52a, 0x7f68bf2382e9,
    0x6fb00b, 0x6faeab, 0x6fb394, 0x6fc17d, 0x6fce08, 0x6fc08a, 0x6df92f, 0x7183ff, 0xaab907, 0x6d608a,
    0x72f44d, 0x72ef58, 0x72c1d9, 0x7f68c44a8011, 0x7f68c44a7a54, 0x7f68c41ca9d4, 0x7f68c41cc647,
    0x7f68c41caa94, 0x7f68c41cc647, 0x7f68c415fd9d, 0x7f68c4138c63, 0x7f68c41c9460, 0x7f68c41cbb7f,
    0x7f68c41cc647, 0x7f68c41cc722, 0x7f68c44a1e97, 0x7f68c44a155c, 0x7f68c449faf3},
  stacktracesize = 30, printstack = 0 '\000'}
(gdb) bt

	
#0  0x0000003dc100e150 in siglongjmp () from /lib64/libpthread.so.0
#1  0x000000000095d6f7 in errfinish (dummy=0) at elog.c:578
#2  0x00007f68bf238321 in long madlib::dbconnector::postgres::UDF::call<madlib::modules::convex::lmf_igd_transition>(FunctionCallInfoData*) ()
   from /usr/local/madlib/Versions/1.9.1/ports/hawq/2.0/lib/libmadlib.so
#3  0x00000000006fb00b in invoke_agg_trans_func (transfn=0x2f7cff8, numargs=9, transValue=37836256,
    noTransvalue=0x2f7a431 "", transValueIsNull=0x2f7a430 "", transtypeByVal=0 '\000', transtypeLen=-1,
    fcinfo=0x7fff61be3500, funcctx=0x2fb5b28, tuplecontext=0x244d0b0, mem_manager=0x2fb5e00)
    at nodeAgg.c:471
#4  0x00000000006faeab in advance_transition_function (aggstate=0x2fb5b28, peraggstate=0x2f7cfc0,
    pergroupstate=0x2f7a428, fcinfo=0x7fff61be3500, mem_manager=0x2fb5e00) at nodeAgg.c:392
#5  0x00000000006fb394 in advance_aggregates (aggstate=0x2fb5b28, pergroup=0x2f7a428,
    mem_manager=0x2fb5e00) at nodeAgg.c:618
#6  0x00000000006fc17d in agg_retrieve_scalar (aggstate=0x2fb5b28) at nodeAgg.c:1173
#7  0x00000000006fce08 in agg_retrieve_direct (aggstate=0x2fb5b28) at nodeAgg.c:1693
#8  0x00000000006fc08a in ExecAgg (node=0x2fb5b28) at nodeAgg.c:1138
#9  0x00000000006df92f in ExecProcNode (node=0x2fb5b28) at execProcnode.c:979
#10 0x00000000007183ff in ExecSetParamPlan (node=0x2fb5808, econtext=0x2f74a10, gbl_queryDesc=0x2fa8550)
    at nodeSubplan.c:1161
#11 0x0000000000aab907 in preprocess_initplans (queryDesc=0x2fa8550) at cdbsubplan.c:171
#12 0x00000000006d608a in ExecutorStart (queryDesc=0x2fa8550, eflags=0) at execMain.c:929
#13 0x000000000072f44d in _SPI_pquery (queryDesc=0x2fa8550, fire_triggers=1 '\001', tcount=0)
    at spi.c:2214
#14 0x000000000072ef58 in _SPI_execute_plan (plan=0x242be00, Values=0x244c108,
    Nulls=0x21e5a78 "notice", snapshot=0x0, crosscheck_snapshot=0x0, read_only=0 '\000',
    fire_triggers=1 '\001', tcount=0) at spi.c:1972
#15 0x000000000072c1d9 in SPI_execute_plan (plan=0x242be00, Values=0x244c108, Nulls=0x21e5a78 "notice",
    read_only=0 '\000', tcount=0) at spi.c:520
#16 0x00007f68c44a8011 in PLy_spi_execute_plan (ob=0x228c8b8, list=0x222e3b0, limit=0)
    at plpython.c:3737
#17 0x00007f68c44a7a54 in PLy_spi_execute (self=0x0, args=0x2221098) at plpython.c:3635
#18 0x00007f68c41ca9d4 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#19 0x00007f68c41cc647 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#20 0x00007f68c41caa94 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#21 0x00007f68c41cc647 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#22 0x00007f68c415fd9d in ?? () from /usr/lib64/libpython2.6.so.1.0
#23 0x00007f68c4138c63 in PyObject_Call () from /usr/lib64/libpython2.6.so.1.0
#24 0x00007f68c41c9460 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#25 0x00007f68c41cbb7f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#26 0x00007f68c41cc647 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#27 0x00007f68c41cc722 in PyEval_EvalCode () from /usr/lib64/libpython2.6.so.1.0
#28 0x00007f68c44a1e97 in PLy_procedure_call (proc=0x21dfbc0, kargs=0x7f68c44ab3f0 "args",
    vargs=0x20a1d40) at plpython.c:1333
#29 0x00007f68c44a155c in PLy_function_handler (fcinfo=0x7fff61be5300, proc=0x21dfbc0)
    at plpython.c:1065
#30 0x00007f68c449faf3 in plpython_call_handler (fcinfo=0x7fff61be5300) at plpython.c:577
#31 0x00000000006e339d in ExecMakeFunctionResult (fcache=0x1ec37e0, econtext=0x1fcce70,
    isNull=0x1ec5a58 "\220\002", isDone=0x1ec5b00) at execQual.c:1762
#32 0x00000000006e40a5 in ExecEvalFunc (fcache=0x1ec37e0, econtext=0x1fcce70,
    isNull=0x1ec5a58 "\220\002", isDone=0x1ec5b00) at execQual.c:2228
#33 0x00000000006eb0b1 in ExecTargetList (targetlist=0x1ec5310, econtext=0x1fcce70, values=0x1ec5a40,
    isnull=0x1ec5a58 "\220\002", itemIsDone=0x1ec5b00, isDone=0x7fff61be5834) at execQual.c:5467
#34 0x00000000006eb57c in ExecProject (projInfo=0x1ec5a70, isDone=0x7fff61be5834) at execQual.c:5653
#35 0x0000000000711a3d in ExecResult (node=0x1fcbd08) at nodeResult.c:238
#36 0x00000000006df77c in ExecProcNode (node=0x1fcbd08) at execProcnode.c:891
#37 0x00000000007183ff in ExecSetParamPlan (node=0x1fcc340, econtext=0x1fcb958, gbl_queryDesc=0x0)
    at nodeSubplan.c:1161
#38 0x00000000006e20ca in ExecEvalParam (exprstate=0x1fcbae8, econtext=0x1fcb958,
    isNull=0x1fcc280 "\221\002", isDone=0x1fcc328) at execQual.c:972
#39 0x00000000006eb0b1 in ExecTargetList (targetlist=0x1fcbb38, econtext=0x1fcb958, values=0x1fcc268,
    isnull=0x1fcc280 "\221\002", itemIsDone=0x1fcc328, isDone=0x7fff61be5c34) at execQual.c:5467
#40 0x00000000006eb57c in ExecProject (projInfo=0x1fcc298, isDone=0x7fff61be5c34) at execQual.c:5653
#41 0x0000000000711a3d in ExecResult (node=0x1fcb4f8) at nodeResult.c:238
#42 0x00000000006df77c in ExecProcNode (node=0x1fcb4f8) at execProcnode.c:891
#43 0x00000000006d9b49 in ExecutePlan (estate=0x1fcaff0, planstate=0x1fcb4f8, operation=CMD_SELECT,
    numberTuples=2, direction=ForwardScanDirection, dest=0xfbcbe0) at execMain.c:3234
#44 0x00000000006d675a in ExecutorRun (queryDesc=0x1e7cc68, direction=ForwardScanDirection, count=2)
    at execMain.c:1213
#45 0x000000000072f468 in _SPI_pquery (queryDesc=0x1e7cc68, fire_triggers=1 '\001', tcount=2)
    at spi.c:2216
#46 0x000000000072ef58 in _SPI_execute_plan (plan=0x203fdb0, Values=0x1e66818,
    Nulls=0x1e66a30 "    n  ", snapshot=0x0, crosscheck_snapshot=0x0, read_only=0 '\000',
    fire_triggers=1 '\001', tcount=2) at spi.c:1972
#47 0x000000000072c1d9 in SPI_execute_plan (plan=0x203fdb0, Values=0x1e66818,
    Nulls=0x1e66a30 "    n  ", read_only=0 '\000', tcount=2) at spi.c:520
#48 0x00007f68c4d3825c in exec_run_select (estate=0x7fff61be6870, expr=0x1e6ccb8, maxtuples=2,
    portalP=0x0) at pl_exec.c:4069
#49 0x00007f68c4d37e14 in exec_eval_expr (estate=0x7fff61be6870, expr=0x1e6ccb8,
    isNull=0x7fff61be65c3 "", rettype=0x7fff61be65c4) at pl_exec.c:3968
#50 0x00007f68c4d3669c in exec_assign_expr (estate=0x7fff61be6870, target=0x1e64db0, expr=0x1e6ccb8)
    at pl_exec.c:3312
#51 0x00007f68c4d329c3 in exec_stmt_assign (estate=0x7fff61be6870, stmt=0x1e6c718) at pl_exec.c:1303
#52 0x00007f68c4d32715 in exec_stmt (estate=0x7fff61be6870, stmt=0x1e6c718) at pl_exec.c:1207
#53 0x00007f68c4d3257a in exec_stmts (estate=0x7fff61be6870, stmts=0x1e6c428) at pl_exec.c:1170
#54 0x00007f68c4d3239a in exec_stmt_block (estate=0x7fff61be6870, block=0x1e6e858) at pl_exec.c:1113
#55 0x00007f68c4d307fc in plpgsql_exec_function (func=0x1c90c50, fcinfo=0x7fff61be6b10) at pl_exec.c:291
#56 0x00007f68c4d2ba53 in plpgsql_call_handler (fcinfo=0x7fff61be6b10) at pl_handler.c:95
#57 0x00000000006e339d in ExecMakeFunctionResult (fcache=0x1e55110, econtext=0x1e53f40,
    isNull=0x1e56428 "", isDone=0x1e564d0) at execQual.c:1762
#58 0x00000000006e40a5 in ExecEvalFunc (fcache=0x1e55110, econtext=0x1e53f40, isNull=0x1e56428 "",
    isDone=0x1e564d0) at execQual.c:2228
#59 0x00000000006eb0b1 in ExecTargetList (targetlist=0x1e55d30, econtext=0x1e53f40, values=0x1e56410,
    isnull=0x1e56428 "", itemIsDone=0x1e564d0, isDone=0x7fff61be7044) at execQual.c:5467
#60 0x00000000006eb57c in ExecProject (projInfo=0x1e56440, isDone=0x7fff61be7044) at execQual.c:5653
#61 0x0000000000711a3d in ExecResult (node=0x1e52dd8) at nodeResult.c:238
#62 0x00000000006df77c in ExecProcNode (node=0x1e52dd8) at execProcnode.c:891
#63 0x00000000007183ff in ExecSetParamPlan (node=0x1e53410, econtext=0x1e52a28, gbl_queryDesc=0x0)
    at nodeSubplan.c:1161
#64 0x00000000006e20ca in ExecEvalParam (exprstate=0x1e52bb8, econtext=0x1e52a28, isNull=0x1e53350 "",
    isDone=0x1e533f8) at execQual.c:972
#65 0x00000000006eb0b1 in ExecTargetList (targetlist=0x1e52c08, econtext=0x1e52a28, values=0x1e53338,
    isnull=0x1e53350 "", itemIsDone=0x1e533f8, isDone=0x7fff61be7444) at execQual.c:5467
#66 0x00000000006eb57c in ExecProject (projInfo=0x1e53368, isDone=0x7fff61be7444) at execQual.c:5653
#67 0x0000000000711a3d in ExecResult (node=0x1e525c8) at nodeResult.c:238
#68 0x00000000006df77c in ExecProcNode (node=0x1e525c8) at execProcnode.c:891
#69 0x00000000006d9b49 in ExecutePlan (estate=0x1e520c0, planstate=0x1e525c8, operation=CMD_SELECT,
    numberTuples=0, direction=ForwardScanDirection, dest=0x1e41728) at execMain.c:3234
#70 0x00000000006d675a in ExecutorRun (queryDesc=0x1e4c290, direction=ForwardScanDirection, count=0)
    at execMain.c:1213
#71 0x000000000088838b in PortalRunSelect (portal=0x1e50000, forward=1 '\001', count=0, dest=0x1e41728)
    at pquery.c:1731
#72 0x0000000000887fa6 in PortalRun (portal=0x1e50000, count=9223372036854775807, isTopLevel=1 '\001',
    dest=0x1e41728, altdest=0x1e41728, completionTag=0x7fff61be7a90 "") at pquery.c:1553
#73 0x000000000087e20c in exec_simple_query (
    query_string=0x1db50a0 "select madlib.lmf_igd_run(\n          'LMF_output_table'::varchar,\n          'madlibtestdata.mlens100k'::varchar,\n          'user_id'::varchar,\n          'movie_id'::varchar,\n          'rating'::varcha"..., seqServerHost=0x0, seqServerPort=-1) at postgres.c:1816
#74 0x0000000000882c43 in PostgresMain (argc=4, argv=0x1c81bc8, username=0x1c81ae0 "gpadmin")
    at postgres.c:4840
#75 0x0000000000835e54 in BackendRun (port=0x1c285f0) at postmaster.c:5914
#76 0x000000000083529f in BackendStartup (port=0x1c285f0) at postmaster.c:5484
#77 0x000000000082faac in ServerLoop () at postmaster.c:2163
#78 0x000000000082eb77 in PostmasterMain (argc=9, argv=0x1c31010) at postmaster.c:1454
#79 0x000000000075ac5b in main (argc=9, argv=0x1c31010) at main.c:226


3) error message from log:

2016-10-31 03:52:23.913262 PDT,"gpadmin","madlib",p47947,th-463333088,"[local]",,2016-10-31 03:42:07 PDT,15845,con2028,cmd13,seg-1,slice3,,x15851,sx9,"ERROR","22023","Function ""madlib.lmf_igd_transition(double precision[],integer,integer,double precision,double precision[],integer,integer,integer,double precision,double precision)"": Invalid type conversion. Null where not expected.",,,,,"SQL statement ""
                SELECT
                    1 AS _iteration,
                    (
                SELECT
                    madlib.lmf_igd_step(
                        (_src.user_id)::integer,
                        (_src.movie_id)::integer,
                        (_src.rating)::integer,
                        $1,
                        (_args.row_dim)::integer,
                        (_args.column_dim)::integer,
                        (_args.max_rank)::integer,
                        (_args.stepsize)::FLOAT8,
                        (_args.scale_factor)::FLOAT8)
                FROM madlibtestdata.mlens100k AS _src, pg_temp._madlib_lmf_igd_args AS _args
                ) AS _state
                ""
PL/Python function ""internal_compute_lmf_igd""
SQL statement ""SELECT  madlib.internal_compute_lmf_igd( '_madlib_lmf_igd_args', '_madlib_lmf_igd_state', textin(regclassout( $1 )),  $2 ,  $3 ,  $4 )""
PL/pgSQL function ""lmf_igd_run"" line 40 at assignment","
                SELECT
                    1 AS _iteration,
                    (
                SELECT
                    madlib.lmf_igd_step(
                        (_src.user_id)::integer,
                        (_src.movie_id)::integer,
                        (_src.rating)::integer,
                        $1,
                        (_args.row_dim)::integer,
                        (_args.column_dim)::integer,
                        (_args.max_rank)::integer,
                        (_args.stepsize)::FLOAT8,
                        (_args.scale_factor)::FLOAT8)
                FROM madlibtestdata.mlens100k AS _src, pg_temp._madlib_lmf_igd_args AS _args
                ) AS _state
                ",0,,"/data/home/gpdbchina/madlib-1.9.1-build/incubator-madlib/src/ports/hawq/../greenplum/dbconnector/../../postgres/dbconnector/UDF_impl.hpp",210,  

> MADlib: Raising exception leads to database connection termination
> ------------------------------------------------------------------
>
>                 Key: HAWQ-1135
>                 URL: https://issues.apache.org/jira/browse/HAWQ-1135
>             Project: Apache HAWQ
>          Issue Type: Bug
>          Components: Core
>            Reporter: Ming LI
>            Assignee: Lei Chang
>
> MADlib tests on HAWQ 2.0 Nightly builds fails due to server terminating it's connection. The failed tests are testing for bad input by returning an exception on specific user inputs. These exceptions are raised cleanly in other platforms including HAWQ 2.0 and all Greenplum DBs.
> Reproduction Steps
> Install MADlib using the RPM and HAWQ install script.
> Run attached script (called hawq_2.0.1_test.sql)
> Current error message is
> {{
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> }}
> Expected error is
> {{
> ERROR: spiexceptions.InvalidParameterValue: Function "madlib.lmf_igd_transition(double precision[],integer,integer,double precision,double precision[],integer,integer,integer,double precision,double precision)": Invalid type conversion. Null where not expected.
> }}



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