Closed Bug 935368 Opened 11 years ago Closed 11 years ago

[B2G] [Bluetooth] Wrong interface for dbus method of DefaultAdapter

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.3+, firefox28 fixed)

RESOLVED FIXED
blocking-b2g 1.3+
Tracking Status
firefox28 --- fixed

People

(Reporter: gyeh, Assigned: gyeh)

References

Details

(Keywords: crash, regression, Whiteboard: [b2g-crash])

Attachments

(1 file, 2 obsolete files)

#0  __libc_android_abort () at bionic/libc/unistd/abort.c:82
#1  0x403cc192 in _dbus_abort () at external/dbus/dbus/dbus-sysdeps.c:94
#2  0x403b3cf8 in _dbus_warn_check_failed (
    format=0x403d6697 "arguments to %s() were incorrect, assertion \"%s\" failed
in file %s line %d.\nThis is normally a bug in some application using the D-Bus
library.\n") at external/dbus/dbus/dbus-internals.c:302
#3  0x403bf660 in dbus_message_new_method_call (destination=<value optimized
out>, path=0xbef00794 "", interface=<value optimized out>,
    method=0x428bfad0 "StartDiscovery") at
external/dbus/dbus/dbus-message.c:1214
#4  0x41d2935e in mozilla::ipc::RawDBusConnection::BuildDBusMessage (this=<value
optimized out>,
    aPath=0xbef006ec "l\377=@6\237=@\343\220=@\276\004", aIntf=0x403d9f36
"_dbus_check_is_valid_path (path)",
    aFunc=0x403d90e3 "external/dbus/dbus/dbus-message.c", aFirstArgType=0,
aArgs=...)
    at /home/workspace/mozilla-central/ipc/dbus/RawDBusConnection.cpp:291
#5  0x41d2942c in mozilla::ipc::RawDBusConnection::SendWithReply
(this=0x403d6697, aCallback=0x415d339d <OnSendDiscoveryMessageReply>,
    aData=0x44567c40, aTimeout=-1, aPath=0xbef00794 "", aIntf=0x428beb31
"org.bluez.Adapter", aFunc=0x428bfad0 "StartDiscovery",
    aFirstArgType=0) at
/home/workspace/mozilla-central/ipc/dbus/RawDBusConnection.cpp:274
#6  0x415d87a6 in
mozilla::dom::bluetooth::BluetoothDBusService::SendDiscoveryMessage (this=<value
optimized out>,
    aMessageName=0x428bfad0 "StartDiscovery", aRunnable=0x44567c40)
    at
/home/workspace/mozilla-central/dom/bluetooth/linux/BluetoothDBusService.cpp:2007
#7  0x415d8824 in
mozilla::dom::bluetooth::BluetoothDBusService::StartDiscoveryInternal
(this=0x403d6697, aRunnable=0x403d9f36)
    at
/home/workspace/mozilla-central/dom/bluetooth/linux/BluetoothDBusService.cpp:2095
#8  0x415cf940 in mozilla::dom::bluetooth::BluetoothRequestParent::DoRequest
(this=0x44460160, aRequest=<value optimized out>)
Depends on: 923647
STR:

1. Make sure Bluetooth is turned on.
2. Launch Settings App.
3. Enter Bluetooth subpage, and start discovery nearby devices.

Actual result:
Crash.

Expected result:
No crash and discovery nearby devices successfully.
The root cause is that |sAdapterPath| is null somehow.

nsresult
BluetoothDBusService::SendDiscoveryMessage(const char* aMessageName,
                                           BluetoothReplyRunnable* aRunnable)
{
  ...

  bool success = mConnection->SendWithReply(
    OnSendDiscoveryMessageReply,
    static_cast<void*>(aRunnable), -1,
    NS_ConvertUTF16toUTF8(sAdapterPath).get(),
    DBUS_ADAPTER_IFACE, aMessageName,
    DBUS_TYPE_INVALID);
Summary: [B2G] [Bluetooth] Crash when starting discovery in Settings App → [B2G] [Bluetooth] Wrong interface for dbus method of DefaultAdapter
Hey Eric, it's your turn!
Assignee: nobody → gyeh
Attachment #827816 - Flags: review?(echou)
Comment on attachment 827816 [details] [diff] [review]
Patch 1: Wrong interface for dbus method of DefaultAdapter

We should call dbus method DefaultAdapter with the interface of manager.

I also add some assertions to make sure that sAdapterPath isn't null when we make a dbus call.
This is a regression of Bug 923647.
Keywords: regression
There's no need to query default adapter when turning on Bluetooth since the object path will be received later in the signal "AdapterAdded".
Attachment #827816 - Attachment is obsolete: true
Attachment #827816 - Flags: review?(echou)
Attachment #827846 - Flags: review?(echou)
Comment on attachment 827846 [details] [diff] [review]
Patch 1(v2): Wrong interface for dbus method of DefaultAdapter

Review of attachment 827846 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with nit addressed. Thanks.

::: dom/bluetooth/linux/BluetoothDBusService.cpp
@@ +1955,5 @@
>      return NS_OK;
>    }
>  
>    nsRefPtr<BluetoothReplyRunnable> runnable(aRunnable);
> +  MOZ_ASSERT(!sAdapterPath.IsEmpty());

nit: I think it'll be fine if sAdapterPath has been already checked at line 1950.
Attachment #827846 - Flags: review?(echou) → review+
You are right, Eric. Thanks.
blocking-b2g: --- → 1.3?
Keywords: crash
Whiteboard: [b2g-crash]
https://hg.mozilla.org/mozilla-central/rev/68855964c204
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
resolved fixed in master 1.3. clear flag
blocking-b2g: 1.3? → ---
(In reply to Joe Cheng [:jcheng] from comment #12)
> resolved fixed in master 1.3. clear flag

No that's not how we triage bugs here - if the patch would indeed block the release post landing, it should be set to 1.3+. This is a crash regression, which should block.
blocking-b2g: --- → 1.3+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: