Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with adb

120 views
Skip to first unread message

Julien Wajsberg

unread,
Mar 24, 2015, 2:43:13 PM3/24/15
to dev-b2g
Hi,

I have a big issue with adb: it can't see any of my phones. "adb
devices" returns an empty list.
It came all of a sudden: I updated nothing, it just appeared today. This
morning it worked, this afternoon it doesn't.
The funniest (in a sense) is that it happens on both my computers, both
running Debian Jessie. It stopped working on one of them last week, and
on the second one only today.

I already tried to do the usual checks: udev rules, run as root,
kill-server, check that no other adb was running, reboot the computer,
update Android SDK, try other phones, try other cables: no luck. (same
phone, same cable, on another computer: works fine).
I tried removing MTP support and ModemManager (thinking this might
interfere) but it brought no improvement.

Paul Adenot helped me debugging a little more using ADB_TRACE=1 and
strace and looking at the source code for adb.

Here are the logs for what I found:

$ ADB_TRACE=1 adb -P 5037 fork-server server
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/transport_local.c::local_init():transport: local client init
system/core/adb/usb_linux.c::device_poll_thread():Created device thread
system/core/adb/adb_auth_host.c::adb_auth_init():adb_auth_init
system/core/adb/adb_auth_host.c::get_user_keyfilepath():home '/home/julien'
system/core/adb/transport_local.c::client_socket_thread():transport:
client_socket_thread() starting
system/core/adb/adb_auth_host.c::get_user_key():user key
'/home/julien/.android/adbkey'
system/core/adb/adb_auth_host.c::read_key():read_key
'/home/julien/.android/adbkey'
system/core/adb/usb_linux.c::register_device():[ usb located new device
/dev/bus/usb/001/100 (130/2/1) ]
system/core/adb/usb_linux.c::register_device():[ usb open
/dev/bus/usb/001/100 fd = 8]
system/core/adb/usb_linux.c::register_device():[ usb open
/dev/bus/usb/001/100 error=16, err_str = Device or resource busy]
OK

The error seems to happen when the code tries to run ioctl with
USBDEVFS_CLAIMINTERFACE [1].

[1] http://androidxref.com/5.1.0_r1/xref/system/core/adb/usb_linux.c#609

This likely means that something else is already claiming this
interface, but I don't know how to find out where this comes from.


For the record, here is the log when this works fine (from another
computer -- you'll easily find out whose computer it is ;) ):

$ ADB_TRACE=1 adb -P 5037 fork-server server
adb.c::main():Handling commandline()
transport_local.c::local_init():transport: local client init
usb_linux.c::device_poll_thread():Created device thread
adb_auth_host.c::adb_auth_init():adb_auth_init
transport_local.c::client_socket_thread():transport:
client_socket_thread() starting
adb_auth_host.c::get_user_keyfilepath():home '/home/jlorenzo'
adb_auth_host.c::get_user_key():user key '/home/jlorenzo/.android/adbkey'
adb_auth_host.c::read_key():read_key '/home/jlorenzo/.android/adbkey'
usb_linux.c::register_device():[ usb located new device
/dev/bus/usb/002/124 (130/2/1) ]
OK
usb_linux.c::register_device():[ usb open /dev/bus/usb/002/124 fd = 10]

So it's really comparable except there is no error.

Hope someone will be able to help me here, I'm quite stuck :/

Regards,
--
Julien

signature.asc

Julien Wajsberg

unread,
Mar 24, 2015, 2:55:53 PM3/24/15
to dev-b2g
I'd like to add that Mass Storage works fine on the same phone when it's
plugged in. Fastboot works too. Only adb fails.
signature.asc

kgu...@mozilla.com

unread,
Mar 24, 2015, 3:12:21 PM3/24/15
to mozilla...@lists.mozilla.org
On Tuesday, March 24, 2015 at 2:55:53 PM UTC-4, Julien Wajsberg wrote:
> > I have a big issue with adb: it can't see any of my phones. "adb
> > devices" returns an empty list.
> > It came all of a sudden: I updated nothing, it just appeared today. This
> > morning it worked, this afternoon it doesn't.
> > The funniest (in a sense) is that it happens on both my computers, both
> > running Debian Jessie. It stopped working on one of them last week, and
> > on the second one only today.

I've noticed problems where the ADB helper add-on installed/started by WebIDE interferes with my command-line ADB usage. In the end I just manually removed that add-on from all my Firefox profiles and do a manual port-forwarding when I want to use WebIDE. If you've been trying so far while Firefox is running, maybe try closing Firefox, doing an adb kill-server, and then trying again?

kats

J. Ryan Stinnett

unread,
Mar 24, 2015, 3:22:23 PM3/24/15
to Kartikaya Gupta, mozilla...@lists.mozilla.org
On Tue, Mar 24, 2015 at 2:12 PM, <kgu...@mozilla.com> wrote:
> On Tuesday, March 24, 2015 at 2:55:53 PM UTC-4, Julien Wajsberg wrote:
>> > I have a big issue with adb: it can't see any of my phones. "adb
>> > devices" returns an empty list.
>> > It came all of a sudden: I updated nothing, it just appeared today. This
>> > morning it worked, this afternoon it doesn't.
>> > The funniest (in a sense) is that it happens on both my computers, both
>> > running Debian Jessie. It stopped working on one of them last week, and
>> > on the second one only today.
>
> I've noticed problems where the ADB helper add-on installed/started by WebIDE interferes with my command-line ADB usage. In the end I just manually removed that add-on from all my Firefox profiles and do a manual port-forwarding when I want to use WebIDE. If you've been trying so far while Firefox is running, maybe try closing Firefox, doing an adb kill-server, and then trying again?

I'm veering a bit off topic, but since you mentioned it... I just
wanted to point out that with ADB Helper 0.7.4, Alex has done more
work to allow it to cooperate with adb usage from the terminal.

It should now be possible to e.g. run "adb logcat | grep Gecko" and
then connect with WebIDE while the logs keep running on your terminal.

If you are still seeing issues even with the latest add-on version
(0.7.4), please file bugs / stop by #devtools.

- Ryan

Julien Wajsberg

unread,
Mar 24, 2015, 3:34:42 PM3/24/15
to dev...@lists.mozilla.org


Le 24/03/2015 20:12, kgu...@mozilla.com a écrit :
> On Tuesday, March 24, 2015 at 2:55:53 PM UTC-4, Julien Wajsberg wrote:
>>> I have a big issue with adb: it can't see any of my phones. "adb
>>> devices" returns an empty list.
>>> It came all of a sudden: I updated nothing, it just appeared today. This
>>> morning it worked, this afternoon it doesn't.
>>> The funniest (in a sense) is that it happens on both my computers, both
>>> running Debian Jessie. It stopped working on one of them last week, and
>>> on the second one only today.
> I've noticed problems where the ADB helper add-on installed/started by WebIDE interferes with my command-line ADB usage. In the end I just manually removed that add-on from all my Firefox profiles and do a manual port-forwarding when I want to use WebIDE. If you've been trying so far while Firefox is running, maybe try closing Firefox, doing an adb kill-server, and then trying again?
>
>

Yep, I tried this too :) I disabled ADB Helper just to filter this as a
possible issue (not that I got any issue with this recently).

signature.asc

Julien Wajsberg

unread,
Mar 25, 2015, 9:51:11 AM3/25/15
to dev-b2g
Additional info: using a Live USB version of Ubuntu, I could make adb
work flawlessly.
So something is really happening in Debian :/

Le 24/03/2015 19:54, Julien Wajsberg a écrit :
> I'd like to add that Mass Storage works fine on the same phone when it's
> plugged in. Fastboot works too. Only adb fails.
>
> Le 24/03/2015 19:41, Julien Wajsberg a écrit :
>> Hi,
>>
>> I have a big issue with adb: it can't see any of my phones. "adb
>> devices" returns an empty list.
>> It came all of a sudden: I updated nothing, it just appeared today. This
>> morning it worked, this afternoon it doesn't.
>> The funniest (in a sense) is that it happens on both my computers, both
>> running Debian Jessie. It stopped working on one of them last week, and
>> on the second one only today.
>>
signature.asc

Julien Wajsberg

unread,
Mar 25, 2015, 10:01:03 AM3/25/15
to dev-b2g
On the same computer, my Open C (v2.1) and a Z3 (master) work fine with adb.

So this is somehow an incompatibility between the Flames' adb and my
configuration.
signature.asc

Juan Gómez

