JStack find blocking reason - multithreading

I debug a JavaFx application which is getting a locked black screen ( does not react any more ) and high CPU usage.
It may be a hidden locking window or something related to modal dialogs. There is also an installer written in Swing which shows its own dialogs if new updates are comming, maybe this is conflicting with JavaFx ?
How may I find from the jstack output which is the reason ?
The application is using OpenJDK 11.
C:\Users\dprutean>jstack -m 9244
Error: -m option used
Cannot connect to core dump or remote debug server. Use jhsdb jstack instead
C:\Users\dprutean>jstack 9244
2020-01-14 08:03:11
Full thread dump OpenJDK 64-Bit Client VM (13+33 mixed mode):
Threads class SMR info:
_java_thread_list=0x0000000066bcb920, length=25, elements={
0x000000000394d000, 0x0000000003557000, 0x000000000357a800, 0x00000000035b3000,
0x00000000035b4800, 0x00000000035b6800, 0x00000000035b7800, 0x000000004d844000,
0x000000004d9aa800, 0x0000000055e65800, 0x0000000055e89800, 0x00000000560b8800,
0x0000000056447800, 0x00000000564cb800, 0x00000000564ae800, 0x00000000580a3000,
0x00000000582ab000, 0x00000000582a7000, 0x00000000582a6800, 0x00000000582ac800,
0x00000000582ad800, 0x00000000582aa000, 0x00000000582a8800, 0x00000000582a9800,
0x0000000067459000
}
"main" #1 prio=5 os_prio=0 cpu=468.75ms elapsed=43898.09s tid=0x000000000394d000 nid=0x6c4 waiting on condition [0x000000000312d000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base#13/Native Method)
- parking to wait for <0x00000000226c3cb8> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base#13/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(java.base#13/AbstractQueuedSynchronizer.java:885)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(java.base#13/AbstractQueuedSynchronizer.java:1039)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base#13/AbstractQueuedSynchronizer.java:1345)
at java.util.concurrent.CountDownLatch.await(java.base#13/CountDownLatch.java:232)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:213)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:156)
at javafx.application.Application.launch(Application.java:227)
at com.wisecoders.dbs.DbSchema.main(DbSchema.java:62)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base#13/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base#13/NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base#13/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base#13/Method.java:567)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
"Reference Handler" #2 daemon prio=10 os_prio=2 cpu=0.00ms elapsed=43898.03s tid=0x0000000003557000 nid=0x4498 waiting on condition [0x000000000389f000]
java.lang.Thread.State: RUNNABLE
at java.lang.ref.Reference.waitForReferencePendingList(java.base#13/Native Method)
at java.lang.ref.Reference.processPendingReferences(java.base#13/Reference.java:241)
at java.lang.ref.Reference$ReferenceHandler.run(java.base#13/Reference.java:213)
"Finalizer" #3 daemon prio=8 os_prio=1 cpu=0.00ms elapsed=43898.03s tid=0x000000000357a800 nid=0x586c in Object.wait() [0x000000004d2ff000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(java.base#13/Native Method)
- waiting on <no object reference available>
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:155)
- locked <0x0000000021f5dbd8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:176)
at java.lang.ref.Finalizer$FinalizerThread.run(java.base#13/Finalizer.java:170)
"Signal Dispatcher" #4 daemon prio=9 os_prio=2 cpu=0.00ms elapsed=43898.02s tid=0x00000000035b3000 nid=0x62f8 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Attach Listener" #5 daemon prio=5 os_prio=2 cpu=0.00ms elapsed=43898.02s tid=0x00000000035b4800 nid=0x6968 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C1 CompilerThread0" #6 daemon prio=9 os_prio=2 cpu=8578.13ms elapsed=43898.02s tid=0x00000000035b6800 nid=0x1ff8 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
No compile task
"Sweeper thread" #7 daemon prio=9 os_prio=2 cpu=7546.88ms elapsed=43898.02s tid=0x00000000035b7800 nid=0x11c0 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Service Thread" #8 daemon prio=9 os_prio=0 cpu=15.63ms elapsed=43898.00s tid=0x000000004d844000 nid=0x6134 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Common-Cleaner" #9 daemon prio=8 os_prio=1 cpu=0.00ms elapsed=43897.96s tid=0x000000004d9aa800 nid=0x2444 in Object.wait() [0x000000004e02f000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(java.base#13/Native Method)
- waiting on <no object reference available>
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:155)
- locked <0x0000000021fea588> (a java.lang.ref.ReferenceQueue$Lock)
at jdk.internal.ref.CleanerImpl.run(java.base#13/CleanerImpl.java:148)
at java.lang.Thread.run(java.base#13/Thread.java:830)
at jdk.internal.misc.InnocuousThread.run(java.base#13/InnocuousThread.java:134)
"Java2D Disposer" #10 daemon prio=10 os_prio=2 cpu=0.00ms elapsed=43896.89s tid=0x0000000055e65800 nid=0x670c in Object.wait() [0x000000005675f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(java.base#13/Native Method)
- waiting on <no object reference available>
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:155)
- locked <0x000000002244e758> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:176)
at sun.java2d.Disposer.run(java.desktop#13/Disposer.java:144)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"AWT-Windows" #12 daemon prio=6 os_prio=0 cpu=0.00ms elapsed=43896.85s tid=0x0000000055e89800 nid=0x50ac runnable [0x0000000056b5e000]
java.lang.Thread.State: RUNNABLE
at sun.awt.windows.WToolkit.eventLoop(java.desktop#13/Native Method)
at sun.awt.windows.WToolkit.run(java.desktop#13/WToolkit.java:312)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"JavaFX-Launcher" #16 prio=5 os_prio=0 cpu=296.88ms elapsed=43896.53s tid=0x00000000560b8800 nid=0x4494 waiting on condition [0x0000000057abf000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base#13/Native Method)
- parking to wait for <0x00000000227025c0> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base#13/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(java.base#13/AbstractQueuedSynchronizer.java:885)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(java.base#13/AbstractQueuedSynchronizer.java:1039)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base#13/AbstractQueuedSynchronizer.java:1345)
at java.util.concurrent.CountDownLatch.await(java.base#13/CountDownLatch.java:232)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:856)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at com.sun.javafx.application.LauncherImpl$$Lambda$160/0x00000000575c7500.run(Unknown Source)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"QuantumRenderer-0" #17 daemon prio=5 os_prio=0 cpu=664781.25ms elapsed=43896.27s tid=0x0000000056447800 nid=0xaa8 runnable [0x0000000057f1e000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base#13/Native Method)
- parking to wait for <0x00000000226c44a0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(java.base#13/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base#13/AbstractQueuedSynchronizer.java:2081)
at java.util.concurrent.LinkedBlockingQueue.take(java.base#13/LinkedBlockingQueue.java:433)
at java.util.concurrent.ThreadPoolExecutor.getTask(java.base#13/ThreadPoolExecutor.java:1054)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base#13/ThreadPoolExecutor.java:1114)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base#13/ThreadPoolExecutor.java:628)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"InvokeLaterDispatcher" #19 daemon prio=5 os_prio=0 cpu=903656.25ms elapsed=43896.21s tid=0x00000000564cb800 nid=0x5514 in Object.wait() [0x0000000058fff000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.lang.Object.wait(java.base#13/Native Method)
- waiting on <no object reference available>
at java.lang.Object.wait(java.base#13/Object.java:326)
at com.sun.glass.ui.InvokeLaterDispatcher.run(InvokeLaterDispatcher.java:127)
- locked <0x00000000226c47f8> (a java.lang.StringBuilder)
"JavaFX Application Thread" #20 prio=5 os_prio=0 cpu=1590890.63ms elapsed=43896.21s tid=0x00000000564ae800 nid=0xb94 runnable [0x00000000590fe000]
java.lang.Thread.State: RUNNABLE
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at com.sun.glass.ui.win.WinApplication$$Lambda$202/0x0000000057b674a8.run(Unknown Source)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"Thread-2" #21 daemon prio=5 os_prio=0 cpu=12703.13ms elapsed=43896.15s tid=0x00000000580a3000 nid=0x28f0 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Prism Font Disposer" #22 daemon prio=10 os_prio=2 cpu=0.00ms elapsed=43895.38s tid=0x00000000582ab000 nid=0x4bf0 in Object.wait() [0x00000000613bf000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(java.base#13/Native Method)
- waiting on <no object reference available>
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:155)
- locked <0x000000002298ecb0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:176)
at com.sun.javafx.font.Disposer.run(Disposer.java:93)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"pool-4-thread-1" #25 prio=5 os_prio=0 cpu=937.50ms elapsed=43894.26s tid=0x00000000582a7000 nid=0x41b0 waiting on condition [0x000000005714f000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base#13/Native Method)
- parking to wait for <0x00000000233fab90> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(java.base#13/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base#13/AbstractQueuedSynchronizer.java:2081)
at java.util.concurrent.LinkedBlockingQueue.take(java.base#13/LinkedBlockingQueue.java:433)
at java.util.concurrent.ThreadPoolExecutor.getTask(java.base#13/ThreadPoolExecutor.java:1054)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base#13/ThreadPoolExecutor.java:1114)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base#13/ThreadPoolExecutor.java:628)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"pool-2-thread-1" #26 prio=5 os_prio=0 cpu=0.00ms elapsed=43894.26s tid=0x00000000582a6800 nid=0x4bc4 waiting on condition [0x000000005724f000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base#13/Native Method)
- parking to wait for <0x0000000022b2e718> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(java.base#13/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base#13/AbstractQueuedSynchronizer.java:2081)
at java.util.concurrent.LinkedBlockingQueue.take(java.base#13/LinkedBlockingQueue.java:433)
at java.util.concurrent.ThreadPoolExecutor.getTask(java.base#13/ThreadPoolExecutor.java:1054)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base#13/ThreadPoolExecutor.java:1114)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base#13/ThreadPoolExecutor.java:628)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"Cleaner-0" #30 daemon prio=8 os_prio=1 cpu=0.00ms elapsed=43893.73s tid=0x00000000582ac800 nid=0x59cc in Object.wait() [0x000000006395e000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(java.base#13/Native Method)
- waiting on <no object reference available>
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:155)
- locked <0x00000000232a2c60> (a java.lang.ref.ReferenceQueue$Lock)
at jdk.internal.ref.CleanerImpl.run(java.base#13/CleanerImpl.java:148)
at java.lang.Thread.run(java.base#13/Thread.java:830)
at jdk.internal.misc.InnocuousThread.run(java.base#13/InnocuousThread.java:134)
"mysql-cj-abandoned-connection-cleanup" #31 daemon prio=5 os_prio=0 cpu=0.00ms elapsed=43893.28s tid=0x00000000582ad800 nid=0xf10 in Object.wait() [0x0000000063c5e000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(java.base#13/Native Method)
- waiting on <no object reference available>
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:155)
- locked <0x0000000023527618> (a java.lang.ref.ReferenceQueue$Lock)
at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:85)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base#13/ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base#13/ThreadPoolExecutor.java:628)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"mysql-cj-abandoned-connection-cleanup" #32 daemon prio=5 os_prio=0 cpu=0.00ms elapsed=43893.15s tid=0x00000000582aa000 nid=0x1cf8 in Object.wait() [0x0000000065d5e000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(java.base#13/Native Method)
- waiting on <no object reference available>
at java.lang.ref.ReferenceQueue.remove(java.base#13/ReferenceQueue.java:155)
- locked <0x00000000237ccbd8> (a java.lang.ref.ReferenceQueue$Lock)
at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:85)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base#13/ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base#13/ThreadPoolExecutor.java:628)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"TimerQueue" #33 daemon prio=5 os_prio=0 cpu=0.00ms elapsed=43892.89s tid=0x00000000582a8800 nid=0x597c waiting on condition [0x000000006605e000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base#13/Native Method)
- parking to wait for <0x00000000237cce78> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(java.base#13/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base#13/AbstractQueuedSynchronizer.java:2081)
at java.util.concurrent.DelayQueue.take(java.base#13/DelayQueue.java:217)
at javax.swing.TimerQueue.run(java.desktop#13/TimerQueue.java:171)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"DbSchema: Reverse engineering pre-fetch" #42 prio=5 os_prio=0 cpu=890.63ms elapsed=43885.08s tid=0x00000000582a9800 nid=0x2cf8 waiting on condition [0x00000000579bf000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base#13/Native Method)
- parking to wait for <0x0000000022b2e718> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(java.base#13/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base#13/AbstractQueuedSynchronizer.java:2081)
at java.util.concurrent.LinkedBlockingQueue.take(java.base#13/LinkedBlockingQueue.java:433)
at java.util.concurrent.ThreadPoolExecutor.getTask(java.base#13/ThreadPoolExecutor.java:1054)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base#13/ThreadPoolExecutor.java:1114)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base#13/ThreadPoolExecutor.java:628)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"DbSchema: Browse Task" #50 prio=5 os_prio=0 cpu=312.50ms elapsed=43855.36s tid=0x0000000067459000 nid=0x5f98 waiting on condition [0x000000005734f000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base#13/Native Method)
- parking to wait for <0x0000000022b2e718> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(java.base#13/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base#13/AbstractQueuedSynchronizer.java:2081)
at java.util.concurrent.LinkedBlockingQueue.take(java.base#13/LinkedBlockingQueue.java:433)
at java.util.concurrent.ThreadPoolExecutor.getTask(java.base#13/ThreadPoolExecutor.java:1054)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base#13/ThreadPoolExecutor.java:1114)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base#13/ThreadPoolExecutor.java:628)
at java.lang.Thread.run(java.base#13/Thread.java:830)
"VM Thread" os_prio=2 cpu=11859.38ms elapsed=43898.04s tid=0x0000000003553000 nid=0x4d64 runnable
"VM Periodic Task Thread" os_prio=2 cpu=31.25ms elapsed=43898.00s tid=0x000000004d844800 nid=0x6950 waiting on condition
JNI global refs: 116, weak refs: 14

It seems like that thread named "JavaFX Application Thread" has a looping execution,cause hign cpu usage.

Related

Why does my app crash after using MediaPlayer after hitting a button?

This is my first post on stack overflow. So my app keeps stopping after I hit a button that should play a censor noise. It just crashes.
I tried looking up various solutions but nothing is coming up.
package com.example.soundbutton;
import androidx.appcompat.app.AppCompatActivity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity{
Button bleep;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bleep = (Button) findViewById(R.id.bleep);
final MediaPlayer bleepMP = MediaPlayer.create(this, R.raw.censor);
bleep.setOnClickListener(new View.OnClickListener(){
#Override
public void onClick(View V) {
bleepMP.start();
}
});
}
}
Below is information after running through and emulator. I am still not too sure what exactly i am looking at. From what i can infer, it would seem as if i am pointing to some null value. I tried initializing the mp value as a null and setting a condition where if it were null, then it would start the onclick.
Here is the information after running in an emulator `code`11/20 14:20:48: Launching 'app' on Pixel XL API 29.
$ adb shell am start -n "com.example.soundbutton/com.example.soundbutton.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process to come online...
Connected to process 21565 on device 'emulator-5554'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/ple.soundbutto: Not late-enabling -Xcheck:jni (already on)
E/ple.soundbutto: Unknown bits set in runtime_flags: 0x8000
W/ple.soundbutto: Unexpected CPU variant for X86 using defaults: x86
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
W/RenderThread: type=1400 audit(0.0:53): avc: denied { write } for name="property_service" dev="tmpfs" ino=7228 scontext=u:r:untrusted_app:s0:c136,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=com.example.soundbutton
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/ple.soundbutto: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
E/MediaPlayerNative: error (1, -2147483648)
D/MediaPlayer: create failed:
java.io.IOException: Prepare failed.: status=0x1
at android.media.MediaPlayer._prepare(Native Method)
at android.media.MediaPlayer.prepare(MediaPlayer.java:1274)
at android.media.MediaPlayer.create(MediaPlayer.java:977)
at android.media.MediaPlayer.create(MediaPlayer.java:948)
at com.example.soundbutton.MainActivity.onCreate(MainActivity.java:20)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
D/HostConnection: HostConnection::get() New Host Connection established 0xd9bd3fa0, tid 21629
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xe51d4400: maj 3 min 1 rcv 4
D/EGL_emulation: eglMakeCurrent: 0xe51d4400: ver 3 1 (tinfo 0xf04c02e0)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
glUtilsParamSize: unknow param 0x000082da
W/Gralloc3: mapper 3.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xd9bd5800, tid 21629
HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_1
D/eglCodecCommon: allocate: Ask for block of size 0x1000
D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3ff1dc000 size 0x2000
D/EGL_emulation: eglMakeCurrent: 0xe51d4400: ver 3 1 (tinfo 0xf04c02e0)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
I/Choreographer: Skipped 43 frames! The application may be doing too much work on its main thread.
W/MediaPlayer-JNI: MediaPlayer finalized without being released
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.soundbutton, PID: 21565
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference
at com.example.soundbutton.MainActivity$1.onClick(MainActivity.java:25)
at android.view.View.performClick(View.java:7125)
at android.view.View.performClickInternal(View.java:7102)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27336)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Process 21565 terminated.

Cassandra File too Large Error on Start Up

When restarting a node in my cluster I sometimes get this error message
INFO [IndexSummaryManager:1] 2016-04-12 19:32:53,574 IndexSummaryRedistribution.java:74 - Redistributing index summaries
ERROR [HintsWriteExecutor:1] 2016-04-12 20:02:15,636 CassandraDaemon.java:195 - Exception in thread Thread[HintsWriteExecutor:1,5,main]
org.apache.cassandra.io.FSWriteError: java.nio.file.FileSystemException: bin/../data/hints/389cb0d3-87b9-4221-8352-065e8ce50fdb-1460462523225-1.crc32: File too large
at org.apache.cassandra.hints.HintsWriter.writeChecksum(HintsWriter.java:116) ~[apache-cassandra-3.2.1.jar:3.2.1]
at org.apache.cassandra.hints.HintsWriter.close(HintsWriter.java:124) ~[apache-cassandra-3.2.1.jar:3.2.1]
at org.apache.cassandra.hints.HintsStore.closeWriter(HintsStore.java:201) ~[apache-cassandra-3.2.1.jar:3.2.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_72]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_72]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_72]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
Caused by: java.nio.file.FileSystemException: bin/../data/hints/389cb0d3-87b9-4221-8352-065e8ce50fdb-1460462523225-1.crc32: File too large
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[na:1.8.0_72]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_72]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_72]
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[na:1.8.0_72]
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) ~[na:1.8.0_72]
at java.nio.file.Files.newOutputStream(Files.java:216) ~[na:1.8.0_72]
at org.apache.cassandra.hints.HintsWriter.writeChecksum(HintsWriter.java:110) ~[apache-cassandra-3.2.1.jar:3.2.1]
... 7 common frames omitted
The node then starts shutting down, but gets stuck repeated throwing an exception and retrying every few seconds. This is the main problem for me because it stopped the cluster from accepting connections
ERROR [HintsWriteExecutor:1] 2016-04-12 20:02:15,638 StorageService.java:440 - Stopping gossiper
WARN [HintsWriteExecutor:1] 2016-04-12 20:02:15,651 StorageService.java:347 - Stopping gossip by operator request
INFO [HintsWriteExecutor:1] 2016-04-12 20:02:15,651 Gossiper.java:1455 - Announcing shutdown
DEBUG [HintsWriteExecutor:1] 2016-04-12 20:02:15,653 StorageService.java:1921 - Node /169.34.103.150 state shutdown, token [-1028691827956217809, -1257393635657191129, -1285475466194230655, -1398822673992383910, -1549844858878358481, -1638651369075180065, -1660825917518666149, -1802478872312866489, -1834618755337322564, -188187624477415935, -2034018930607672685, -210049110249018365, -2157250079133002505, -2171215058533514263, -2183510006393476006, -2193567329545672696, -2317710820662725097, -2319735333341559730, -2333531623390263516, -2458839661565177963, -2489690089103800827, -2710032230533922787, -2780200665893123668, -283628639049224915, -2886550293705646069, -293132189636842303, -2945647150702034785, -2965944925251907629, -2990231874502594267, -2991676811317743630, -2997538046339800243, -3176643432551515484, -3176889844544735478, -3201806929871841501, -3211631881211211792, -322057073400957538, -3242716520974847469, -3424682940569182570, -3441313897213257083, -3448874645237774640, -3452014929671888774, -3487048220426765500, -3523033168154067409, -3738270231064896111, -3792947624538231469, -3850123184653095411, -3859434367535677710, -3993763147657603241, -4010731345091378481, -4258687888114256086, -429860111391304244, -4318544125783476774, -4471769468265919226, -4588065176944445932, -4669765414071774677, -4670558952147294236, -4710259358376415554, -4907784900060021493, -4934593823248165235, -4934821923831720820, -5013288056003569837, -5110268421077583856, -5133973510660140774, -5159515181162633178, -5276029184678521021, -5286266972273013716, -540287937883749850, -5456649087226389873, -5495658378651725051, -5501165049612471047, -5535468008960837763, -5716046948204274477, -5721008906555397374, -5753456205099778029, -5770577886564351775, -5790919034460455792, -5929058167490034525, -5943865033771694477, -608562636816376813, -6109108822129963089, -6140834685397419488, -6170120179807852740, -6179956847809119210, -6245955388738336647, -6286189790411746933, -6299162407942815080, -6315904471665416400, -6364734987085439789, -6419018190136685454, -6451287738650323275, -6547213964231430849, -6548484474977763138, -6549052151069571925, -6698516302891374040, -6872407277556537836, -6901128430416607497, -6935384932230430038, -6937998036050345125, -7031528786091227188, -7106019277455303867, -7119774336125808637, -7191744312745689956, -7225558820114789693, -7349977359560186580, -7422626834116218143, -7431995410347149964, -7466585374358878727, -750799820874518113, -7610594360825096930, -7616154542884798259, -7629884030042898550, -7728553164832596613, -7789353727430662940, -779402220858888622, -7843332228444504745, -7854439386306622129, -815495344326874929, -8338520822777210140, -8649102261484559375, -8796027903791901112, -8898390484583881495, -8923261220379460832, -8943079358447105951, -9050583546904370510, -9080494386502531561, -9139630196350606101, -939306213156730751, -942614916980620152, 1049830730407134075, 1125127596836820990, 1133356003300268705, 1133623932124213230, 1247043876318218235, 1490023295198042772, 1497436537080113324, 1516791905674857253, 1603966065250122923, 1646125781869948326, 1740544126107535998, 1756218012030701589, 1804735370513211257, 1812139850525677114, 1819880350303805394, 1841691686666460445, 1888363141244474676, 2010883847009222978, 2016297526252235227, 2021110586668181290, 2084880932156441613, 2093427980091185166, 2112052724153374980, 2186638483475842552, 2195406825247987731, 2283720951686386464, 23875829161989945, 2521818329391092608, 2522645057607851918, 2524720168145693638, 2541003400153964040, 2650684785592761012, 2723290502273715430, 2808119513098478236, 2821997019638778146, 2891379770529557184, 2907285214187020532, 2963307217336709534, 3061757915053031951, 3122571062025066142, 3128771694670016319, 3130206542424936603, 3197285318974197102, 3218987271686146429, 3329594065878248111, 3331926835266199716, 3526280986313508860, 3542343528340649978, 3589794725284000659, 3610364312437568329, 3701861372719378732, 373747767999916658, 3826422069022675393, 3856151860383170644, 3862031127704782057, 4049338078570571707, 4137865494092400430, 4241199357440741315, 4520402233521387342, 456519309520244643, 4715328215899051522, 4817677510120292180, 497627869146346949, 4995322204306807081, 5030633110404844305, 5038572404428039197, 5042627643214511398, 5281377762367584052, 5494577271219306513, 5530410713928998603, 5537215727145277166, 567120218785751902, 575743986375007756, 5784212620383428248, 5837914425280614947, 5977153680566647690, 5996674261833528410, 6083452088392300601, 6112178449036583235, 6264713703969393897, 6287772759341778176, 6314363909221383341, 6321343658409071604, 6475821468968027456, 6543311556613206558, 6912492987521221000, 6922280123185191829, 694545242943535806, 7183280296372529849, 7306070312091628992, 7412331756775823975, 7518294356359523088, 7567542433462808235, 7589810674525331548, 7637277610587157806, 773319528418720822, 7760484456189230502, 7816590204960057932, 7820991841796591957, 7836345109808448402, 7859570796753174, 8003409347394992259, 8012927612089894493, 8031750463661605171, 8051744553293723603, 8066222841813137181, 8073294271415597086, 8117861819974218900, 817982542709209563, 8198846486095494968, 8214665766962397555, 8277428606113435880, 8279100634451559360, 8316406004646641445, 8367052745804770548, 8373819718798220972, 8439087240414018142, 8444359473760446267, 8449256096936507263, 8717779586961798956, 8912188109780463904, 8920579922439529433, 8951968899880736480, 9043168611036813220, 9044578575232639242, 9045812874827336349, 9140634849238500115, 915715308827014103]
INFO [HintsWriteExecutor:1] 2016-04-12 20:02:15,653 StorageService.java:1924 - Node /169.34.103.150 state jump to shutdown
DEBUG [PendingRangeCalculator:1] 2016-04-12 20:02:15,655 PendingRangeCalculatorService.java:64 - finished calculation for 74 keyspaces in 0ms
ERROR [HintsWriteExecutor:1] 2016-04-12 20:02:17,655 StorageService.java:450 - Stopping native transport
INFO [HintsWriteExecutor:1] 2016-04-12 20:02:17,705 Server.java:182 - Stop listening for CQL clients
ERROR [HintsWriteExecutor:1] 2016-04-12 20:02:23,219 CassandraDaemon.java:195 - Exception in thread Thread[HintsWriteExecutor:1,5,main]
org.apache.cassandra.io.FSWriteError: java.nio.channels.ClosedChannelException
at org.apache.cassandra.hints.HintsWriter.newSession(HintsWriter.java:146) ~[apache-cassandra-3.2.1.jar:3.2.1]
at org.apache.cassandra.hints.HintsWriteExecutor.flushInternal(HintsWriteExecutor.java:221) ~[apache-cassandra-3.2.1.jar:3.2.1]
at org.apache.cassandra.hints.HintsWriteExecutor.flush(HintsWriteExecutor.java:203) ~[apache-cassandra-3.2.1.jar:3.2.1]
at org.apache.cassandra.hints.HintsWriteExecutor.lambda$flush$217(HintsWriteExecutor.java:196) ~[apache-cassandra-3.2.1.jar:3.2.1]
at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4649) ~[na:1.8.0_72]
at org.apache.cassandra.hints.HintsWriteExecutor.flush(HintsWriteExecutor.java:196) ~[apache-cassandra-3.2.1.jar:3.2.1]
at org.apache.cassandra.hints.HintsWriteExecutor.access$000(HintsWriteExecutor.java:36) ~[apache-cassandra-3.2.1.jar:3.2.1]
at org.apache.cassandra.hints.HintsWriteExecutor$FlushBufferPoolTask.run(HintsWriteExecutor.java:155) ~[apache-cassandra-3.2.1.jar:3.2.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_72]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_72]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_72]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
Caused by: java.nio.channels.ClosedChannelException: null
at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:110) ~[na:1.8.0_72]
at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:300) ~[na:1.8.0_72]
at org.apache.cassandra.hints.HintsWriter.newSession(HintsWriter.java:142) ~[apache-cassandra-3.2.1.jar:3.2.1]
... 12 common frames omitted
I googled around a bit and think the initial exception is caused by the node trying to replay a hint that is very large and it cant load.
I tried to find some parameters that can prevent this, but all I could find was turning off hint handoff (hinted_handoff_enabled) or reducing the time hint handoff runs for (max_hint_window_in_ms). I don't think I can live with an inconsistent cluster and was hoping for an option to split the hints into multiple files, but couldn't find such an option.
Has anyone seen this issue before? Is there a way to split hints into multiple files? How else might I deal with this?
EDIT: I hunted through my config and found this
max_hints_file_size_in_mb: 128
That seems pretty concervative to me, given the machine I'm running on. If my hints are limited to 128MB then I really dont understand why I have the above exception.
When run on this node nodetool threw an exception. Other nodes were ok, but I only ran nodetool the next morning (12 hours after the exception).
The file the exception complains about is no longer there, but the file name should be ok because I have many other files with similar names (same length). It is interesting the the exception is complaining about a .crc32 file (not a .hint file)

Drools - fireUntilHalt locks on KnowledgeBase

I have a daemon thread that calls kieSession.fireUntilHalt. And facts are inserted from other threads (http).
At some point the 'firing' thread gets into "Waiting" state and never returns. So the other facts inserting threads are blocked on this thread.
Rule Firing Thread Stack:
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:867)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197)
at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:945)
at org.drools.core.common.UpgradableReentrantReadWriteLock.lowPriorityWriteLock(UpgradableReentrantReadWriteLock.java:109)
at org.drools.core.common.UpgradableReentrantReadWriteLock.writeLock(UpgradableReentrantReadWriteLock.java:95)
at org.drools.core.impl.KnowledgeBaseImpl.lock(KnowledgeBaseImpl.java:684)
at org.drools.core.reteoo.builder.PatternBuilder.attachObjectTypeNode(PatternBuilder.java:275)
at org.drools.core.reteoo.ClassObjectTypeConf. (ClassObjectTypeConf.java:107)
at org.drools.core.common.ObjectTypeConfigurationRegistry.getObjectTypeConf(ObjectTypeConfigurationRegistry.java:72)
at org.drools.core.reteoo.AccumulateNode.createResultFactHandle(AccumulateNode.java:149)
at org.drools.core.phreak.PhreakAccumulateNode.evaluateResultConstraints(PhreakAccumulateNode.java:683)
at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:89)
at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:563)
at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:534)
at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334)
at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161)
at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116)
at org.drools.core.phreak.RuleExecutor.evaluateNetwork(RuleExecutor.java:77)
- locked [0x00000000fe586af0] (a org.drools.core.phreak.RuleExecutor)
at org.drools.core.common.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:990)
- locked [0x000000008ad60cd8] (a java.util.LinkedList)
at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:945)
at org.drools.core.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1190)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:1283)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:1260)
at com.comp.narch.lfc.decision.rules.util.FireUntilHaltSpawn.call(FireUntilHaltSpawn.java:21)
at com.comp.narch.lfc.decision.rules.util.FireUntilHaltSpawn.call(FireUntilHaltSpawn.java:11)
Fact Inserting Thread (blocked) Stack:
at org.drools.core.common.DefaultAgenda.addEagerRuleAgendaItem(DefaultAgenda.java:282)
- waiting to lock [0x000000008ad60cd8] (a java.util.LinkedList)
at org.drools.core.reteoo.PathMemory.queueRuleAgendaItem(PathMemory.java:153)
at org.drools.core.reteoo.PathMemory.doLinkRule(PathMemory.java:120)
- locked [0x00000000fe586928] (a org.drools.core.reteoo.PathMemory)
at org.drools.core.reteoo.PathMemory.linkSegment(PathMemory.java:90)
at org.drools.core.reteoo.SegmentMemory.notifyRuleLinkSegment(SegmentMemory.java:170)
at org.drools.core.reteoo.LeftInputAdapterNode$LiaNodeMemory.setNodeDirty(LeftInputAdapterNode.java:647)
at org.drools.core.reteoo.LeftInputAdapterNode.doInsertSegmentMemory(LeftInputAdapterNode.java:277)
at org.drools.core.reteoo.LeftInputAdapterNode.doInsertObject(LeftInputAdapterNode.java:229)
at org.drools.core.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:197)
at org.drools.core.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:502)
at org.drools.core.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:387)
at org.drools.core.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:288)
at org.drools.core.reteoo.EntryPointNode.assertObject(EntryPointNode.java:251)
at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:367)
at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:286)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:1430)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:1372)
at com.comp.narch.lfc.service.impl.DefaultServiceInstanceMgmtServiceImpl.newAppMetric(DefaultServiceInstanceMgmtServiceImpl.java:84)
Drools Version - 6.1.0.Final

