Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalMonitorStateException 2.x #6755

Closed
DavidDTA opened this issue Dec 10, 2019 · 2 comments
Closed

IllegalMonitorStateException 2.x #6755

DavidDTA opened this issue Dec 10, 2019 · 2 comments
Labels

Comments

@DavidDTA
Copy link
Contributor

RxJava version 2.2.12.
Android 8 and 9, and 5, disproportionately uncommon on Samsung devices.

Stack trace:

Caused by java.lang.IllegalMonitorStateException
       at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease + 152(ReentrantLock.java:152)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.release + 1285(AbstractQueuedSynchronizer.java:1285)
       at java.util.concurrent.locks.ReentrantLock.unlock + 458(ReentrantLock.java:458)
       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.offer + 1067(ScheduledThreadPoolExecutor.java:1067)
       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add + 1077(ScheduledThreadPoolExecutor.java:1077)
       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add + 1076(ScheduledThreadPoolExecutor.java:1076)
       at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute + 336(ScheduledThreadPoolExecutor.java:336)
       at java.util.concurrent.ScheduledThreadPoolExecutor.schedule + 579(ScheduledThreadPoolExecutor.java:579)
       at java.util.concurrent.ScheduledThreadPoolExecutor.submit + 680(ScheduledThreadPoolExecutor.java:680)
       at io.reactivex.internal.schedulers.NewThreadWorker.scheduleActual + 145(NewThreadWorker.java:145)
       at io.reactivex.internal.schedulers.ComputationScheduler$EventLoopWorker.schedule + 227(ComputationScheduler.java:227)
       at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.trySchedule + 166(FlowableObserveOn.java:166)
       at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.onNext + 117(FlowableObserveOn.java:117)
       at io.reactivex.internal.operators.flowable.FlowableHide$HideSubscriber.onNext + 68(FlowableHide.java:68)
       at io.reactivex.internal.operators.flowable.FlowableOnBackpressureBuffer$BackpressureBufferSubscriber.drain + 187(FlowableOnBackpressureBuffer.java:187)
       at io.reactivex.internal.operators.flowable.FlowableOnBackpressureBuffer$BackpressureBufferSubscriber.onNext + 112(FlowableOnBackpressureBuffer.java:112)
       at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext + 68(FlowableMap.java:68)
       at io.reactivex.processors.BehaviorProcessor$BehaviorSubscription.test + 640(BehaviorProcessor.java:640)
       at io.reactivex.processors.BehaviorProcessor$BehaviorSubscription.emitNext + 620(BehaviorProcessor.java:620)
       at io.reactivex.processors.BehaviorProcessor.onNext + 281(BehaviorProcessor.java:281)
       at io.reactivex.processors.SerializedProcessor.onNext + 103(SerializedProcessor.java:103)
       at io.reactivex.internal.operators.flowable.FlowableScanSeed$ScanSeedSubscriber.drain + 207(FlowableScanSeed.java:207)
       at io.reactivex.internal.operators.flowable.FlowableScanSeed$ScanSeedSubscriber.onNext + 123(FlowableScanSeed.java:123)
       at io.reactivex.internal.operators.flowable.FlowableOnBackpressureBuffer$BackpressureBufferSubscriber.drain + 187(FlowableOnBackpressureBuffer.java:187)
       at io.reactivex.internal.operators.flowable.FlowableOnBackpressureBuffer$BackpressureBufferSubscriber.onNext + 112(FlowableOnBackpressureBuffer.java:112)
       at io.reactivex.processors.PublishProcessor$PublishSubscription.onNext + 360(PublishProcessor.java:360)
       at io.reactivex.processors.PublishProcessor.onNext + 243(PublishProcessor.java:243)
       at io.reactivex.processors.SerializedProcessor.onNext + 103(SerializedProcessor.java:103)
       <redacted application frames>
       at io.reactivex.internal.operators.flowable.FlowableUsing.subscribeActual + 49(FlowableUsing.java:49)
       at io.reactivex.Flowable.subscribe + 14918(Flowable.java:14918)
       at io.reactivex.Flowable.subscribe + 14865(Flowable.java:14865)
       at io.reactivex.internal.operators.flowable.FlowableSwitchMap$SwitchMapSubscriber.onNext + 129(FlowableSwitchMap.java:129)
       at io.reactivex.internal.operators.flowable.FlowableDistinctUntilChanged$DistinctUntilChangedSubscriber.tryOnNext + 101(FlowableDistinctUntilChanged.java:101)
       at io.reactivex.internal.operators.flowable.FlowableDistinctUntilChanged$DistinctUntilChangedSubscriber.onNext + 67(FlowableDistinctUntilChanged.java:67)
       at io.reactivex.internal.operators.flowable.FlowableMap$MapConditionalSubscriber.onNext + 111(FlowableMap.java:111)
       at io.reactivex.internal.operators.flowable.FlowableDistinctUntilChanged$DistinctUntilChangedConditionalSubscriber.tryOnNext + 191(FlowableDistinctUntilChanged.java:191)
       at io.reactivex.internal.operators.flowable.FlowableMap$MapConditionalSubscriber.tryOnNext + 128(FlowableMap.java:128)
       at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnConditionalSubscriber.runAsync + 649(FlowableObserveOn.java:649)
       at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run + 176(FlowableObserveOn.java:176)
       at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run + 124(HandlerScheduler.java:124)
       at android.os.Handler.handleCallback + 794(Handler.java:794)
       at android.os.Handler.dispatchMessage + 99(Handler.java:99)
       at android.os.Looper.loop + 176(Looper.java:176)
       at android.app.ActivityThread.main + 6635(ActivityThread.java:6635)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 547(RuntimeInit.java:547)
       at com.android.internal.os.ZygoteInit.main + 823(ZygoteInit.java:823)

As background information, the Flowable involved in this chain has the hide operation as a workaround for #6673 as recommended in the discussion of #5927.

This crash is at a much lower volume that the one tracked in #6673.

@akarnokd
Copy link
Member

This looks like a bug with the underlying java.util.concurrent.ScheduledThreadPoolExecutor implementation for that particular runtime. We are using only standard Java APIs and can't do anything about it and can't offer any workarounds.

@DavidDTA
Copy link
Contributor Author

Indeed, the documentation for ScheduledThreadPoolExecutor.submit does not document that it can throw java.lang.IllegalMonitorStateException. Thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants