You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:19:22 UTC
[jira] [Created] (TRAFODION-1000) LP Bug: 1420938 - UDF: UDF with
33 parameters cores tdm_udrserv in ../udrserv/UdrFFDC.cpp
Alice Chen created TRAFODION-1000:
-------------------------------------
Summary: LP Bug: 1420938 - UDF: UDF with 33 parameters cores tdm_udrserv in ../udrserv/UdrFFDC.cpp
Key: TRAFODION-1000
URL: https://issues.apache.org/jira/browse/TRAFODION-1000
Project: Apache Trafodion
Issue Type: Bug
Components: sql-exe
Reporter: Weishiun Tsai
Assignee: Suresh Subbiah
Priority: Critical
Fix For: 1.1 (pre-incubation)
UDF only allows a maximum of 32 parameters (input+output). The following example defined a UDF with 33 parameters (32 input + 1 output). At the execution time, it did return a message 'LM Assertion: Parameters more than 32 are not allowed.
at FILE: ../langman/LmRoutineCSql.cpp LINE: 840', but it also cored tdm_udrserv in ../udrserv/UdrFFDC.cpp. Instead of crashing tdm_udrserv, SQL should just return a proper error message at the registration time or the execution time.
This is seen on the v0210 build installed on a workstation.
To reproduce this problem:
(1) Download the attached tar file and untar it to get the 4 files in there. Put the 4 files in any directory <mydir>
(2) Run build.sh from <mydir> to build the UDF so file.
(3) Change the line ‘create library qa_udf_lib file '<mydir>/myudf.so'; in mytest.sql and fill in <mydir>
(4) From sqlci, obey mytest.sql
----------------------------------------------------------------------------------------------------------------------
Here is the execution output:
>>obey mytest.sql;
>>create schema mytest;
--- SQL operation complete.
>>set schema mytest;
--- SQL operation complete.
>>
>>create library qa_udf_lib file '<mydir>/myudf.so';
--- SQL operation complete.
>>
>>create function QA_UDF_33_PARAMETERS
+>(I1 int, I2 int, I3 int, I4 int, I5 int, I6 int, I7 int, I8 int, I9 int,
+>I10 int, I11 int, I12 int, I13 int, I14 int, I15 int, I16 int, I17 int,
+>I18 int, I19 int, I20 int, I21 int, I22 int, I23 int, I24 int, I25 int,
+>I26 int, I27 int, I28 int, I29 int, I30 int, I31 int, I32 int)
+>returns (O int)
+>language c
+>parameter style sql
+>external name 'qa_udf_33_parameters'
+>library qa_udf_lib
+>deterministic
+>state area size 1024
+>allow any parallelism
+>no sql;
--- SQL operation complete.
>>
>>values(QA_UDF_33_PARAMETERS(
+>1,1,1,1,1,1,1,1,1,1,
+>1,1,1,1,1,1,1,1,1,1,
+>1,1,1,1,1,1,1,1,1,1,
+>1,1));
LM Assertion: Parameters more than 32 are not allowed.
at FILE: ../langman/LmRoutineCSql.cpp LINE: 840
*** ERROR[2034] $Z0001NI:60: Operating system error 201 while communicating with server process $Z0002EK:63.
*** ERROR[8904] SQL did not receive a reply from MXUDR, possibly caused by internal errors when executing user-defined routines.
--- 0 row(s) selected.
>>
>>drop function QA_UDF_33_PARAMETERS;
--- SQL operation complete.
>>drop library qa_udf_lib cascade;
--- SQL operation complete.
>>drop schema mytest cascade;
--- SQL operation complete.
----------------------------------------------------------------------------------------------------------------------
Here is the stack of the core file:
(gdb) bt
#0 0x00000039e28328a5 in raise () from /lib64/libc.so.6
#1 0x00000039e2834085 in abort () from /lib64/libc.so.6
#2 0x0000000000423689 in comTFDS (
msg1=0x43ad50 "Trafodion UDR Server Internal Error",
msg2=<value optimized out>,
msg3=0x7fffffff8f20 "Error occurred in source file ../langman/LmRoutineCSql.cpp on line 840",
msg4=0x7fffffff8720 "User routine being processed : TRAFODION.MYTEST.QA_UDF_33_PARAMETERS, Routine Type : UDF, Language Type : C, Error occurred outside the user routine code", msg5=0x43c977 "", dialOut=<value optimized out>,
writeToSeaLog=1) at ../udrserv/UdrFFDC.cpp:188
#3 0x00000000004238f7 in makeTFDSCall (
msg=0x7fffffff9370 "Language Manager internal error : Parameters more than 32 are not allowed.", file=<value optimized out>, line=<value optimized out>,
dialOut=1, writeToSeaLog=1) at ../udrserv/UdrFFDC.cpp:216
#4 0x00007ffff79c0873 in lmAssert (
file=0x7ffff79e553c "../langman/LmRoutineCSql.cpp", linenum=840,
msg=0x7ffff79e5488 "Parameters more than 32 are not allowed.")
at ../langman/LmAssert.cpp:56
#5 0x00007ffff79e1c58 in LmRoutineCSql::invokeRoutine (this=0x7fffea26d650,
inputRow=0x7fffea22c480, outputRow=0x7fffea23e160, da=0x7fffea23c678)
at ../langman/LmRoutineCSql.cpp:840
#6 0x0000000000415ebc in SPInfo::processOneRequestRow (this=0x7fffea26afb8,
reqSqlBuf=<value optimized out>, replySqlBuf=0x7fffea23e100,
numRowsProcessed=<value optimized out>) at ../udrserv/spinfo.cpp:1586
#7 0x00000000004164bf in SPInfo::work (this=0x7fffea26afb8)
at ../udrserv/spinfo.cpp:1436
#8 0x0000000000432cda in UdrServerDataStream::actOnReceive (
this=0x7fffea26bee8, conn=<value optimized out>)
at ../udrserv/UdrStreams.cpp:134
#9 0x000000000042f08d in processARequest (UdrGlob=0x7fffea266040,
msgStream=..., env=...) at ../udrserv/udrserv.cpp:698
#10 0x00000000004318ec in runServer (argc=2, argv=0x7fffffff9fb8)
at ../udrserv/udrserv.cpp:509
#11 0x0000000000431b7f in main (argc=2, argv=0x7fffffff9fb8)
at ../udrserv/udrserv.cpp:345
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)