This discussion is archived
5 Replies Latest reply: Aug 7, 2009 12:05 PM by LaurenFoutz RSS

Segmentation Fault

700448 Newbie
Currently Being Moderated
Hi-
I've experienced a segmentation fault from Berkeley DB XML Java bindings running in a web application (Tomcat). I'm not able to reproduce the error myself, but it's particularly troubling becasue it brought down the entire JVM that was running the web site. I'm not at all proficient with JNI, so maybe I'm not able to properly diagnose the problem from the logs. Below is the seg fault error that was logged by the JVM:
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x063966c3, pid=20961, tid=1839516576
#
# Java VM: Java HotSpot(TM) Server VM (11.3-b02 mixed mode linux-x86)
# Problematic frame:
# V  [libjvm.so+0x3966c3]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x08822c00):  JavaThread "http-8080-6" daemon [_thread_in_vm, id=21027, stack(0x6da2c000,0x6da4d000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000

Registers:
EAX=0x00000000, EBX=0x08b598d8, ECX=0x0006da4b, EDX=0x08822c00
ESP=0x6da4b6d4, EBP=0x6da4b738, ESI=0x00000ffc, EDI=0x6db77880
EIP=0x063966c3, CR2=0x00000000, EFLAGS=0x00010216

Top of Stack: (sp=0x6da4b6d4)
0x6da4b6d4:   00000000 67c9ecf8 67c9ece3 08b598d8
0x6da4b6e4:   6db77880 6db77888 6db77c74 08822c00
0x6da4b6f4:   00000000 00c5a1e3 6da4b718 08822c00
0x6da4b704:   6e000048 00000011 67d0b11c 08822c00
0x6da4b714:   0000001d 6da4b738 67c92fa4 08822d14
0x6da4b724:   08a64cb4 08c4cddc 67d0b11c 00000000
0x6da4b734:   0000001d 6da4b7f8 67c732db 08822d14
0x6da4b744:   00000000 00000000 67c9ece3 6da4b7d0 

Instructions: (pc=0x063966c3)
0x063966b3:   ac 8b 43 08 89 45 b0 8b 43 0c 89 45 b4 8b 45 0c
0x063966c3:   8b 00 50 e8 35 02 fe ff 83 ec 0c 89 c6 50 e8 72 

Stack: [0x6da2c000,0x6da4d000],  sp=0x6da4b6d4,  free space=125k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x3966c3]
C  [libdbxml_java-2.4.so+0x2612db]  _Z17createCPPXmlValueP7JNIEnv_P8_jobjectPb+0xd3
C  [libdbxml_java-2.4.so+0x26bbcd]  _Z24createCPPXmlQueryContextP7JNIEnv_P8_jobjectP7_jclass+0x969
C  [libdbxml_java-2.4.so+0x27f2ff]  Java_com_sleepycat_dbxml_dbxml_1javaJNI_XmlManager_1prepare_1_1SWIG_10+0xe7
j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7
j  com.mycompany.dao.xml.XmlDao.executeQuery(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Ljava/util/List;+14
j  com.mycompany.dao.xml.XMLArticleDAO.getArticleId(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+91
j  com.mycompany.service.impl.DefaultArticleService.getArticleIdFromUrl(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+7
j  com.mycompany.controller.Level3Controller.handleRequestInternal(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+236
j  org.springframework.web.servlet.mvc.AbstractController.handleRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+62
j  org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Object;)Lorg/springframework/web/servlet/ModelAndView;+6
j  org.springframework.web.servlet.DispatcherServlet.doDispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+224
j  org.springframework.web.servlet.DispatcherServlet.doService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+219
j  org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+10
j  org.springframework.web.servlet.FrameworkServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+3
j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+35
j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
j  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+374
j  org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+101
j  org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+804
j  org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+365
j  org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+64
j  org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+6
j  org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
j  org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+157
j  org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)V+432
j  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Z+82
j  org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+41
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub
V  [libjvm.so+0x375c9d]
V  [libjvm.so+0x5057f8]
V  [libjvm.so+0x3755b0]
V  [libjvm.so+0x37563d]
V  [libjvm.so+0x3e5ca5]
V  [libjvm.so+0x5cde5d]
V  [libjvm.so+0x506929]
C  [libpthread.so.0+0x53cc]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7
j  com.mycompany.dao.xml.XmlDao.executeQuery(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Ljava/util/List;+14
j  com.mycompany.dao.xml.XMLArticleDAO.getArticleId(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+91
j  com.mycompany.service.impl.DefaultArticleService.getArticleIdFromUrl(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+7
j  com.mycompany.controller.Level3Controller.handleRequestInternal(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+236
j  org.springframework.web.servlet.mvc.AbstractController.handleRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+62
j  org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Object;)Lorg/springframework/web/servlet/ModelAndView;+6
j  org.springframework.web.servlet.DispatcherServlet.doDispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+224
j  org.springframework.web.servlet.DispatcherServlet.doService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+219
j  org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+10
j  org.springframework.web.servlet.FrameworkServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+3
j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+35
j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
j  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+374
j  org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+101
j  org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+804
j  org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+365
j  org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+64
j  org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+6
j  org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
j  org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+157
j  org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)V+432
j  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Z+82
j  org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+41
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x088d4800 JavaThread "http-8080-8" daemon [_thread_blocked, id=21029, stack(0x66e7d000,0x66e9e000)]
  0x08b3d400 JavaThread "http-8080-7" daemon [_thread_blocked, id=21028, stack(0x6da0b000,0x6da2c000)]
=>0x08822c00 JavaThread "http-8080-6" daemon [_thread_in_vm, id=21027, stack(0x6da2c000,0x6da4d000)]
  0x08823400 JavaThread "http-8080-5" daemon [_thread_blocked, id=21022, stack(0x65cdf000,0x65d00000)]
  0x0881e000 JavaThread "http-8080-4" daemon [_thread_blocked, id=21019, stack(0x6da4d000,0x6da6e000)]
  0x08d75400 JavaThread "pool-2-thread-1" [_thread_blocked, id=21018, stack(0x660df000,0x66100000)]
  0x08976400 JavaThread "http-8080-3" daemon [_thread_blocked, id=21017, stack(0x6da6e000,0x6da8f000)]
  0x08976000 JavaThread "http-8080-2" daemon [_thread_blocked, id=21011, stack(0x6da8f000,0x6dab0000)]
  0x08c4c000 JavaThread "http-8080-1" daemon [_thread_blocked, id=21006, stack(0x6dd9d000,0x6ddbe000)]
  0x08b65000 JavaThread "TP-Monitor" daemon [_thread_blocked, id=21005, stack(0x6ddbe000,0x6dddf000)]
  0x08c5ec00 JavaThread "TP-Processor4" daemon [_thread_in_native, id=21004, stack(0x6dddf000,0x6de00000)]
  0x08c62c00 JavaThread "TP-Processor3" daemon [_thread_blocked, id=21003, stack(0x6df41000,0x6df62000)]
  0x08b66800 JavaThread "TP-Processor2" daemon [_thread_blocked, id=21002, stack(0x6df62000,0x6df83000)]
  0x08eab000 JavaThread "TP-Processor1" daemon [_thread_blocked, id=21001, stack(0x6df83000,0x6dfa4000)]
  0x08c53800 JavaThread "http-8080-Acceptor-0" daemon [_thread_in_native, id=21000, stack(0x6dfa4000,0x6dfc5000)]
  0x08c5d000 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=20999, stack(0x6df1c000,0x6df3d000)]
  0x08c9e400 JavaThread "pool-1-thread-1" [_thread_blocked, id=20998, stack(0x66ea5000,0x66ec6000)]
  0x08684800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=20996, stack(0x6e1e0000,0x6e201000)]
  0x08683000 JavaThread "CompilerThread1" daemon [_thread_blocked, id=20995, stack(0x6e201000,0x6e282000)]
  0x0867e800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=20994, stack(0x6e282000,0x6e303000)]
  0x0867d000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20993, stack(0x6e303000,0x6e324000)]
  0x0867b800 JavaThread "Surrogate Locker Thread (CMS)" daemon [_thread_blocked, id=20992, stack(0x6e324000,0x6e345000)]
  0x08668000 JavaThread "Finalizer" daemon [_thread_blocked, id=20991, stack(0x6e545000,0x6e566000)]
  0x08666c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=20990, stack(0x6e566000,0x6e587000)]
  0x08058800 JavaThread "main" [_thread_in_native, id=20962, stack(0xb7fc9000,0xb7fea000)]

