Closed Bug 980437 Opened 10 years ago Closed 6 years ago

NixOS Linux users unable to start the Simulator (library paths)

Categories

(Firefox OS Graveyard :: Simulator, defect)

All
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jryans, Unassigned)

References

Details

There have been various reports of issues for Linux users trying to start the Simulator:

https://support.mozilla.org/en-US/questions/988385
https://github.com/mozilla/r2d2b2g/issues/869

There's almost no debug info to figure this kind of issue out today.  The first step I think would be to add some more debug logging and spin new Linux builds for these users to try.
I've created test Simulator 1.3 builds for Linux 32-bit and 64-bit with more logging info, so hopefully they will help us understand the issue here.  Garbas, can you please try this out?

For the moment, you'll need to install the appropriate one for your system manually:

* Linux 32-bit: https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/1.3/linux/fxos_1_3_simulator-7.0pre8dev.20140312-linux.xpi
* Linux 64-bit: https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/1.3/linux64/fxos_1_3_simulator-7.0pre8dev.20140312-linux64.xpi

Also, you'll need to enable verbose logging[1] for the 1.3 simulator.  After that, try to start the 1.3 simulator in the App Manager.  Open the Browser Console, and copy any simulator related output here.

[1]: https://developer.mozilla.org/en-US/docs/Tools/Firefox_OS_Simulator#How_to_enable_verbose_logging
Flags: needinfo?(rok)
finally found some time to tests fxos-simulator with more verbose logging. i can now see 

```
19:44:23.274 "fxos_1_3_simulator@mozilla.org: Attempting to run" simulator-process.js:40
19:44:23.274 "fxos_1_3_simulator@mozilla.org: Trying to find b2g binary" simulator-process.js:40
19:44:23.275 "fxos_1_3_simulator@mozilla.org: Looking for b2g at /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org//resources/fxos_1_3_simulator/data/linux64/b2g/b2g-bin" simulator-process.js:40
19:44:23.275 "fxos_1_3_simulator@mozilla.org: Found b2g successfully at /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org//resources/fxos_1_3_simulator/data/linux64/b2g/b2g-bin" simulator-process.js:40
19:44:23.276 "fxos_1_3_simulator@mozilla.org: Spawning b2g process" simulator-process.js:40
19:44:23.276 "fxos_1_3_simulator@mozilla.org: Arguments: -profile,/home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/profile,-dbgport,33239,-no-remote" simulator-process.js:40
19:44:23.276 "fxos_1_3_simulator@mozilla.org: Environment: TMPDIR=/tmp,DISPLAY=:0.0" simulator-process.js:40
19:44:23.278 "subprocess: getlimit: maxFD=1024" simulator-process.js:36
19:44:23.292 "subprocess: subprocess started; got PID 6836" simulator-process.js:36
19:44:23.330 "subprocess: Got msg from stdout: initialising library with libc.so.6" simulator-process.js:36
19:44:23.331 "subprocess: Got msg from stderr: initialising library with libc.so.6" simulator-process.js:36
19:44:23.331 "subprocess: Got msg from stderr: poll returned HUP" simulator-process.js:36
19:44:23.332 "subprocess: Got msg from stdout: poll returned HUP" simulator-process.js:36
19:44:23.332 "subprocess: Pipe stdout closed" simulator-process.js:36
19:44:23.333 "subprocess: Pipe stderr closed" simulator-process.js:36
19:44:23.333 "subprocess: Cleanup called" simulator-process.js:36
19:44:23.333 "subprocess: trying to close stdin" simulator-process.js:36
19:44:23.334 "subprocess: Closing Stdin" simulator-process.js:36
19:44:23.335 "linux64/b2g/b2g-bin terminated with 0"
```
Flags: needinfo?(rok)
Huh, interesting!  So we seem to spawn the b2g process, but then it dies immediately, or at least that's what it seems like.  This could be an issue with our subprocess library, or perhaps something is actually preventing the process from starting up.

Can you try running the same command directly from a terminal?  It's possible there's some output there that might useful.  So, in your case you would run:

$ /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org//resources/fxos_1_3_simulator/data/linux64/b2g/b2g-bin -profile /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/profile -dbgport 33239 -no-remote
Flags: needinfo?(rok)
Garbas, have you had a chance to take a look at this?
sry, got busy with day work :)

running...
$ /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org//resources/fxos_1_3_simulator/data/linux64/b2g/b2g-bin -profile /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/profile -dbgport 33239 -no-remote
i get... zsh: no such file or directory

i used 64 version of simulator.
is simulator looking for some library in /lib /usr? (i dont have /usr nor /lib)
Flags: needinfo?(rok)
Hmm, it's hard for me to say...  What Linux distro are you using?

Can you confirm that the files / directories above do still exist?  As in:

/home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org//resources/fxos_1_3_simulator/data/linux64/b2g/b2g-bin