Threading: PyQt crashes with "unknown request in queue while dequeuing"

One part of an application I'm developing needs to send some emails to a small group of people. Since it may take a little while to connect to the SMTP server and send the emails, I want to provide a progress bar during this operation using a background thread to do the work.
What happens now is that I can implement a test structure that works just fine, but then as soon as I try to create an object from the backend of my application to actually do any emailing operations, it crashes completely (as though it had segfaulted), dumping this to the console:
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted
The only relevant thread I found searching for these errors said something about the signals being implemented wrong (for PySide, PySide and QProgressBar update in a different thread), but in my case the signals work totally fine until I try to create that object (which isn't based on Qt classes at all).
Here's a simplified version of my GUI code:
class SendingDialog(QtGui.QDialog):
def __init__(self, parent, optsDict, cls, zid):
QtGui.QDialog.__init__(self)
self.form = Ui_Dialog()
self.form.setupUi(self)
# initialize some class variables...
self.beginConnect()
self.thread = WorkerThread()
self.thread.insertOptions(self.opts, self.cls, self.zid)
self.thread.finished.connect(self.endOfThread)
self.thread.serverContacted.connect(self.startProgress)
self.thread.aboutToEmail.connect(self.updateProgress)
self.thread.start()
def beginConnect(self):
# start busy indicator
def startProgress(self):
# set up progress bar
def updateProgress(self):
# increment progress bar
def endOfThread(self):
self.thread.quit()
self.reject()
class WorkerThread(QtCore.QThread):
serverContacted = QtCore.pyqtSignal(name="serverContacted")
aboutToEmail = QtCore.pyqtSignal(name="aboutToEmail")
def insertOptions(self, opts, cls, zid):
self.opts = opts
self.cls = cls
self.zid = zid
def run(self):
# upon running the following line, the application crashes.
emailman = db.emailing.EmailManager(self.opts, self.cls, self.zid)
If I put some dummy code into run() that sleeps, emits the appropriate signals, or prints test values, everything works fine; but as soon as I try to instantiate the EmailManager, the whole thing crashes.
EmailManager is an unremarkable class derived from object, taking the parameters I've given it (opts is a dictionary, cls is a different type of similarly unremarkable object, and zid is just a plain number). The constructor looks like this:
def __init__(self, optsDict, cls, zid):
self.opts = optsDict
self.cls = cls
self.historyItem = HistoryItem(zid)
self.studentsList = studentsInClass(cls)
self.connection = None
I'm constructing a couple of other objects based on the parameters, but other than that, nothing complicated or unusual is happening. The code in the db.emailing module does not use Qt or threading at all.
I don't even know how to begin debugging this, so any advice as to what might be going on or how I could try to find out would be very much appreciated.
Edit: In case it's helpful, here's the backtrace from gdb (I don't know enough about what's going on to find it helpful):
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffeb146700 (LWP 31150)]
0x00007ffff762acc9 in __GI_raise (sig=sig#entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff762acc9 in __GI_raise (sig=sig#entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff762e0d8 in __GI_abort () at abort.c:89
#2 0x00007ffff7623b86 in __assert_fail_base (
fmt=0x7ffff7774830 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion#entry=0x7ffff6a4420d "!xcb_xlib_unknown_req_in_deq", file=file#entry=0x7ffff6a441db "../../src/xcb_io.c", line=line#entry=179,
function=function#entry=0x7ffff6a446b0 "dequeue_pending_request")
at assert.c:92
#3 0x00007ffff7623c32 in __GI___assert_fail (
assertion=0x7ffff6a4420d "!xcb_xlib_unknown_req_in_deq",
file=0x7ffff6a441db "../../src/xcb_io.c", line=179,
function=0x7ffff6a446b0 "dequeue_pending_request") at assert.c:101
#4 0x00007ffff69d479c in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#5 0x00007ffff69d55c3 in _XReply ()
from /usr/lib/x86_64-linux-gnu/libX11.so.6
#6 0x00007ffff69bc346 in XGetWindowProperty ()
from /usr/lib/x86_64-linux-gnu/libX11.so.6
#7 0x00007ffff69bb22e in XGetWMHints ()
from /usr/lib/x86_64-linux-gnu/libX11.so.6
#8 0x00007ffff4c87c4b in QWidgetPrivate::setWindowIcon_sys(bool) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9 0x00007ffff4c38405 in QWidget::create(unsigned long, bool, bool) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007ffff4c4086a in QWidget::setVisible(bool) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00007ffff509956e in QDialog::setVisible(bool) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007ffff5c24b7c in ?? ()
from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
#13 0x00007ffff5099026 in QDialog::exec() ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#14 0x00007ffff5be5fb5 in ?? ()
from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
#15 0x000000000049968d in PyEval_EvalFrameEx ()
#16 0x00000000004a090c in PyEval_EvalCodeEx ()
#17 0x0000000000499a52 in PyEval_EvalFrameEx ()
#18 0x00000000004a1c9a in ?? ()
#19 0x00000000004dfe94 in ?? ()
#20 0x00000000004dc9cb in PyEval_CallObjectWithKeywords ()
#21 0x000000000043734b in PyErr_PrintEx ()
#22 0x00007ffff186fd4d in ?? ()
from /usr/lib/python2.7/dist-packages/sip.so
#23 0x00007ffff14b2ece in ?? ()
from /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
#24 0x00007ffff45be32f in ?? ()
from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#25 0x00007ffff79c1182 in start_thread (arg=0x7fffeb146700)
at pthread_create.c:312
#26 0x00007ffff76ee47d in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Wow, this was obscure.
The X11 windowing functions are apparently not threadsafe unless explicitly set to be so, and for whatever reason PyQt doesn't automatically set them to be. This can be corrected by adding the following before the QApplication constructor:
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
See the documentation on QApplicationAttributes.

Which signal was delivered to process deadlocked in signal handler

I have a core dump from a process that deadlocked after invoking a signal handler. How do I determine which signal was delivered and who sent it?
The GDB-generated backtrace for the the thread that received the signal follows. The signal handler was called in frame 15.
(gdb) bt
#0 0x00007fa9c204654b in sys_futex (w=0x7fa9c2263d80, value=2, loop=<value optimized out>) at ./src/base/linux_syscall_support.h:1789
#1 base::internal::SpinLockDelay (w=0x7fa9c2263d80, value=2, loop=<value optimized out>) at ./src/base/spinlock_linux-inl.h:87
#2 0x00007fa9c204774c in SpinLock::SlowLock (this=0x7fa9c2263d80) at src/base/spinlock.cc:132
#3 0x00007fa9c2037ee3 in Lock (this=0x7fa9c2263d80, start=0x7fa9bb3c04c8, end=0x7fa9bb3c04c0, N=3) at src/base/spinlock.h:75
#4 tcmalloc::CentralFreeList::RemoveRange (this=0x7fa9c2263d80, start=0x7fa9bb3c04c8, end=0x7fa9bb3c04c0, N=3) at src/central_freelist.cc:247
#5 0x00007fa9c203bae4 in tcmalloc::ThreadCache::FetchFromCentralCache (this=0x17efb40, cl=<value optimized out>, byte_size=32) at src/thread_cache.cc:162
#6 0x00007fa9c202b9cb in Allocate (size=<value optimized out>) at src/thread_cache.h:341
#7 do_malloc (size=<value optimized out>) at src/tcmalloc.cc:1068
#8 (anonymous namespace)::do_malloc_or_cpp_alloc (size=<value optimized out>) at src/tcmalloc.cc:1005
#9 0x00007fa9c204bfa8 in tc_realloc (old_ptr=0x0, new_size=32) at src/tcmalloc.cc:1517
#10 0x0000003a358c0f3b in ?? () from /usr/lib64/libstdc++.so.6
#11 0x0000003a358c2adf in ?? () from /usr/lib64/libstdc++.so.6
#12 0x0000003a358c2cae in __cxa_demangle () from /usr/lib64/libstdc++.so.6
#13 0x000000000085f6c7 in my_print_stacktrace ()
#14 0x00000000006a773a in handle_fatal_signal ()
#15 <signal handler called>
#16 tcmalloc::CentralFreeList::FetchFromSpans (this=0x7fa9c2263d80) at src/central_freelist.cc:298
#17 0x00007fa9c2037f88 in tcmalloc::CentralFreeList::RemoveRange (this=0x7fa9c2263d80, start=0x7fa9bb3c1468, end=0x7fa9bb3c1460, N=3) at src/central_freelist.cc:269
#18 0x00007fa9c203bae4 in tcmalloc::ThreadCache::FetchFromCentralCache (this=0x17efb40, cl=<value optimized out>, byte_size=32) at src/thread_cache.cc:162
...
For what it's worth, handle_fatal_signal() and my_print_stacktrace() are MySQL functions. The rest are from Google's tcmalloc.
I would try "frame 15" to move to the signal delivery frame, followed by "print $_siginfo.si_signo". See https://sourceware.org/gdb/onlinedocs/gdb/Signals.html
This works on Linux at least, which I presume from your backtrace that you are using. I'm not sure about other platforms.

Resources