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

BaseLinkedQueueProducerNodeRef ignored flag rx.unsafe-disable #4940

Closed
mstrdev opened this issue Dec 28, 2016 · 2 comments
Closed

BaseLinkedQueueProducerNodeRef ignored flag rx.unsafe-disable #4940

mstrdev opened this issue Dec 28, 2016 · 2 comments

Comments

@mstrdev
Copy link

mstrdev commented Dec 28, 2016

  • version 1.2.4

Issue reproduced with android app on device "Lenovo IdeaTab s6000-H". I solve many problems with Unsafe by setting "rx.unsafe-disable" flag. But BaseLinkedQueueProducerNodeRef ignored this flag. And I received this:

E/AndroidRuntime: FATAL EXCEPTION: RxIoScheduler-7
ava.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
   at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:59)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
   at java.util.concurrent.FutureTask.run(FutureTask.java:234)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
   at java.lang.Thread.run(Thread.java:838)
Caused by: java.lang.ExceptionInInitializerError
   at rx.internal.operators.CompletableOnSubscribeMergeDelayErrorIterable.call(CompletableOnSubscribeMergeDelayErrorIterable.java:56)
   at rx.internal.operators.CompletableOnSubscribeMergeDelayErrorIterable.call(CompletableOnSubscribeMergeDelayErrorIterable.java:27)
   at rx.Completable.unsafeSubscribe(Completable.java:2037)
   at rx.Completable$31$1.call(Completable.java:2149)
   at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
   at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
   at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153) 
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267) 
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
   at java.lang.Thread.run(Thread.java:838) 
Caused by: java.lang.NullPointerException
   at rx.internal.util.unsafe.UnsafeAccess.addressOf(UnsafeAccess.java:113)
   at rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef.<clinit>(BaseLinkedQueue.java:33)
   at rx.internal.operators.CompletableOnSubscribeMergeDelayErrorIterable.call(CompletableOnSubscribeMergeDelayErrorIterable.java:56) 
   at rx.internal.operators.CompletableOnSubscribeMergeDelayErrorIterable.call(CompletableOnSubscribeMergeDelayErrorIterable.java:27) 
   at rx.Completable.unsafeSubscribe(Completable.java:2037) 
   at rx.Completable$31$1.call(Completable.java:2149) 
   at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230) 
   at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) 
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
   at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153) 
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267) 
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
   at java.lang.Thread.run(Thread.java:838) 

I think that problem with line 33 which directly invoke Unsafe methods:

  protected final static long P_NODE_OFFSET = UnsafeAccess.addressOf(BaseLinkedQueueProducerNodeRef.class, "producerNode");
@mstrdev mstrdev changed the title BaseLinkedQueueProducerNodeRef is ignore flag rx.unsafe-disable BaseLinkedQueueProducerNodeRef ignored flag rx.unsafe-disable Dec 28, 2016
@akarnokd
Copy link
Member

Thanks. The operator CompletableOnSubscribeMergeDelayErrorIterable doesn't properly switch on the unsafe settings. I'll post a fix shortly.

@akarnokd
Copy link
Member

Closing via #4941

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

No branches or pull requests

2 participants