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

Dong Li edited comment on HAWQ-133 at 11/6/15 7:42 AM:
-------------------------------------------------------

As far as I see, the *queryDesc->resource has some unassigned parameters.
{code}
(lldb) p *queryDesc->resource
(QueryResource) $0 = {
  type = 2139062143
  life = 2139062143
  resource_id = 2139062143
  master = 0x7f7f7f7f
  segments = 0x7f7f7f7f
  segment_memory_mb = 2139062143
  segment_vcore = 1.3824172084878715E+306
  numSegments = 2139062143
  segment_vcore_agg = 0x7f7f7f7f
  segment_vcore_writer = 0x7f7f7f7f
  master_start_time = 9187201950435737471
}
{code}
{code}
bt
* thread #1: tid = 0x0000, 0x99362f96 libsystem_kernel.dylib`__kill + 10, stop 
reason = signal SIGSTOP
  * frame #0: 0x99362f96 libsystem_kernel.dylib`__kill + 10
    frame #1: 0x99360678 libsystem_kernel.dylib`kill$UNIX2003 + 32
    frame #2: 0x9b835cf4 libsystem_c.dylib`raise + 27
    frame #3: 0x0056d63f 
postgres`SafeHandlerForSegvBusIll(processName=0x008db7af, 
postgres_signal_arg=11) + 585 at elog.c:4497
    frame #4: 0x0056d90a 
postgres`StandardHandlerForSigillSigsegvSigbus_OnMainThread(processName=0x008db7af,
 postgres_signal_arg=11) + 45 at elog.c:4575
    frame #5: 0x004716b7 
postgres`CdbProgramErrorHandler(postgres_signal_arg=11) + 275 at postgres.c:3403
    frame #6: 0x96f5003b libsystem_platform.dylib`_sigtramp + 43
    frame #7: 0x0072ce7b postgres`list_length(l=0x7f7f7f7f) + 16 at pg_list.h:99
    frame #8: 0x0072d77b postgres`initialize_dispatch_data(resource=0x05824024, 
dispatch_to_all_cached_executors='\0') + 315 at dispatcher.c:441
    frame #9: 0x002851c9 postgres`ExecutorStart(queryDesc=0x0399b428, eflags=0) 
+ 5341 at execMain.c:908
    frame #10: 0x002f271b postgres`_SPI_pquery(queryDesc=0x0399b428, 
fire_triggers='\x01', tcount=0) + 809 at spi.c:2167
    frame #11: 0x002f21ee postgres`_SPI_execute_plan(plan=0x051dc42c, 
Values=0x05824a10, Nulls=0x03996e2c, snapshot=0x00000000, 
crosscheck_snapshot=0x00000000, read_only='\0', fire_triggers='\x01', tcount=0) 
+ 1795 at spi.c:1924
    frame #12: 0x002ef1c3 postgres`SPI_execute_plan(plan=0x051dc42c, 
Values=0x05824a10, Nulls=0x03996e2c, read_only='\0', tcount=0) + 224 at 
spi.c:491
    frame #13: 0x044c2b72 plpython.so`PLy_spi_execute_plan(ob=0x1c0a5760, 
list=0x1c09dd00, limit=0) + 1151 at plpython.c:3725
    frame #14: 0x044c26cc plpython.so`PLy_spi_execute(self=0x00000000, 
args=0x1c0a34b8) + 177 at plpython.c:3623
{code}


was (Author: doli):
As far as I see, the *queryDesc->resource has some unassigned parameters.
{code}
(lldb) p *queryDesc->resource
(QueryResource) $0 = {
  type = 2139062143
  life = 2139062143
  resource_id = 2139062143
  master = 0x7f7f7f7f
  segments = 0x7f7f7f7f
  segment_memory_mb = 2139062143
  segment_vcore = 1.3824172084878715E+306
  numSegments = 2139062143
  segment_vcore_agg = 0x7f7f7f7f
  segment_vcore_writer = 0x7f7f7f7f
  master_start_time = 9187201950435737471
}
{code}
{cdoe}
bt
* thread #1: tid = 0x0000, 0x99362f96 libsystem_kernel.dylib`__kill + 10, stop 
reason = signal SIGSTOP
  * frame #0: 0x99362f96 libsystem_kernel.dylib`__kill + 10
    frame #1: 0x99360678 libsystem_kernel.dylib`kill$UNIX2003 + 32
    frame #2: 0x9b835cf4 libsystem_c.dylib`raise + 27
    frame #3: 0x0056d63f 
