Closed Bug 1045486 Opened 10 years ago Closed 10 years ago

BT-transfer cannot work on Nexus 4

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: allstars.chh, Assigned: tzimmermann)

References

Details

Attachments

(3 files)

STR:
1. Goto Galley, choose a photo.
2. Press 'Share'
3. Choose 'Bluetooth Transfer'
4. Choose the device you want to send the photo to.

Then a notification "The trasnfer has started" will pop up

However nothing happens after then.
And Receiving side cannot get the photo either.


commit e365871f1741bd6efeb03f0a2093fdb235a982f3
Author: Wes Kocher <wkocher@mozilla.com>
Date:   Mon Jul 28 20:14:19 2014 -0700

    Bug 1045419 - Disable test_crash_manager.js for failures on a CLOSED TREE r=me


Gaia:
commit 772746d840f949df90bdbac0f662066e3207d6be
Merge: be5fc7f 0c8833c
Author: Yuren Ju <yurenju@gmail.com>
Date:   Tue Jul 29 14:03:11 2014 +0800

    Merge pull request #22147 from yurenju/settings-git-commit-win
    
    Bug 1036821 - git commit hash isn't wrote to settings/resources/gaia_commit.txt on Windows r=@cctuan
Shawn,

mind taking a look?
Flags: needinfo?(shuang)
QA Whiteboard: [COM=Bluetooth]
Assignee: nobody → shuang
Flags: needinfo?(shuang)
07-29 06:35:09.563 I/GeckoDump(  179): XXX FIXME : Got a mozContentEvent: activity-choice
07-29 06:35:09.573 I/Gonk    (  179): Setting nice for pid 4243 to 1
07-29 06:35:09.573 I/Gonk    (  179): Changed nice for pid 4243 from 18 to 1.
07-29 06:35:09.803 E/GeckoConsole( 4243): [JavaScript Error: "ContextError: Context not ready"]
07-29 06:35:09.893 W/bt-btif (  179): bta_dm_check_av:0
07-29 06:35:11.695 E/GeckoConsole(  179): Content JS WARN at app://system.gaiamobile.org/js/activity_window.js:236 in onClose: unknown window type of activity caller.
07-29 06:35:11.725 I/Gecko   ( 4243): 
07-29 06:35:11.725 I/Gecko   ( 4243): ###!!! [Child][MessageChannel] Error: Channel closing: too late to send/recv, messages will be lost
07-29 06:35:11.725 I/Gecko   ( 4243): 
07-29 06:35:11.735 I/Gecko   (  179): [Parent 179] WARNING: pipe error (165): Connection reset by peer: file ../../../gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 450
07-29 06:35:14.628 I/Gonk    (  179): Setting nice for pid 4308 to 18
07-29 06:35:14.628 I/Gonk    (  179): Changed nice for pid 4308 from 0 to 18.
07-29 06:35:15.079 I/Gecko   ( 4308): ###################################### forms.js loaded
07-29 06:35:15.089 I/Gecko   ( 4308): ############################### browserElementPanning.js loaded
07-29 06:35:15.099 I/Gecko   ( 4308): ######################## BrowserElementChildPreload.js loaded
I can only see these error, but that even doesn't call |sendfile| anyway.

07-29 06:35:09.803 E/GeckoConsole( 4243): [JavaScript Error: "ContextError: Context not ready"]
07-29 06:35:11.695 E/GeckoConsole(  179): Content JS WARN at app://system.gaiamobile.org/js/activity_window.js:236 in onClose: unknown window type of activity caller.
Attached file log
log for the BT-sharing doesn't work.
(In reply to Yoshi Huang[:allstars.chh] from comment #4)
> Created attachment 8464507 [details]
> log
> 
> log for the BT-sharing doesn't work.

Thanks, Yoshi. I will update later what I found.
This looks like a bluetooth OPP bug.
In |sendFile|, mSocket is not null. So |ProcessNextBatch| never get executed, but i'm surprised we would have this kind of bug. mSocket is not been initialized.

363	  if (!mSocket) {
364	    ProcessNextBatch();
365	  }
(In reply to Shawn Huang [:shuang] [:shawnjohnjr] from comment #6)
> This looks like a bluetooth OPP bug.
> In |sendFile|, mSocket is not null. So |ProcessNextBatch| never get
> executed, but i'm surprised we would have this kind of bug. mSocket is not
> been initialized.
> 
> 363	  if (!mSocket) {
> 364	    ProcessNextBatch();
> 365	  }
Even I initialized mSocket in constructor, it seems connection still can not be established. I will dig into this problem.
Summary:
If I remove the patch of bug 1035240, outgoing OPP connection can work correctly.
|BluetoothOppManager::ConnectInternal| will call |mServerSocket->Disconnect()|, 
then trigger |BluetoothSocket::CloseDroidSocket|, and eventually ShutdownOnIOThread and close fd from I/O loop. After that, |Connect| was been executed, but it never get any incoming setup message from libevent.
> I/Gecko   (  180): [Parent 180] WARNING: mozilla::dom::bluetooth::BluetoothInterfaceRunnable3<Obj, Res, Arg1, Arg2, Arg3>::BluetoothInterfaceRunnable3(Obj*, Res (Obj::*)(Arg1, Arg2, Arg3), const Arg1&, const Arg2&, const Arg3&) [with Obj = mozilla::dom::bluetooth::BluetoothSocketResultHandler; Res = void; Arg1 = int; Arg2 = const nsAString_internal&; Arg3 = int] ab7b3150 ab7b3150: file ../../../../mozilla-central/dom/bluetooth/bluedroid/BluetoothInterface.cpp, line 92

The problem of patch [01] is illustrated here: Arg2 is instanced as |const nsAString_internal&|. The member fields are of these types, but this doesn't work because we store a reference to an object that is already gone when the runnable gets executed. Patch [01] fixes this.
See Also: → 1048227
Stealing this bug :)
Assignee: shuang → tzimmermann
Blocks: 992206
Comment on attachment 8467017 [details] [diff] [review]
[02] Bug 1045486: Rename |ConnectResultHandler| to |ConnectSocketResultHandler|

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

Thanks for find this weired linker behavior.
Attachment #8467017 - Flags: review?(shuang) → review+
Verified on
Gaia      5e6ef81cb9e917657ce050f598229dfc83c58b8f
Gecko     https://hg.mozilla.org/mozilla-central/rev/a31cd48facbf
BuildID   20140806160248
Version   34.0a1
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: