New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 803932 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

[android notifications] getdisplayed() crashes when there are no active notifications

Project Member Reported by jming@chromium.org, Jan 19 2018

Issue description

I got this error: [FATAL:jni_string.cc(27)] Check failed: str. 
 (https://paste.googleplex.com/5253212592406528) and upon further investigation it looks like it is happening because NotificationPlatformBridgeAndroid::GetDisplayed calls AppendJavaStringArrayToStringVector on a null string (ConvertJavaStringToUTF8), I'm guessing because getActiveNotificationIds returns null and it isn't checked in GetDisplayed().

I'm not sure if this is on purpose or how you wanted to handle the null case! I'm assigning to nator@ because it seems related to the recent https://chromium-review.googlesource.com/#/c/871051/?

More stack trace available here
(https://paste.googleplex.com/5053312197984256):

I    5.756s Main  Stack Trace:
I    5.756s Main    RELADDR   FUNCTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 FILE:LINE
I    5.756s Main    0001a39a  <UNKNOWN>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /system/lib/libc.so
I    5.756s Main    v------>  base::debug::(anonymous namespace)::DebugBreak()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         /usr/local/google/code/clankium/src/base/debug/debugger_posix.cc:228:5
I    5.757s Main    00096ff5  base::debug::BreakDebugger()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             /usr/local/google/code/clankium/src/base/debug/debugger_posix.cc:258:0
I    5.757s Main    000a8923  logging::LogMessage::~LogMessage()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       /usr/local/google/code/clankium/src/base/logging.cc:842:7
I    5.757s Main    0008a359  base::android::ConvertJavaStringToUTF8(_JNIEnv*, _jstring*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             /usr/local/google/code/clankium/src/base/android/jni_string.cc:27:3
I    5.757s Main    00088a45  base::android::AppendJavaStringArrayToStringVector(_JNIEnv*, _jobjectArray*, std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > >*)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             /usr/local/google/code/clankium/src/base/android/jni_array.cc:190:5
I    5.757s Main    00273a07  NotificationPlatformBridgeAndroid::GetDisplayed(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, bool, base::RepeatingCallback<void (std::__ndk1::unique_ptr<std::__ndk1::set<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > >, std::__ndk1::default_delete<std::__ndk1::set<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > > >, bool)> const&) const  /usr/local/google/code/clankium/src/chrome/browser/notifications/notification_platform_bridge_android.cc:382:5


 

Comment 1 by peter@chromium.org, Jan 21 2018

Thanks Joy!

What we missed here is that StatusBarNotification.getTag() can return NULL as well, which may be the case for non-Web Notifications, so I guess we need a null check for that in Java.

Comment 2 by na...@chromium.org, Jan 22 2018

Status: Started (was: Assigned)
Cc: dtrainor@chromium.org
Labels: OS-Android
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fdbea024438bf269beb1eb786b2c80122772d9cb

commit fdbea024438bf269beb1eb786b2c80122772d9cb
Author: Mugdha Lakhani <nator@chromium.org>
Date: Tue Jan 23 11:20:45 2018

[Android Notifications] Add a null check to getTag()

We get the list of all active notifications on Android using the
Notification Manager. Not all of these notifications have a tag set.
Notifications that're not web notifications, for instance, will have
this to null. Only surface notifications from NotificationPlatformBridge
if they have a non-null tag.

Bug:  803932 
Change-Id: Ifaa11117e6e6e1f4a0b2adc6f497cb7602607916
Reviewed-on: https://chromium-review.googlesource.com/878370
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Reviewed-by: Anita Woodruff <awdf@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531205}
[modify] https://crrev.com/fdbea024438bf269beb1eb786b2c80122772d9cb/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java

Comment 6 by na...@chromium.org, Jan 23 2018

Status: Fixed (was: Started)

Sign in to add a comment