/home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/profile
Flags: needinfo?(rok)
yes files are there just returning the above error.
Flags: needinfo?(rok)
Okay.  What Linux distro is this?  It might be helpful if I were able to reproduce your setup.
Flags: needinfo?(rok)
Its NixOS (http://nixos.org). you can get quick virtual appliance here -> http://hydra.nixos.org/job/nixos/trunk/ova.x86_64-linux/latest

But i assume you don't have time to dig into every linux distro that is mentioned. in case you do have a little curiosity what nixos is all about here is the video from last fostdem (https://www.youtube.com/watch?v=seP79xX9FsE)

i got it working by doing:

 $ patchelf --set-interpreter /home/rok/.nix-profile/lib64/ld-linux-x86-64.so.2 /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/resources/fxos_1_3_simulator/data/linux64/b2g/b2g-bin
 $ patchelf --set-rpath "/home/rok/.nix-profile/lib:/home/rok/.nix-profile/lib64:/nix/var/nix/profiles/system/sw/lib:/nix/store/1ajfic7bl115f3hadc7gi6rwffpiwb29-libXrender-0.9.8/lib" "/home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/resources/fxos_1_3_simulator/data/linux64/b2g/b2g-bin"
 $ patchelf --set-rpath "/home/rok/.nix-profile/lib:/home/rok/.nix-profile/lib64:/nix/var/nix/profiles/system/sw/lib:/nix/store/1ajfic7bl115f3hadc7gi6rwffpiwb29-libXrender-0.9.8/lib:/nix/store/g54x83abg3jyf5x804yqjv4g34ry361q-dbus-glib-0.102/lib:/nix/store/11m0k4mk7qzs29sa7hq2zf2xf7wbwwjp-dbus-libs-1.8.0/lib:/nix/store/4lfh1rd9ziz62k2mkxgprgglxfl5qda8-glib-2.40.0/lib:/nix/store/844a0269sxn97yv0xsvr09x3pf6zrsx4-gtk+-2.24.23/lib:/nix/store/45wslkp9s12h28zyx55nlcabdzvmdxf2-atk-2.12.0/lib:/nix/store/8dg1zc5cxs9jpa4ak1ncj4z4az2npwya-pango-1.32.5/lib:/nix/store/93xm18lf3jbqmnz74wwd5caq975x4y63-freetype-2.4.12/lib:/nix/store/5sdifj36xn5psp8q5igm8yflivvmc8sm-gdk-pixbuf-2.30.6/lib:/nix/store/abaxm4wfwn0si5bl4p2q7biz6i1bycli-cairo-1.12.14/lib:/nix/store/03xvvzm2w0vyfgwqbvkl474x9qnlldql-libX11-1.6.2/lib:/nix/store/03l7nz223x5ms6sqa3qfy2gvrw7ihk3m-libXext-1.3.2/lib:/nix/store/68a2s5zfpk68awj85anmy2xq25sy1j1s-libXt-1.1.4/lib" "/home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/resources/fxos_1_3_simulator/data/linux64/b2g/libxul.so" && /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/resources/fxos_1_3_simulator/data/linux64/b2g/b2g-bin -profile /home/rok/.mozilla/firefox/auf994pq.default/extensions/fxos_1_3_simulator@mozilla.org/profile -dbgport 33239 -no-remote

now this is a temporary hack ofcourse.

is it possible to automatically include FFOS simulator into Firefox when we are packaging it for NixOS? there i could do above commands when simulator gets downloaded.

here is current how we package Firefox in NixOS (sry for the nix part, but should be more visible what we do)
https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox/default.nix

i hope you see i'm quite new to firefox build system...
Flags: needinfo?(rok)
Summary: Some Linux users unable to start the Simulator → Some Linux users unable to start the Simulator (library paths)
Gustavo, it sounds like your issue is separate, so I've filed bug 1031100 about it and hidden your comments here to make this one easier to follow.  Thanks for the report!
Summary: Some Linux users unable to start the Simulator (library paths) → NixOS Linux users unable to start the Simulator (library paths)
(In reply to J. Ryan Stinnett [:jryans] from comment #3)
> Huh, interesting!  So we seem to spawn the b2g process, but then it dies
> immediately, or at least that's what it seems like.  This could be an issue
> with our subprocess library, or perhaps something is actually preventing the
> process from starting up.
> 
> Can you try running the same command directly from a terminal?  It's
> possible there's some output there that might useful.  So, in your case you
> would run:
> 
> $
> /home/rok/.mozilla/firefox/auf994pq.default/extensions/
> fxos_1_3_simulator@mozilla.org//resources/fxos_1_3_simulator/data/linux64/
> b2g/b2g-bin -profile
> /home/rok/.mozilla/firefox/auf994pq.default/extensions/
> fxos_1_3_simulator@mozilla.org/profile -dbgport 33239 -no-remote

This worked for me, I have Canaima OS (debian 6 based) but my firefox is in simple folder, I just run the binary file, is not installed like other programs,i don't know if that is the issue
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.