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

Crash when canceling tasks #1150

Closed
d4rken opened this Issue Sep 22, 2017 · 2 comments

Comments

1 participant
@d4rken
Owner

d4rken commented Sep 22, 2017

java.lang.NullPointerException: Attempt to read from field 'eu.thedarken.sdm.tools.shell.a$d eu.thedarken.sdm.tools.shell.a.c' on a null object reference
        at eu.thedarken.sdm.tools.shell.InteractiveShell.doCallback(InteractiveShell.java:618)
        at eu.thedarken.sdm.tools.shell.InteractiveShell.exit(InteractiveShell.java:450)
        at eu.thedarken.sdm.tools.shell.ShellSource.cancel(ShellSource.java:107)
        at eu.thedarken.sdm.tools.shell.InteractiveShell.cancel(InteractiveShell:375)
        at eu.thedarken.sdm.tools.worker.AbstractWorker.onCleanup(AbstractWorker.java:199)
        at eu.thedarken.sdm.tools.worker.AbstractWorker.cleanup(AbstractWorker.java:207)
        at eu.thedarken.sdm.tools.worker.AbstractWorker.cancel(AbstractWorker.java:218)
        at eu.thedarken.sdm.ui.AbstractWorkerUIFragment.lambda$null$0(AbstractWorkerUIFragment.java:114)
        at eu.thedarken.sdm.ui.c.run(Unknown:-1)
        at java.lang.Thread.run(Thread.java:818)

@d4rken d4rken added this to the v4.8.1 milestone Sep 22, 2017

@d4rken

This comment has been minimized.

Owner

d4rken commented Sep 23, 2017

cancel(true) -> exit(true) cleared the current command without syncronization(this). This would race against the output streams onStreamClosed(). Which due to the race condition and missing syncronization found a left over command while processing weDead(). While processing the callback for this "orphaned" current command, the cancel() would clear the command reference, leading to an NPE.

@d4rken d4rken closed this Sep 23, 2017

@d4rken

This comment has been minimized.

Owner

d4rken commented Sep 23, 2017

1506151829323 W/DatabasesWorker: Canceling...
1506151829323 W/AppCleanerWorker: Already canceled or not working!
1506151829323 D/DatabasesWorker: Cleaning up after task (force:true)
(...)
1506151841748 D/Shell:Interactive: Orphaned command, letting it know the bad news. Command(commands=[cd '/data/user/0/eu.thedarken.sdm/files', $V5B9D812A9C51 test -f '/storage/emulated/0/Android/data/com.tomtom.gplay.navapp/files/data/maps/16/Europe/extra.sqlite' && ./sqlite3_sdm '/storage/emulated/0/Android/data/com.tomtom.gplay.navapp/files/data/maps/16/Europe/extra.sqlite' VACUUM ])
1506151841748 D/Shell:Interactive: ...exiting completed! (globalExitcode=-4)
1506151841749 D/Shell:Interactive: runCommand(...): Command.Result(exitcode=-4)
1506151841749 W/Databases:DBTool: VACUUM failed for /storage/emulated/0/Android/data/com.tomtom.gplay.navapp/files/data/maps/16/Europe/extra.sqlite with []
1506151841749 W/Shell:Interactive: weDead(), but have an outstanding command: Command(commands=[cd '/data/user/0/eu.thedarken.sdm/files', $V5B9D812A9C51 test -f '/storage/emulated/0/Android/data/com.tomtom.gplay.navapp/files/data/maps/16/Europe/extra.sqlite' && ./sqlite3_sdm '/storage/emulated/0/Android/data/com.tomtom.gplay.navapp/files/data/maps/16/Europe/extra.sqlite' VACUUM ])
java.lang.NullPointerException: Attempt to read from field 'eu.thedarken.sdm.tools.shell.a$d eu.thedarken.sdm.tools.shell.a.c' on a null object reference
	at eu.thedarken.sdm.tools.shell.d.a(InteractiveShell.java)
	at eu.thedarken.sdm.tools.shell.d.b(InteractiveShell.java)
	at eu.thedarken.sdm.tools.shell.d$2.a(InteractiveShell.java)
	at eu.thedarken.sdm.tools.shell.b.run(Harvester.java)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment