Spinning dbms_xmlQuery.newcontext (Doc ID 1286954.1)

Last updated on FEBRUARY 01, 2017

Applies to:

Oracle XML SQL Utility (XSU) - Version 11.1.0.7 and later
Information in this document applies to any platform.
***Checked for relevance on 22-Jan-2013***

Symptoms

An application that calls DBMS_XMLQUERY.NEWCONTEXT spins and never completes.

Below is a simple PL/SQL block that reproduces the issue

connect user/password
set echo on
set serveroutput on;
set timing on;

DECLARE
  p_query VARCHAR2(1000);
  l_ctx DBMS_XMLQUERY.ctxtype;
BEGIN

  dbms_output.put_line('Start of DBMS_XMLQUERY -- select 1 from dual');
  p_query := 'SELECT 1 FROM DUAL ORDER BY 1';

  l_ctx := DBMS_XMLQUERY.newcontext(p_query);
  dbms_output.put_line('End of DBMS_XMLQUERY -- select 1 from dual');

END;
/


The spinning process's short_stack shows

SQL> oradebug setospid <OSPID>
Oracle pid: 32, Unix process pid: 18324, image: oracle@celclnx7.us.oracle.com (TNS V1-V3)
SQL> oradebug short_stack
<-ksedsts()+315<-ksdxfstk()+32<-ksdxcb()+1764<-sspuser()+112<-000000392370C5B0<-joe_getfield()+987<-joe_run_vm()+11125<-joe_run()+440
<-joe_init_class()+2152<-joe_getstatic()+1311<-joe_run_vm()+11302<-joe_run()+440<-joe_init_class()+2152<-joevm_first_time_setup()+1567
<-joevm_invokerecursive()+127<-joe_run_vm()+17154<-joe_run()+440<-joe_invoke()+1093<-joet_aux_thread_main()+1826
<-seoa_note_stack_outside()+26<-joet_thread_main()+32<-sjontlo_initialize()+125<-joe_enter_vm()+1345<-ioei_call_java()+1686
<-ioesub_CALL_JAVA()+633<-seoa_note_stack_outside()+26<-ioe_call_java()+258<-jox_invoke_java_()+3868<-jox_invoke_java()+93
<-kkxmjexe()+1404<-kgmexwi()+674<-kgmexec()+1150<-pefjavacal()+1044<-pefcal()+501<-pevm_FCAL()+165<-pfrinstr_FCAL()+75<-pfrrun_no_tool
()+63<-pfrrun()+1287<-plsql_run()+865<-peicnt()+322<-kkxexe()+531<-opiexe()+16823<-kpoal8()+2810<-opiodr()+1220<-ttcpip()+1208
<-opitsk()+1449<-opiino()+1026<-opiodr()+1220<-opidrv()+580<-sou2o()+90<-opimai_real()+145<-ssthrdmain()+177
<-main()+215<-__libc_start_main()+219<-_start()+42
SQL>


A pstack of the same process shows

$ pstack <pid>
#0 0x0000000002dcb628 in joevm_invokevirtual ()
#1 0x0000000003113b7f in joe_run_vm ()
#2 0x0000000002db88dc in joe_run ()
#3 0x0000000002dd4a30 in joe_init_class ()
#4 0x0000000002dc5d37 in joe_getstatic ()
#5 0x00000000031102f6 in joe_run_vm ()
#6 0x0000000002db88dc in joe_run ()
#7 0x0000000002dd4a30 in joe_init_class ()
#8 0x0000000002dca147 in joevm_first_time_setup ()
#9 0x0000000002dccb77 in joevm_invokerecursive ()
#10 0x00000000031119d2 in joe_run_vm ()
#11 0x0000000002db88dc in joe_run ()
#12 0x0000000002dbbfb1 in joe_invoke ()
#13 0x0000000002de2014 in joet_aux_thread_main ()
#14 0x0000000002ce4658 in seoa_note_stack_outside ()
#15 0x0000000002de18ec in joet_thread_main ()
#16 0x0000000002ed1291 in sjontlo_initialize ()
#17 0x0000000002dba0a5 in joe_enter_vm ()
#18 0x0000000002ddb788 in ioei_call_java ()
#19 0x0000000002caef31 in ioesub_CALL_JAVA ()
#20 0x0000000002ce4658 in seoa_note_stack_outside ()
#21 0x0000000002caecae in ioe_call_java ()
#22 0x0000000006f51ecc in jox_invoke_java_ ()
#23 0x0000000004807b5f in jox_invoke_java ()
#24 0x00000000048072dc in kkxmjexe ()
...

Changes

The database was migrated from a 32-bit server to a 64-bit server.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms