Selvaganesan Govindarajan created TRAFODION-2754:
----------------------------------------------------

             Summary:  Get statistics cores sqlci or mxosrvr at str_sprintf()
                 Key: TRAFODION-2754
                 URL: https://issues.apache.org/jira/browse/TRAFODION-2754
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-exe
            Reporter: Selvaganesan Govindarajan
            Assignee: Selvaganesan Govindarajan


As shown below, select * from table(statistics()) cores sqlci (when using 
sqlci) or mxosrvr (when using trafci) with a core. The core indicates that 
ExMasterStats::getVariableStatsInfo() has crashed at str_sprintf(). 

$ sqlci

>>obey mytest.sql;
>>set schema trafodion.g_tpch2x;

--- SQL operation complete.
>>
>>prepare xx from select
+>cast( (100.00 * sum(case
+>when p_type like 'PROMO%'
+>then l_extendedprice * (1 - l_discount)
+>else 0
+>end) / sum(l_extendedprice * (1 - l_discount))
+>) as numeric(18,3)) as promo_revenue
+>from
+>lineitem,
+>part
+>where
+>l_partkey = p_partkey
+>and l_shipdate >= date '1996-01-01'
+>and l_shipdate < date '1996-01-01' + interval '1' month;

--- SQL command prepared.
>>
>>explain options 'f' xx;

LC RC OP OPERATOR OPT DESCRIPTION CARD
---- ---- ---- -------------------- -------- -------------------- ---------

8 . 9 root 1.00E+000
7 . 8 sort_partial_aggr_ro 1.00E+000
6 . 7 esp_exchange 1:7(hash2) 1.00E+000
5 . 6 sort_partial_aggr_le 1.00E+000
4 2 5 hybrid_hash_join 1.53E+005
3 . 4 esp_exchange 7(hash2):8(hash2) 4.00E+005
. . 3 trafodion_scan PART 4.00E+005
1 . 2 esp_exchange 7(hash2):4(hash2) 1.53E+005
. . 1 trafodion_scan LINEITEM 1.53E+005

--- SQL operation complete.
>>execute xx;

PROMO_REVENUE
---------------------

               16.448

--- 1 row(s) selected.
>>get statistics for qid current;
Qid MXID11000050557212371659699857497000000000206U3333308T150000000_19_XX
Compile Start Time 2017/09/08 12:41:45.751039
Compile End Time 2017/09/08 12:41:54.318958
Compile Elapsed Time 0:00:08.567919
Execute Start Time 2017/09/08 12:41:54.371318
Execute End Time 2017/09/08 12:41:57.024031
Execute Elapsed Time 0:00:02.652713
State CLOSE
Rows Affected 0
SQL Error Code 100
Stats Error Code 0
Query Type SQL_SELECT_NON_UNIQUE
Sub Query Type SQL_STMT_NA
Estimated Accessed Rows 0
Estimated Used Rows 0
Parent Qid NONE
Parent Query System NONE
Child Qid NONE
Number of SQL Processes 9
Number of Cpus 1
Transaction Id -1
Source String select cast( (100.00 * sum(case when p_type like 'PROMO%' then 
l_extendedprice * (1 - l_discount) else 0 end) / sum(l_extendedprice * (1 - 
l_discount)) ) as numeric(18,3)) as promo_revenue from lineitem, part where 
l_partkey = p_partkey and l_shipdate >=
SQL Source Length 329
Rows Returned 1
First Row Returned Time 2017/09/08 12:41:57.022748
Last Error before AQR 0
Number of AQR retries 0
Delay before AQR 0
No. of times reclaimed 0
Cancel Time -1
Last Suspend Time -1
Query hash 7788260225241981733
SLA Name defaultSLA
Profile Name defaultProfile
No. of times executed 1
Min. Execute Time 2.652713 secs
Max. Execute Time 2.652713 secs
Avg. Execute Time 2.652713 secs
Stats Collection Type OPERATOR_STATS
SQL Process Busy Time 14,018,562
UDR Process Busy Time 0
SQL Space Allocated 48,416 KB
SQL Space Used 47,741 KB
SQL Heap Allocated 809 KB
SQL Heap Used 322 KB
SQL Heap WM 22,621 KB
Processes Created 8
Process Create Time 230,970
Request Message Count 2,803
Request Message Bytes 767,576
Reply Message Count 2,694
Reply Message Bytes 31,439,144
BMO Space Buffer Size 256
BMO Space Buffer Count 21
BMO Interim Row Count 154,291
Scr. Overflow Mode DISK
Scr. File Count 0
Scr. IO Size 0
Scr. Read Count 0
Scr. Write Count 0
Scr. IO Max Time 0
Sort TopN -1

   Id DOP Table Name
  EstRowsAccess ActRowsAccess EstRowsUsed ActRowsUsed SE_IOs SE_IO_KBytes 
