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

[LP] Sometimes app crashes after update without reboot #22

Closed
DavisNT opened this issue Feb 25, 2015 · 3 comments

Comments

@DavisNT
Copy link

commented Feb 25, 2015

The code sample https://github.com/DavisNT/XposedLollipopTests/ starts to crash on opening with

I/ActivityManager( 2446): Process lv.id.dm.xposedlollipoptests (pid 11033) has died
I/Zygote ( 1951): Process 11033 exited due to signal (11)
W/ActivityManager( 2446): Force removing ActivityRecord{35967343 u0 lv.id.dm.xposedlollipoptests/.MainActivity t1002}: app died, no saved state
W/WindowManager( 2446): Failed looking up window
W/WindowManager( 2446): java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@3e2ab333 does not exist
W/WindowManager( 2446): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8504)
W/WindowManager( 2446): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8495)
W/WindowManager( 2446): at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2604)
W/WindowManager( 2446): at com.android.server.wm.Session.remove(Session.java:186)
W/WindowManager( 2446): at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:2927)
W/WindowManager( 2446): at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5397)
W/WindowManager( 2446): at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3230)
W/WindowManager( 2446): at android.os.Handler.dispatchMessage(Handler.java:102)
W/WindowManager( 2446): at android.os.Looper.loop(Looper.java:135)
W/WindowManager( 2446): at android.os.HandlerThread.run(HandlerThread.java:61)
W/WindowManager( 2446): at com.android.server.ServiceThread.run(ServiceThread.java:46)

after repeatedly uncommenting/commenting Log.i() inside method2() and launching the app (without reboot).
Reboot usually solves this issue (probably cases when reboot does not help is a different issue). It is unclear whether this happens due to changed Xposed module or target app.

@rovo89

This comment has been minimized.

Copy link
Owner

commented Feb 26, 2015

Is there anything more in the log, especially a native crash log for signal 11? I assume that the crash shown in the log excerpt above is just a follow-up error.

@DavisNT

This comment has been minimized.

Copy link
Author

commented Feb 27, 2015

In the logcat is:

I/ActivityManager( 2446): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=lv.id.dm.xposedlollipoptests/.MainActivity} from uid 10083 on display 0
I/ActivityManager( 2446): Start proc lv.id.dm.xposedlollipoptests for activity lv.id.dm.xposedlollipoptests/.MainActivity: pid=10025 uid=10333 gids={50333, 9997} abi=armeabi-v7a
I/art     (10025): Late-enabling -Xcheck:jni
W/art     (10025): Failed to find OatDexFile for DexFile /data/app/lv.id.dm.xposedlollipoptests-1/base.apk ( canonical path /data/app/lv.id.dm.xposedlollipoptests-1/base.apk) with checksum 0x2fee99f4 in OatFile /data/dalvik-cache/arm/data@app@lv.id.dm.xposedlollipoptests-1@base.apk@classes.dex
I/Zygote  ( 1951): Process 10025 exited due to signal (11)
I/ActivityManager( 2446): Process lv.id.dm.xposedlollipoptests (pid 10025) has died 

and before it there are also these lines:

W/art     ( 2446): Long monitor contention event with owner method=void com.android.server.pm.PackageManagerService.removePackageDataLI(com.android.server.pm.PackageSetting, int[], boolean[], com.android.server.pm.PackageManagerService$PackageRemovedInfo, int, boolean) from PackageManagerService.java:11583 waiters=0 for 194ms
I/PackageManager( 2446): Package lv.id.dm.xposedlollipoptests codePath changed from /data/app/lv.id.dm.xposedlollipoptests-1 to /data/app/lv.id.dm.xposedlollipoptests-2; Retaining data and using new
I/art     ( 2446): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/data@app@lv.id.dm.xposedlollipoptests-2@base.apk@classes.dex' for file location '/data/app/lv.id.dm.xposedlollipoptests-2/base.apk': Failed to open oat filename for reading: No such file or directory
I/art     ( 2446): DexFile_isDexOptNeeded failed to open oat file '/data/app/lv.id.dm.xposedlollipoptests-2/arm/base.odex' for file location '/data/app/lv.id.dm.xposedlollipoptests-2/base.apk': Failed to open oat filename for reading: No such file or directory
I/art     ( 2446): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/data@app@lv.id.dm.xposedlollipoptests-2@base.apk@classes.dex' for file location '/data/app/lv.id.dm.xposedlollipoptests-2/base.apk': Failed to open oat filename for reading: No such file or directory
I/art     ( 2446): DexFile_isDexOptNeeded failed to open oat file '/data/app/lv.id.dm.xposedlollipoptests-2/arm/base.odex' for file location '/data/app/lv.id.dm.xposedlollipoptests-2/base.apk': Failed to open oat filename for reading: No such file or directory
I/PackageManager( 2446): Running dexopt on: /data/app/lv.id.dm.xposedlollipoptests-2/base.apk pkg=lv.id.dm.xposedlollipoptests isa=arm vmSafeMode=false
E/cutils-trace( 8560): Error opening trace file: No such file or directory (2)
I/dex2oat ( 8560): /system/bin/dex2oat --zip-fd=11 --zip-location=/data/app/lv.id.dm.xposedlollipoptests-2/base.apk --oat-fd=12 --oat-location=/data/dalvik-cache/arm/data@app@lv.id.dm.xposedlollipoptests-2@base.apk@classes.dex --instruction-set=arm --instruction-set-features=default --runtime-arg -Xms64m --runtime-arg -Xmx512m

Is anything of this info helpful?

C3C0 added a commit to C3C0/android_art that referenced this issue Jun 9, 2015
Xposed modules are loaded in the Zygote process. ART compiles the .dex file
and opens the resulting .oat file in the Dalvik cache for that. However,
the same happens again when the user installs a new version of the module,
overwriting the file in the Dalvik cache. When opening the new .oat file
though, ART detects that the file is already opened and reuses this instance.
Later, it detects that the checksum doesn't match, which causes a crash.
This will only occur on every second update (without reboot) as Android
uses alternating suffixes for the .apk files (-1.apk / -2.apk).

Let's work around it by ignoring already opened .oat files if they have been
opened in Zygote. The behavior for files in /system (boot image and framework)
is unchanged.

Fixes rovo89/Xposed#22.

Conflicts:
	runtime/oat_file.h
@Maxr1998

This comment has been minimized.

Copy link

commented Jun 29, 2015

Love you!!!
I am really thankful this is fixed :)

B--B added a commit to AOSP-JF/platform_art that referenced this issue Sep 15, 2015
Xposed modules are loaded in the Zygote process. ART compiles the .dex file
and opens the resulting .oat file in the Dalvik cache for that. However,
the same happens again when the user installs a new version of the module,
overwriting the file in the Dalvik cache. When opening the new .oat file
though, ART detects that the file is already opened and reuses this instance.
Later, it detects that the checksum doesn't match, which causes a crash.
This will only occur on every second update (without reboot) as Android
uses alternating suffixes for the .apk files (-1.apk / -2.apk).

Let's work around it by ignoring already opened .oat files if they have been
opened in Zygote. The behavior for files in /system (boot image and framework)
is unchanged.

Fixes rovo89/Xposed#22.

Conflicts:
	runtime/oat_file.h
B--B added a commit to AOSP-JF/platform_art that referenced this issue Sep 15, 2015
Xposed modules are loaded in the Zygote process. ART compiles the .dex file
and opens the resulting .oat file in the Dalvik cache for that. However,
the same happens again when the user installs a new version of the module,
overwriting the file in the Dalvik cache. When opening the new .oat file
though, ART detects that the file is already opened and reuses this instance.
Later, it detects that the checksum doesn't match, which causes a crash.
This will only occur on every second update (without reboot) as Android
uses alternating suffixes for the .apk files (-1.apk / -2.apk).

Let's work around it by ignoring already opened .oat files if they have been
opened in Zygote. The behavior for files in /system (boot image and framework)
is unchanged.

Fixes rovo89/Xposed#22.

Conflicts:
	runtime/oat_file.h

Conflicts:
	runtime/oat_file.cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.