unread,
Mar 25, 2015, 10:42:52 AM3/25/15
to Julien Wajsberg, dev-b2g
Hi Julien,
I had siimilar issues before and but I could fix them by using the adb binary that comes with the build system (https://github.com/mozilla-b2g/B2G/tree/master/tools/update-tools/bin/linux-x86) instead of the one provided by the distro.

Hope it helps!

_______________________________________________
dev-b2g mailing list
dev...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g


Julien Wajsberg

unread,
Mar 25, 2015, 11:20:36 AM3/25/15
to dev-b2g
I managed to work around the issue.

I'll explain the cause and the solution I found so that anybody getting
this issue in the future could find a possible solution in the list's
archives.

It looks like my issues came from the linux kernel module "option",
which is a driver for some USB 3G dongles. It looks like that the Flame
(and Buri which had the same issue) triggered the loading of this
module. The downside is that the module didn't work at all, filled the
kernel log with messages (especially its dependencies usb_wwan and
qmi_wwan). Moreover when halting the computer there was very often a
kernel crash stacktrace (I took a picture of it in case it could be useful).

When running "/sbin/lsmod | grep option" you could also look at the
"Used by" column to see that the number was constantly increasing.

The solution I used is backlisting the module. I did this by adding a
file "/etc/modprobe.d/option.conf" with the following content:

install option /bin/false

Simply using "blacklist option" did not seem to work. I think some
Debian component changed the way to load modules recently and as a
result the "blacklist" keyword does not work in this situation (and this
could be what provoked my issues in the first place).

Then I ran "depmod -ae" and "update-initramfs -u" as advised on websites
(but I'm not that sure it's useful), and rebooted.

And tada, the "option" module is not autoloaded anymore and "adb
devices" works !

I'll file a bug to Debian soon, hopefully this can be fixed on their side.

Thanks to all the people who helped me :)
signature.asc

Christof Meerwald

unread,
Mar 25, 2015, 12:49:02 PM3/25/15
to dev...@lists.mozilla.org
On Wed, 25 Mar 2015 16:19:38 +0100, Julien Wajsberg wrote:
[...]
> It looks like my issues came from the linux kernel module "option",
> which is a driver for some USB 3G dongles. It looks like that the Flame
> (and Buri which had the same issue) triggered the loading of this
> module.

Do you have USB tethering enabled on these phones?


Christof

--

http://cmeerw.org sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org

Alfredos (fredy) Damkalis

unread,
Mar 25, 2015, 1:39:50 PM3/25/15
to dev...@lists.mozilla.org
I face the same bug with my laptop. I have also have the same setup,
debian jessie and option, usb_wwan and qmi_wwan modules loaded. On my
Desktop with the same version of Debian but without these modules
works fine.

An interesting work around was to enable USB tethering on the device.

Please let me know via this list discussion or personal email when you
file this bug.

Thanks!

On 03/25/2015 05:19 PM, Julien Wajsberg wrote:
> I managed to work around the issue.
>
> I'll explain the cause and the solution I found so that anybody
> getting this issue in the future could find a possible solution in
> the list's archives.
>
> It looks like my issues came from the linux kernel module
> "option", which is a driver for some USB 3G dongles. It looks like
> that the Flame (and Buri which had the same issue) triggered the

Julien Wajsberg

unread,
Mar 25, 2015, 7:11:36 PM3/25/15
to dev...@lists.mozilla.org
Le 25/03/2015 17:20, Christof Meerwald a écrit :
> On Wed, 25 Mar 2015 16:19:38 +0100, Julien Wajsberg wrote:
> [...]
>> It looks like my issues came from the linux kernel module "option",
>> which is a driver for some USB 3G dongles. It looks like that the Flame
>> (and Buri which had the same issue) triggered the loading of this
>> module.
> Do you have USB tethering enabled on these phones?
>

No I didn't. But USB tethering is different than the "option" driver,
from what I understand.
USB tethering share the network connection established by the phone,
while the "option" driver can access the SIM card directly. I don't know
if that really works with our phones.

signature.asc

Julien Wajsberg

unread,
Mar 26, 2015, 10:38:22 AM3/26/15
to Alfredos (fredy) Damkalis, dev...@lists.mozilla.org
Hey fredy,

I filed the bug on Debian's bugtracker: http://bugs.debian.org/781256.


Le 25/03/2015 18:31, Alfredos (fredy) Damkalis a écrit :
> I face the same bug with my laptop. I have also have the same setup,
> debian jessie and option, usb_wwan and qmi_wwan modules loaded. On my
> Desktop with the same version of Debian but without these modules
> works fine.
>
> An interesting work around was to enable USB tethering on the device.
>
> Please let me know via this list discussion or personal email when you
> file this bug.
>
> Thanks!
>
> On 03/25/2015 05:19 PM, Julien Wajsberg wrote:
>> I managed to work around the issue.
>>
>> I'll explain the cause and the solution I found so that anybody
>> getting this issue in the future could find a possible solution in
>> the list's archives.
>>
>> It looks like my issues came from the linux kernel module
>> "option", which is a driver for some USB 3G dongles. It looks like
>> that the Flame (and Buri which had the same issue) triggered the
signature.asc
0 new messages