SE_IO_SumTime SE_IO_MaxTime
    1 4 TRAF_QATEST:TRAFODION.G_TPCH2X.LINEITEM
              0 154,291 153,879 154,291 161 24,250 1,151,209 326,747
    6 8 TRAF_QATEST:TRAFODION.G_TPCH2X.PART
              0 400,000 400,000 400,000 402 70,986 1,490,487 320,272

--- SQL operation complete.
>>
>>-- Execute the following statement with <qid> from the output above.
>>-- select * from table(statistics(null, 'QID=<qid>'));
>>
>>select * from table(statistics(null, 
>>'QID=MXID11000050557212371659699857497000000000206U3333308T150000000_19_XX'));
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f9af8d67352, pid=50557, tid=140303659776480
#
# JRE version: Java(TM) SE Runtime Environment (8.0_60-b27) (build 1.8.0_60-b27)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.60-b23 mixed mode linux-amd64 
compressed oops)
# Problematic frame:
# C [libcommon.so+0x10a352] str_len(char const*)+0x2
#
# Core dump written. Default location: /home/trafodion/bugs/core or core.50557
#
# An error report file with more information is saved as:
# /home/trafodion/bugs/hs_err_pid50557.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp [^]
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)


Here is the stack trace of the core:

#0 0x00007f9afad005e5 in raise () from /lib64/libc.so.6
#1 0x00007f9afad01d4d in abort () from /lib64/libc.so.6
#2 0x00007f9afcb8e6b5 in os::abort(bool) ()
   from /usr/jdk64/jdk1.8.0_60/jre/lib/amd64/server/libjvm.so
#3 0x00007f9afcd2cbf3 in VMError::report_and_die() ()
   from /usr/jdk64/jdk1.8.0_60/jre/lib/amd64/server/libjvm.so
0000004 0x00007f9afcb93edf in JVM_handle_linux_signal ()
   from /usr/jdk64/jdk1.8.0_60/jre/lib/amd64/server/libjvm.so
0000005 0x00007f9afcb8a673 in signalHandler(int, siginfo*, void*) ()
   from /usr/jdk64/jdk1.8.0_60/jre/lib/amd64/server/libjvm.so
0000006 <signal handler called>
0000007 0x00007f9af8d67352 in str_len (
    s=0x500000000 <Address 0x500000000 out of bounds>) at ../common/str.cpp:458
0000008 0x00007f9af8d68f43 in str_sprintf (
    buffer=0x7f9abb366190 "statsRowType: 15 Qid: 
MXID11000050557212371659699857497000000000206U3333308T150000000_19_XX 
CompStartTime: 212371659705751039 CompEndTime: 212371659714318958 ExeStartTime: 
212371659714371318 ExeEndTim"...,
    format=0x7f9af94dd888 "statsRowType: %d Qid: %s CompStartTime: %Ld 
CompEndTime: %Ld ExeStartTime: %Ld ExeEndTime: %Ld CanceledTime: %Ld 
RowsAffected: %Ld SqlErrorCode: %d StatsErrorCode: %d State: %d StatsType: %d 
queryType"...)
    at ../common/str.cpp:723
0000009 0x00007f9af93ae133 in ExMasterStats::getVariableStatsInfo (
    this=<value optimized out>,
    dataBuffer=0x7f9abb366190 "statsRowType: 15 Qid: 
MXID11000050557212371659699857497000000000206U3333308T150000000_19_XX 
CompStartTime: 212371659705751039 CompEndTime: 212371659714318958 ExeStartTime: 
212371659714371318 ExeEndTim"...,
    dataLen=0x7f9abb36618e "", maxLen=<value optimized out>)
    at ../executor/ExStats.cpp:9008
0000010 0x00007f9af93b7325 in ExStatsTcb::getColumnValues (this=0x7f9afdbfa678,
    stat=0x7f9ac07cf740) at ../executor/ExStats.cpp:8174
0000011 0x00007f9af93c0c41 in ExStatsTcb::work (this=0x7f9afdbfa678)
    at ../executor/ExStats.cpp:7849
0000012 0x00007f9af939a81e in ExScheduler::work (this=0x7f9afdbfa1e0,
    prevWaitTime=<value optimized out>) at ../executor/ExScheduler.cpp:331
0000013 0x00007f9af92571d2 in ex_root_tcb::execute (this=0x7f9afdbfb3e0,
    cliGlobals=0x1a6c5a0, glob=0x7f9afdbc83e8, input_desc=0x7f9afdbe22f0,
    diagsArea=@0x7ffc0642caa0, reExecute=0) at ../executor/ex_root.cpp:1010
0000014 0x00007f9afaa70325 in CliStatement::execute (this=0x7f9afdbe30d0,
    cliGlobals=0x1a6c5a0, input_desc=0x7f9afdbe22f0, diagsArea=...,
    execute_state=<value optimized out>, fixupOnly=0, cliflags=0)
    at ../cli/Statement.cpp:3421
0000015 0x00007f9afa9f9aad in SQLCLI_PerformTasks(CliGlobals *, ULng32, 
SQLSTMT_ID *, SQLDESC_ID *, SQLDESC_ID *, Lng32, Lng32, typedef __va_list_tag 
__va_list_tag *, SQLCLI_PTR_PAIRS *, SQLCLI_PTR_PAIRS *) (cliGlobals=0x1a6c5a0, 
tasks=4882,
    statement_id=0x6a88900, input_descriptor=0x8f567a0, output_descriptor=0x0,
    num_input_ptr_pairs=0, num_output_ptr_pairs=0, ap=0x7ffc0642cc50,
    input_ptr_pairs=0x0, output_ptr_pairs=0x0) at ../cli/Cli.cpp:3237
0000016 0x00007f9afa9fa5f2 in SQLCLI_Exec(CliGlobals *, SQLSTMT_ID *, 
SQLDESC_ID *, Lng32, typedef __va_list_tag __va_list_tag *, SQLCLI_PTR_PAIRS *) 
(
    cliGlobals=<value optimized out>, statement_id=<value optimized out>,
    input_descriptor=<value optimized out>,
    num_ptr_pairs=<value optimized out>, ap=<value optimized out>,
    ptr_pairs=<value optimized out>) at ../cli/Cli.cpp:3484
0000017 0x00007f9afaa78c5b in SQL_EXEC_Exec (statement_id=0x6a88900,
    input_descriptor=0x8f567a0, num_ptr_pairs=0) at ../cli/CliExtern.cpp:2093
0000018 0x00007f9afd4a64eb in SqlCmd::doExec (sqlci_env=0x1a54aa0, 
stmt=0x6a88900,
    prep_stmt=<value optimized out>, numUnnamedParams=<value optimized out>,
    unnamedParamArray=<value optimized out>,
    unnamedParamCharSetArray=<value optimized out>, handleError=1)
    at ../sqlci/SqlCmd.cpp:1821
0000019 0x00007f9afd4a6f14 in SqlCmd::do_execute (sqlci_env=0x1a54aa0,
    prep_stmt=0x8e50f40, numUnnamedParams=0, unnamedParamArray=0x0,
    unnamedParamCharSetArray=0x0, prepcode=0) at ../sqlci/SqlCmd.cpp:2161
0000020 0x00007f9afd4a761d in DML::process (this=0x8f24850, sqlci_env=0x1a54aa0)
    at ../sqlci/SqlCmd.cpp:2936
0000021 0x00007f9afd49356c in SqlciEnv::executeCommands (this=0x1a54aa0,
    input_stmt=@0x7ffc0642e648) at ../sqlci/SqlciEnv.cpp:848
0000022 0x00007f9afd49590b in SqlciEnv::run (this=0x1a54aa0)
    at ../sqlci/SqlciEnv.cpp:657
0000023 0x00000000004021a9 in main (argc=1, argv=0x7ffc0642e858)
    at ../bin/SqlciMain.cpp:342




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to