Hi,

I have written a JMS Client, a plain Java Application using the Active MQ as
the JMS Broker.
I am not using the ActiveMQ's inbuilt facility of managing failover but have
written that piece of code myself. The code works fine when run as a pure
java application, but when I am invoking the same code from JNI ( from my
C++ App) it crashes ( generates segmentation fault ). The crash is observed
mostly when I connect/disconnect the Broker. Here is the PStack of the
segmentation fault generated.


Stack: [0x00007f26fc4c0000,0x00007f26fc5c1000],  sp=0x00007f26fc5bf4e0, 
free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native
code)
V  [libjvm.so+0x761172]  void
PSScavenge::copy_and_push_safe_barrier<oopDesc*>(PSPromotionManager*,
oopDesc**)+0x12
V  [libjvm.so+0x763ad0]  PSScavengeRootsClosure::do_oop(oopDesc**)+0x30
V  [libjvm.so+0x4409b1]  InterpreterFrameClosure::offset_do(int)+0x31
V  [libjvm.so+0x706026]  InterpreterOopMap::iterate_oop(OffsetClosure*)+0x86
V  [libjvm.so+0x43f80a]  frame::oops_interpreted_do(OopClosure*, RegisterMap
const*, bool)+0x19a
V  [libjvm.so+0x440461]  frame::oops_do_internal(OopClosure*,
CodeBlobClosure*, RegisterMap*, bool)+0xb1
V  [libjvm.so+0x81b973]  JavaThread::oops_do(OopClosure*,
CodeBlobClosure*)+0x1d3
V  [libjvm.so+0x76377d]  ThreadRootsTask::do_it(GCTaskManager*,
unsigned)+0xad
V  [libjvm.so+0x466efa]  GCTaskThread::run()+0x16a
V  [libjvm.so+0x710adf]  java_start(Thread*)+0x13f

JavaThread 0x0000000000893000 (nid = 20820) was being processed
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.lang.Object.wait(J)V+0
j  java.lang.Thread.join(J)V+38
j  java.lang.Thread.join()V+2
j  TestJMSClient2.main([Ljava/lang/String;)V+31
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x00007f268005a800 JavaThread "ActiveMQ Task-1" daemon [_thread_blocked,
id=21039, stack(0x00007f26e537e000,0x00007f26e547f000)]
  0x00007f267c002000 JavaThread "ActiveMQ InactivityMonitor Worker" daemon
[_thread_blocked, id=20996, stack(0x00007f26e4f7a000,0x00007f26e507b000)]
  0x00007f268006e800 JavaThread "ActiveMQ Transport:
tcp:///136.225.104.102:61716@63645" [_thread_in_native, id=20960,
stack(0x00007f26e507b000,0x00007f26e517c000)]
  0x00007f2684003000 JavaThread "ActiveMQ InactivityMonitor WriteCheckTimer"
daemon [_thread_blocked, id=20851,
stack(0x00007f26e517c000,0x00007f26e527d000)]
  0x00007f2684002000 JavaThread "ActiveMQ InactivityMonitor ReadCheckTimer"
daemon [_thread_blocked, id=20850,
stack(0x00007f26e527d000,0x00007f26e537e000)]
  0x00000000009af800 JavaThread "Thread-0" [_thread_blocked, id=20847,
stack(0x00007f26e5596000,0x00007f26e5697000)]
  0x0000000000938800 JavaThread "Low Memory Detector" daemon
[_thread_blocked, id=20845, stack(0x00007f26e5842000,0x00007f26e5943000)]
  0x0000000000936000 JavaThread "C2 CompilerThread1" daemon
[_thread_blocked, id=20844, stack(0x00007f26e5943000,0x00007f26e5a44000)]
  0x0000000000933000 JavaThread "C2 CompilerThread0" daemon
[_thread_blocked, id=20843, stack(0x00007f26e5a44000,0x00007f26e5b45000)]
  0x0000000000931000 JavaThread "Signal Dispatcher" daemon [_thread_blocked,
id=20842, stack(0x00007f26e5b45000,0x00007f26e5c46000)]
  0x0000000000914800 JavaThread "Finalizer" daemon [_thread_blocked,
id=20841, stack(0x00007f26e5c46000,0x00007f26e5d47000)]
  0x0000000000912800 JavaThread "Reference Handler" daemon [_thread_blocked,
id=20840, stack(0x00007f26e5d47000,0x00007f26e5e48000)]
  0x0000000000893000 JavaThread "main" [_thread_blocked, id=20820,
stack(0x00007fff78556000,0x00007fff78656000)]

It would be great if some one can help me on this.

Thanks,
Abhishek



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-Client-Crashing-when-called-from-JNI-tp4679145.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to