Skip to content

NullPointerException on OperatorZip #3687

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

Closed
jkettmann opened this issue Feb 9, 2016 · 6 comments
Closed

NullPointerException on OperatorZip #3687

jkettmann opened this issue Feb 9, 2016 · 6 comments
Labels

Comments

@jkettmann
Copy link

I get crashreports caused by a NullPointerException in OperatorZip's tick() method. You find the stacktrace and my code, causing the problem below.

The responsible line in tick() method is

RxRingBuffer buffer = ((InnerSubscriber) observers[i]).items;

where observers[i] seems to be null.

The app crashes only rarely on one device, which I don't have acces to (Samsung S3, Android 4.3). The reason seems to be, that the property missedProducer in ProducerArbiter must be set, which is never the case on my devices.

We're not in production yet, so I can not tell how many other devices will show this error.

Stacktrace:

0 java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
1   at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)
2   at rx.schedulers.ExecutorScheduler$ExecutorSchedulerWorker.run(ExecutorScheduler.java:98)
3   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
4   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
5   at java.lang.Thread.run(Thread.java:841)
6 Caused by: java.lang.NullPointerException
7   at rx.internal.operators.OperatorZip$Zip.tick(OperatorZip.java:237)
8   at rx.internal.operators.OperatorZip$ZipProducer.request(OperatorZip.java:175)
9   at rx.internal.producers.ProducerArbiter.emitLoop(ProducerArbiter.java:181)
10  at rx.internal.producers.ProducerArbiter.request(ProducerArbiter.java:69)
11  at rx.internal.operators.OperatorConcat$ConcatSubscriber.requestFromChild(OperatorConcat.java:118)
12  at rx.internal.operators.OperatorConcat$ConcatSubscriber.access$100(OperatorConcat.java:79)
13  at rx.internal.operators.OperatorConcat$ConcatProducer.request(OperatorConcat.java:74)
14  at rx.internal.producers.ProducerArbiter.request(ProducerArbiter.java:66)
15  at rx.internal.operators.OperatorSubscribeOn$1$1$1$1$1.call(OperatorSubscribeOn.java:94)
16  at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
17  ... 4 more

This is the code causing the problem: Get Observable<List<ContainerEntity>>, map each container entity to my actual container model. flatmap is used to split my list into single items.

getContainerEntities()
.flatMap(containerEntities ->
            Observable.from(containerEntities))
    .concatMap(containerEntity ->
            mDashboardMapper.mapContainerEntity(containerEntity))
    .onErrorResumeNext(throwable -> {
        Log.e(TAG, throwable);
        return Observable.empty();
    });
@akarnokd
Copy link
Member

akarnokd commented Feb 9, 2016

What RxJava version are you using?

@jkettmann
Copy link
Author

I'm using version 1.1.0

@akarnokd
Copy link
Member

akarnokd commented Feb 9, 2016

Could be a missing barrier on line 207 or somewhere else, or a bug in that particular runtime. I'll reorganize things in zip so this doesn't happen.

@jkettmann
Copy link
Author

Great. Thanks a lot!

@akarnokd
Copy link
Member

akarnokd commented Feb 9, 2016

See #3688

@akarnokd akarnokd added the Bug label Feb 9, 2016
@akarnokd
Copy link
Member

Closing via #3688.

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