Closed Bug 918326 Opened 8 years ago Closed 8 years ago

[app manager] Can't start Firefox if the ADB addon is install


(DevTools Graveyard :: WebIDE, defect, P1)



(firefox26 fixed)

Firefox 27
Tracking Status
firefox26 --- fixed


(Reporter: paul, Assigned: ochameau)



No STR yet.

But I can't start Firefox because of the Adb addon.
I can't reproduce anymore :(
Priority: -- → P1
Duplicate of this bug: 919461
This happened to me again this morning. I'm not entirely sure what happened. After ~20 minutes of debugging, it just started working again.

Here is what I managed to understand:
- I needed to restart Firefox because the Adb Addon was not listing my device anymore (even after unplugging / plugging the phone)
- Firefox won't start until _isAdbRunning resolves the promise.
- done() in _isAdbRunning is called ~10 seconds after
- a very long time is spent in:
>        let isAdbRunning = lines.some(function(line) {
>          return regex.test(line);
>        });
- in this case, lines.length == 180
Ok, I figured it out: hangs happen when the output of "ps aux" is large (during a compilation for example).

Basically, if there are long lines in the output of "ps aux":
1) it takes a long time to subprocess.js to call the done() callback (~10s)
2) calling regex.test() on all of these lines takes a long time too (several minutes)

Try this code:

> let rx = /.*? \d+ .*? .*? \d+\s+\d+ .*? .*? .*? .*? adb .*fork\-server/
> let str = "paul      2023  0.0  0.0  14468  1428 pts/0    S+   09:58   0:00 /usr/bin/make interfaces/base_libs interfaces/canvas_libs interfaces/core_libs interfaces/html_libs interfaces/events_libs interfaces/devicestorage_libs interfaces/contacts_libs interfaces/settings_libs interfaces/stylesheets_libs interfaces/sidebar_libs interfaces/css_libs interfaces/traversal_libs interfaces/range_libs interfaces/xbl_libs interfaces/xpath_libs interfaces/xul_libs interfaces/storage_libs interfaces/json_libs interfaces/offline_libs interfaces/geolocation_libs interfaces/notification_libs interfaces/permission_libs interfaces/svg_libs interfaces/smil_libs interfaces/apps_libs interfaces/gamepad_libs apps_libs base_libs activities_libs bindings_libs battery_libs bluetooth_libs browser-element_libs contacts_libs phonenumberutils_libs alarm_libs devicestorage_libs encoding_libs file_libs fmradio_libs media_libs messages_libs power_libs push_libs quota_libs settings_libs mobilemessage_libs src_libs time_libs locales_libs network_libs permission_libs plugins/base_libs plugins/ipc_libs indexedDB_libs system_libs ipc_libs identity_libs workers_libs camera_libs audiochannel_libs promise_libs wappush_libs telephony_libs webidl_libs gamepad_libs"
> rx.test(str)

This takes 2 seconds here.
Assignee: nobody → poirot.alex
It should be fixed by the new version (0.2.0) I pushed this morning to AMO.
Please reopen if it still fails.
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.