postgres`SafeHandlerForSegvBusIll(processName=0x008db7af, 
postgres_signal_arg=11) + 585 at elog.c:4497
    frame #4: 0x0056d90a 
postgres`StandardHandlerForSigillSigsegvSigbus_OnMainThread(processName=0x008db7af,
 postgres_signal_arg=11) + 45 at elog.c:4575
    frame #5: 0x004716b7 
postgres`CdbProgramErrorHandler(postgres_signal_arg=11) + 275 at postgres.c:3403
    frame #6: 0x96f5003b libsystem_platform.dylib`_sigtramp + 43
    frame #7: 0x0072ce7b postgres`list_length(l=0x7f7f7f7f) + 16 at pg_list.h:99
    frame #8: 0x0072d77b postgres`initialize_dispatch_data(resource=0x05824024, 
dispatch_to_all_cached_executors='\0') + 315 at dispatcher.c:441
    frame #9: 0x002851c9 postgres`ExecutorStart(queryDesc=0x0399b428, eflags=0) 
+ 5341 at execMain.c:908
    frame #10: 0x002f271b postgres`_SPI_pquery(queryDesc=0x0399b428, 
fire_triggers='\x01', tcount=0) + 809 at spi.c:2167
    frame #11: 0x002f21ee postgres`_SPI_execute_plan(plan=0x051dc42c, 
Values=0x05824a10, Nulls=0x03996e2c, snapshot=0x00000000, 
crosscheck_snapshot=0x00000000, read_only='\0', fire_triggers='\x01', tcount=0) 
+ 1795 at spi.c:1924
    frame #12: 0x002ef1c3 postgres`SPI_execute_plan(plan=0x051dc42c, 
Values=0x05824a10, Nulls=0x03996e2c, read_only='\0', tcount=0) + 224 at 
spi.c:491
    frame #13: 0x044c2b72 plpython.so`PLy_spi_execute_plan(ob=0x1c0a5760, 
list=0x1c09dd00, limit=0) + 1151 at plpython.c:3725
    frame #14: 0x044c26cc plpython.so`PLy_spi_execute(self=0x00000000, 
args=0x1c0a34b8) + 177 at plpython.c:3623
{code}

> core when use plpython udf
> --------------------------
>
>                 Key: HAWQ-133
>                 URL: https://issues.apache.org/jira/browse/HAWQ-133
>             Project: Apache HAWQ
>          Issue Type: Bug
>            Reporter: Dong Li
>            Assignee: Lei Chang
>
> Run sqls below can recur the core.
> {code}
> CREATE PROCEDURAL LANGUAGE plpythonu;
> CREATE TABLE users (
>       fname text not null,
>       lname text not null,
>       username text,
>       userid serial
>       -- , PRIMARY KEY(lname, fname) 
>       ) DISTRIBUTED BY (userid);
> INSERT INTO users (fname, lname, username) VALUES ('jane', 'doe', 'j_doe');
> INSERT INTO users (fname, lname, username) VALUES ('john', 'doe', 'johnd');
> INSERT INTO users (fname, lname, username) VALUES ('willem', 'doe', 'w_doe');
> INSERT INTO users (fname, lname, username) VALUES ('rick', 'smith', 'slash');
> CREATE FUNCTION spi_prepared_plan_test_one(a text) RETURNS text
>       AS
> 'if not SD.has_key("myplan"):
>       q = "SELECT count(*) FROM users WHERE lname = $1"
>       SD["myplan"] = plpy.prepare(q, [ "text" ])
> try:
>       rv = plpy.execute(SD["myplan"], [a])
>       return "there are " + str(rv[0]["count"]) + " " + str(a) + "s"
> except Exception, ex:
>       plpy.error(str(ex))
> return None
> '
>       LANGUAGE plpythonu;
> select spi_prepared_plan_test_one('doe');
> select spi_prepared_plan_test_one('smith');
> {code}
> when execute "select spi_prepared_plan_test_one('smith');"
> 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: Failed.
> !>



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

Reply via email to