Can't Repro
Status Update
Comments
fa...@google.com <fa...@google.com> #2
[Comment deleted]
th...@google.com <th...@google.com> #3
Oh, and I'm seeing this on both the emulator and a Galaxy Nexus. Simply launching an activity that does something like this is enough to reproduce:
ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
manager.addPrimaryClipChangedListener(new ClipboardManager.OnPrimaryClipChangedListener() {
@Override
public void onPrimaryClipChanged() { }
});
ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
manager.addPrimaryClipChangedListener(new ClipboardManager.OnPrimaryClipChangedListener() {
@Override
public void onPrimaryClipChanged() { }
});
ha...@gmail.com <ha...@gmail.com> #4
Could you please give full steps to reproduce, including the app to run that is causing it? The crash here shows it failing when setting the clipboard, which generally works; I need to to be able to see more specifically what this particular app is doing.
Also the API demo "Clipboard/Data Types" does use addPrimaryClipChangedListener() and doesn't have this problem, and the stack crawl originally shown doesn't have anything about addPrimaryClipChangedListener() in it, so there is some information I am missing.
Thanks!
Also the API demo "Clipboard/Data Types" does use addPrimaryClipChangedListener() and doesn't have this problem, and the stack crawl originally shown doesn't have anything about addPrimaryClipChangedListener() in it, so there is some information I am missing.
Thanks!
ra...@google.com <ra...@google.com> #5
What application are you trying to copy text from after adding a listener? I'm copying text from other apps like Messaging or Search and not the application the listener itself is from.
I have no idea if I'm on the right track, but my personal hypothesis is that this is caused because AppOpsService's uid verification is trying to verify the uid for the *listener's* application but the calling uid (Binder.getCallingUid()) is that of the application the text is being copied from. This leads to the permission check for UPDATE_APP_OPS_STATS which will obviously fail.
The code snippet I posted is basically the full "application" you should be able to reproduce this with. So this should be it:
1. Create a new Android app in $IDE_OF_CHOICE
2. Add a new OnPrimaryClipChangedListener in the onCreate of that application's activity -- it's contents don't matter
3. Install and launch the activity
4. Copy text from any other application
5. Crash.
I have no idea if I'm on the right track, but my personal hypothesis is that this is caused because AppOpsService's uid verification is trying to verify the uid for the *listener's* application but the calling uid (Binder.getCallingUid()) is that of the application the text is being copied from. This leads to the permission check for UPDATE_APP_OPS_STATS which will obviously fail.
The code snippet I posted is basically the full "application" you should be able to reproduce this with. So this should be it:
1. Create a new Android app in $IDE_OF_CHOICE
2. Add a new OnPrimaryClipChangedListener in the onCreate of that application's activity -- it's contents don't matter
3. Install and launch the activity
4. Copy text from any other application
5. Crash.
ha...@gmail.com <ha...@gmail.com> #6
I'm experiencing similar bug. for example, go to message app, tap and hold a message and copy text. the app will crash (the copy will save in clipboard though)
ha...@gmail.com <ha...@gmail.com> #7
I have the same problem, I have an app that starts observing clipboard and since I updated to 4.3 that app crashes with similar exception to this from the first post (android.permission.UPDATE_APP_OPS_STATS)
then every other app that tries to copy something crashes with this exception:
W/dalvikvm(5446): threadid=1: thread exiting with uncaught exception (group=0x419c0700)
W/clipboard(431): Exception:
W/clipboard(431): java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
W/clipboard(431): at android.os.RemoteCallbackList.beginBroadcast(RemoteCallbackList.java:229)
W/clipboard(431): at com.android.server.ClipboardService.setPrimaryClip(ClipboardService.java:165)
W/clipboard(431): at android.content.IClipboard$Stub.onTransact(IClipboard.java:62)
W/clipboard(431): at com.android.server.ClipboardService.onTransact(ClipboardService.java:123)
W/clipboard(431): at android.os.Binder.execTransact(Binder.java:388)
W/clipboard(431): at dalvik.system.NativeStart.run(Native Method)
E/AndroidRuntime(5446): FATAL EXCEPTION: main
E/AndroidRuntime(5446): java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
E/AndroidRuntime(5446): at android.os.Parcel.readException(Parcel.java:1439)
E/AndroidRuntime(5446): at android.os.Parcel.readException(Parcel.java:1385)
E/AndroidRuntime(5446): at android.content.IClipboard$Stub$Proxy.setPrimaryClip(IClipboard.java:171)
E/AndroidRuntime(5446): at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java:125)
E/AndroidRuntime(5446): at android.content.ClipboardManager.setText(ClipboardManager.java:208)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity.onContextItemSelected(AuthenticatorActivity.java:927)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity.access$200(AuthenticatorActivity.java:73)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity$3.onActionItemClicked(AuthenticatorActivity.java:353)
E/AndroidRuntime(5446): at android.widget.AbsListView$MultiChoiceModeWrapper.onActionItemClicked(AbsListView.java:6058)
E/AndroidRuntime(5446): at com.android.internal.policy.impl.PhoneWindow$DecorView$ActionModeCallbackWrapper.onActionItemClicked(PhoneWindow.java:2569)
E/AndroidRuntime(5446): at com.android.internal.app.ActionBarImpl$ActionModeImpl.onMenuItemSelected(ActionBarImpl.java:962)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
E/AndroidRuntime(5446): at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:547)
E/AndroidRuntime(5446): at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:115)
E/AndroidRuntime(5446): at android.view.View.performClick(View.java:4240)
E/AndroidRuntime(5446): at android.view.View$PerformClick.run(View.java:17721)
E/AndroidRuntime(5446): at android.os.Handler.handleCallback(Handler.java:730)
E/AndroidRuntime(5446): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(5446): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(5446): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime(5446): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(5446): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(5446): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime(5446): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(5446): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(431): Force finishing activity com.google.android.apps.authenticator2/com.google.android.apps.authenticator.AuthenticatorActivity
or similar. Once I disabled clipboard monitoring app and rebooted Nexus 7 the copying worked for sometime.
then every other app that tries to copy something crashes with this exception:
W/dalvikvm(5446): threadid=1: thread exiting with uncaught exception (group=0x419c0700)
W/clipboard(431): Exception:
W/clipboard(431): java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
W/clipboard(431): at android.os.RemoteCallbackList.beginBroadcast(RemoteCallbackList.java:229)
W/clipboard(431): at com.android.server.ClipboardService.setPrimaryClip(ClipboardService.java:165)
W/clipboard(431): at android.content.IClipboard$Stub.onTransact(IClipboard.java:62)
W/clipboard(431): at com.android.server.ClipboardService.onTransact(ClipboardService.java:123)
W/clipboard(431): at android.os.Binder.execTransact(Binder.java:388)
W/clipboard(431): at dalvik.system.NativeStart.run(Native Method)
E/AndroidRuntime(5446): FATAL EXCEPTION: main
E/AndroidRuntime(5446): java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
E/AndroidRuntime(5446): at android.os.Parcel.readException(Parcel.java:1439)
E/AndroidRuntime(5446): at android.os.Parcel.readException(Parcel.java:1385)
E/AndroidRuntime(5446): at android.content.IClipboard$Stub$Proxy.setPrimaryClip(IClipboard.java:171)
E/AndroidRuntime(5446): at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java:125)
E/AndroidRuntime(5446): at android.content.ClipboardManager.setText(ClipboardManager.java:208)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity.onContextItemSelected(AuthenticatorActivity.java:927)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity.access$200(AuthenticatorActivity.java:73)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity$3.onActionItemClicked(AuthenticatorActivity.java:353)
E/AndroidRuntime(5446): at android.widget.AbsListView$MultiChoiceModeWrapper.onActionItemClicked(AbsListView.java:6058)
E/AndroidRuntime(5446): at com.android.internal.policy.impl.PhoneWindow$DecorView$ActionModeCallbackWrapper.onActionItemClicked(PhoneWindow.java:2569)
E/AndroidRuntime(5446): at com.android.internal.app.ActionBarImpl$ActionModeImpl.onMenuItemSelected(ActionBarImpl.java:962)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
E/AndroidRuntime(5446): at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:547)
E/AndroidRuntime(5446): at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:115)
E/AndroidRuntime(5446): at android.view.View.performClick(View.java:4240)
E/AndroidRuntime(5446): at android.view.View$PerformClick.run(View.java:17721)
E/AndroidRuntime(5446): at android.os.Handler.handleCallback(Handler.java:730)
E/AndroidRuntime(5446): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(5446): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(5446): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime(5446): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(5446): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(5446): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime(5446): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(5446): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(431): Force finishing activity com.google.android.apps.authenticator2/com.google.android.apps.authenticator.AuthenticatorActivity
or similar. Once I disabled clipboard monitoring app and rebooted Nexus 7 the copying worked for sometime.
ha...@gmail.com <ha...@gmail.com> #8
[Comment deleted]
ha...@gmail.com <ha...@gmail.com> #9
Yes, It's happening to my NEXUS 4 also. Once you launch any app monitoring clipboard then copying in any app crashes the app.
[Deleted User] <[Deleted User]> #10
i've noticed that even if app crashes, copying still works and I can paste copied data. So I've changed code in my app to:
public static void setClipData(Context context, String text) {
try {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("", text);
clipboard.setPrimaryClip(clip);
Toast.makeText(context.getApplicationContext(), R.string.url_copied, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(context.getApplicationContext(), R.string.url_copying_error, Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
But copying from contextual action bar still crashes and observing clipboard doesn't work at all. I think this is because ofhttp://www.androidpolice.com/2013/07/25/app-ops-android-4-3s-hidden-app-permission-manager-control-permissions-for-individual-apps/ :)
public static void setClipData(Context context, String text) {
try {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("", text);
clipboard.setPrimaryClip(clip);
Toast.makeText(context.getApplicationContext(), R.string.url_copied, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(context.getApplicationContext(), R.string.url_copying_error, Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
But copying from contextual action bar still crashes and observing clipboard doesn't work at all. I think this is because of
[Deleted User] <[Deleted User]> #11
I face the same issue on my Galaxy Nexus. I have an app "Clipper" (clipboard manager) running in background. The moment some text is copied from any app, that particular app would crash. After uninstalling app "Clipper" (a clipboard manager), the crashes stopped. I had to reboot after uninstalling.
ha...@gmail.com <ha...@gmail.com> #12
Could someone *please* post complete steps to reproduce. This means either:
(1) Attaching a complete code project that can be built and run to cause the problem to happen, or
(2) A pointer to an app on the play store to install with steps to reproduce in that app.
Thanks.
(1) Attaching a complete code project that can be built and run to cause the problem to happen, or
(2) A pointer to an app on the play store to install with steps to reproduce in that app.
Thanks.
ma...@gmail.com <ma...@gmail.com> #13
Diana Install https://play.google.com/store/apps/details?id=org.rojekti.clipper set it to have it monitoring in the notifaction bar then try copying anything from anywhere ;)
ma...@gmail.com <ma...@gmail.com> #14
As I mentioned here[1], it happens on pretty much any app, Google's included, in example:
1. Open YouTube (I have version 4.5.17).
2. Open a video (any video).
3. Overflow menu > Copy URL
Same with GMail:
1. Open GMail (I have version 4.5.2-714156).
2. Open a conversation
3. Long press on text to action bar mode to appear
4. Tap on copy action
1.https://plus.google.com/103638111379552295023/posts/hZMgjN2qSUU
1. Open YouTube (I have version 4.5.17).
2. Open a video (any video).
3. Overflow menu > Copy URL
Same with GMail:
1. Open GMail (I have version 4.5.2-714156).
2. Open a conversation
3. Long press on text to action bar mode to appear
4. Tap on copy action
1.
ma...@gmail.com <ma...@gmail.com> #15
Diane,
I've attached a sample application. Like I mentioned before, it's just a blank activity that attaches a listener to the clipboard service.
Once you've built, installed and run this application and its activity, simply open any other application and copy something. For example, open Google Search, type anything in the search bar, copy it and a crash will occur.
The important part here is that the copying must occur in _another application_ separate from the listener. This causes the uid mismatch in AppOpsService's verifyIncomingUid and throws an exception.
Alternatively, install the Clipper application linked in #13, complete the tutorial so that it registers a listener, and copy from any other application. A crash will occur.
I've attached a sample application. Like I mentioned before, it's just a blank activity that attaches a listener to the clipboard service.
Once you've built, installed and run this application and its activity, simply open any other application and copy something. For example, open Google Search, type anything in the search bar, copy it and a crash will occur.
The important part here is that the copying must occur in _another application_ separate from the listener. This causes the uid mismatch in AppOpsService's verifyIncomingUid and throws an exception.
Alternatively, install the Clipper application linked in #13, complete the tutorial so that it registers a listener, and copy from any other application. A crash will occur.
[Deleted User] <[Deleted User]> #17
Hello,
Thank you for the response. We opened a ticket and the technical support confirmed the issue in our datacenter and then it was fixed. But we still see some 502.
Thank you for the response. We opened a ticket and the technical support confirmed the issue in our datacenter and then it was fixed. But we still see some 502.
ki...@gmail.com <ki...@gmail.com> #18
Basically it happens with any app monitoring clipboard. 100% reproducible and very much easy to repro.
1) installhttps://play.google.com/store/apps/details?id=net.daum.android.dictionary
2) launch the app
3) launch or switch to other app(Chrome, Gmail, ''') which has texts can be copied to clipboard
4) copy text then the app crashes.
1) install
2) launch the app
3) launch or switch to other app(Chrome, Gmail, ''') which has texts can be copied to clipboard
4) copy text then the app crashes.
Description
1. Create a container cluster
2. Create two replication controllers for different services (A & B) on this container cluster
3. Create two NodePort services on the cluster to proxy the services from #2
4. Create two named ports on the instance group from step #1, one for each of the NodePorts.
5. Create a http(s) load balancer with backend for service A as described here:
6. Confirm that the everything is working as expected for service A
7. Create a second backend for service B
8. Create a host/path rule for the backend from step #7, configured against the url-map created in step #5.
What is the expected output? What do you see instead?
Expected: The load balancer supports traffic to both services when the backends are reporting healthy.
Actual: Traffic to service A always returns 502, despite both backends reporting healthy.
What version of the product are you using? On what operating system?
Google Cloud SDK 0.9.83
Please provide any additional information below.
There's nothing particularly odd about this configuration - just two kubernetes services running on a single container cluster, and configuring a load balancer to route to them based on path rules.
I'm able to reproduce this 100% of the time.