Other Threads:
  0x08663400 VMThread [stack: 0x6e587000,0x6e608000] [id=20989]
  0x08686800 WatcherThread [stack: 0x6e15f000,0x6e1e0000] [id=20997]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 par new generation   total 471872K, used 261897K [0x70490000, 0x90490000, 0x90490000)
  eden space 419456K,  60% used [0x70490000, 0x7fb7eb48, 0x89e30000)
  from space 52416K,  17% used [0x89e30000, 0x8a703c70, 0x8d160000)
  to   space 52416K,   0% used [0x8d160000, 0x8d160000, 0x90490000)
 concurrent mark-sweep generation total 524288K, used 0K [0x90490000, 0xb0490000, 0xb0490000)
 concurrent-mark-sweep perm gen total 22400K, used 22275K [0xb0490000, 0xb1a70000, 0xb4490000)

***DYNAMIC LIBRARIES TRUNCATED (POST TOO LONG)***

VM Arguments:
jvm_args: -Xmx1024m -Xms1024m -Xmn512m -Xss128k
 -XX:ParallelGCThreads=20 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:SurvivorRatio=8 
-XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=31 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file=/opt/apps/tomcat-6.0.18/conf/logging.properties -Djava.endorsed.dirs=/opt/apps/tomcat-6.0.18/endorsed
 -Dcatalina.base=/opt/apps/tomcat-6.0.18 -Dcatalina.home=/opt/apps/tomcat-6.0.18 -Djava.io.tmpdir=/opt/apps/tomcat-6.0.18/temp 
java_command: org.apache.catalina.startup.Bootstrap start
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/opt/apps/php/bin:/opt/apps/apache2/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
LD_LIBRARY_PATH=/usr/java/jdk1.6.0_13/jre/lib/i386/server:/usr/java/jdk1.6.0_13/jre/lib/i386:/usr/java/jdk1.6.0_13/jre/../lib/i386:/opt/dbxml/lib
SHELL=/bin/bash

Signal Handlers:
SIGSEGV: [libjvm.so+0x6071f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [libjvm.so+0x6071f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGXFSZ: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x506d80], sa_mask[0]=0x00000000, sa_flags=0x10000004
SIGHUP: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGINT: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGTERM: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGQUIT: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004


---------------  S Y S T E M  ---------------

OS:Red Hat Enterprise Linux ES release 4 (Nahant Update 8)

uname:Linux 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686
libc:glibc 2.3.4 NPTL 2.3.4 
rlimit: STACK 10240k, CORE 0k, NPROC 32742, NOFILE 1024, AS infinity
load average:0.00 0.00 0.00

CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3

Memory: 4k page, physical 2073300k(27792k free), swap 5197384k(1995648k free)

vm_info: Java HotSpot(TM) Server VM (11.3-b02) for linux-x86 JRE (1.6.0_13-b03), built on Mar  9 2009 01:16:42 by "java_re" with gcc 3.2.1-7a (J2SE release)

time: Mon Jul  27 01:51:01 2009
elapsed time: 11252 seconds
I see some "thread blocked" statements, one of them being on the "Low Memory Detector" daemon. Not sure what to make of that.

This is the method chain (from what I can tell) that caused the error:
public String getArticleId(String type, String category, String normalizedTitle) 
          throws DAOException, DataNotFoundDAOException {
          XmlQueryContext context = null;
          try{
               context = this.getXmlManager().createQueryContext();
               context.setEvaluationType(context.Eager);
               context.setVariableValue("type", new XmlValue(type));
               context.setVariableValue("category", new XmlValue(category));
               context.setVariableValue("normalizedTitle", new XmlValue(normalizedTitle));
               context.setVariableValue("containerName", new XmlValue(this.getContainer().getName()));
               
               List<String> results = executeQuery(articleIdQuery, context);
               if(results.size()>1){
                    logger.warn(String.format("more than one article found for type:%s, category:%s, normalized-title:%s", type, category, normalizedTitle));
               }else if(results.size()==0){
                    throw new DataNotFoundDAOException(String.format("unable to find an article that matches type:%s, category:%s, normalized-title:%s", type, category, normalizedTitle));
               }
               /* dbxml returns query values far xml attributes in this format: {}id="this_is_the_id_we_want"
                * we must extract the id before returning 
                */
               String idString = results.get(0);
               return idString.substring(idString.indexOf("\"")+1, idString.length()-1);
          }catch (XmlException e) {
               throw new DAOException("there was a problem querying the database", e);
          } finally{
               context.delete();
          }
     }



     protected List<String> executeQuery(String query, XmlQueryContext context)
               throws DAOException {
          // Prepare (compile) the query
          List<String> xmlNodes = new ArrayList<String>();
          XmlQueryExpression qe = null;
          XmlResults results = null;
          try {
               qe = xmlManager.prepare(query, context);
               logger.debug("about to perform query: " + qe.getQuery());

               results = qe.execute(context);
               while (results.hasNext()) {
                    xmlNodes.add(results.next().asString());
               }
          } catch (XmlException e) {
               throw new DAOException("Unable to retrieve Page from db", e);
          } finally{
               if(results != null){
                    results.delete();
               }
               if(qe != null){
                    qe.delete();
               }
          }
          return xmlNodes;
     }
And this is the query that was passed into the method:
collection($containerName)/article[type=$type and category=$category and normalized-title=$normalizedTitle]/@id
Since this happened in a running web application, I unfortunately can't determine exactly which values were set for the query variables in this instance. However, by the nature of this application, those values are NOT taken from user input, so it would be safe to assume that the input comes from a valid, finite set of values.

Any help would be greatly appreciated.
Thanks

Edited by: eric44 on Jul 27, 2009 2:34 PM
  • 1. Re: Segmentation Fault
    LaurenFoutz Journeyer
    Currently Being Moderated
    Have you applied the consolidated patch (listed at the top of the forum) to your version of dbxml? I assume you are using 2.4.16. The consolidated patch has fixes for several bugs that could be causing your crash. If applying the patch does not fix your problem say so on the forum and I will look into your problem some more.

    Lauren Foutz
  • 2. Re: Segmentation Fault
    700448 Newbie
    Currently Being Moderated
    Thanks Lauren.
    I have not yet applied the patch. I will do so shortly. However, I was able to do a bit more tracing, and I think I've gotten to the root of the problem. The seg fault is happening when a null value is used in a query. That is, a Java variable whose value is null is used as the constructor argument to
    new XmlValue(String s)
    , and then that value is used in the query. I don't know exactly where the error is happening; the log seems a tad ambiguous. Again, I'm not really comfortable at the low-level, but it seems that the stack trace is rooted in the "prepare" java method, but then there seems to be some native trace directly referencing the creation of XmlValue
    Stack: [0x6da2c000,0x6da4d000],  sp=0x6da4b6d4,  free space=125k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x3966c3]
    C  [libdbxml_java-2.4.so+0x2612db]  _Z17createCPPXmlValueP7JNIEnv_P8_jobjectPb+0xd3
    C  [libdbxml_java-2.4.so+0x26bbcd]  _Z24createCPPXmlQueryContextP7JNIEnv_P8_jobjectP7_jclass+0x969
    C  [libdbxml_java-2.4.so+0x27f2ff]  Java_com_sleepycat_dbxml_dbxml_1javaJNI_XmlManager_1prepare_1_1SWIG_10+0xe7
    j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
    j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7
    thanks again
  • 3. Re: Segmentation Fault
    LaurenFoutz Journeyer
    Currently Being Moderated
    That looks like a know bug. The consolidated patch should fix it, but if it does not I will post a patch that does.

    Lauren Foutz
  • 4. Re: Segmentation Fault
    700448 Newbie
    Currently Being Moderated
    Hi Lauren-
    I have applied the patch against which I've run a unit test. The behavior is the same for the patch and unpatched versions: segmentation fault.
    I am running the test on a linux OS.

    However, using the 2.4.16 windows binaries, the same exact code throws the following exception:
    XmlException during helloWorldTxn: Error: A null XmlValue object cannot be added to the result set.
    Exception in thread "main" com.sleepycat.dbxml.XmlException: Error: A null XmlValue object cannot be added to the result set., errcode = INV
    ALID_VALUE
            at com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(Native Method)
            at com.sleepycat.dbxml.XmlManager.prepare(XmlManager.java:621)
            at TestQuery.main(TestQuery.java:125)
    This seems much safer :)
  • 5. Re: Segmentation Fault
    LaurenFoutz Journeyer
    Currently Being Moderated
    It is a know bug, and there is a patch for it but I see now that it was not included in the consolidated patch. There are two ways you can deal with this issue. I can send you the patch or you can alter your code to make sure that null is not used when setting values for XmlQueryContext and XmlValue or content for XmlDocument. If you want the patch then please email me at Lauren dot Foutz at this company.

    Lauren Foutz

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points