Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firefox-esr v52: build on Hydra #72969

Closed
wants to merge 1 commit into from
Closed

Conversation

danbst
Copy link
Contributor

@danbst danbst commented Nov 7, 2019

The firefox v52 is indeed unmaintained, insecure FF release, but still the
easiest way to get old Java-based sites working. My bank account site is an
example. It has vulnerabilities defined, so it is not built by Hydra.

Because of pragmatic reasons (avoid building Firefox on laptops) I propose
to bring back build on Hydra. icedtea project is still supported and gets
better with time, so to make use of it would be great to have a ready-to-use
browser.

Unfortunately, I can't use firefox-esr-52 from old Nixpkgs checkout
(which still has binaries in Hydra cache), as Glibc version was changed
and is now incompatible with NixOS 19.09 (segfaults).

cc @oxij @grahamc

The firefox v52 is indeed unmaintained, insecure FF release, but still the
easiest way to get old Java-based sites working. My bank account site is an
example. It has vulnerabilities defined, so it is not built by Hydra.

Because of pragmatic reasons (avoid building Firefox on laptops) I propose
to bring back build on Hydra. `icedtea` project is still supported and gets
better with time, so to make use of it would be great to have a ready-to-use
browser.

Unfortunately, I can't use firefox-esr-52 from old Nixpkgs checkout
(which still has binaries in Hydra cache), as Glibc version was changed
and is now incompatible with NixOS 19.09 (segfaults).
@7c6f434c
Copy link
Member

7c6f434c commented Nov 7, 2019 via email

@danbst
Copy link
Contributor Author

danbst commented Nov 7, 2019

@7c6f434c TBH, I don't even know how to approach this problem:

[danbst@station:~]$ /nix/var/nix/profiles/per-user/danbst/firefox-java-1-link/bin/firefox --no-remote                                                                                         
                                                                                                                                                                                              
(firefox:21181): Gtk-WARNING **: Locale not supported by C library.                                                                                                                           
        Using the fallback 'C' locale.                                                                                                                                                        
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognutls.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognutls.so
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiolibproxy.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiolibproxy.so
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognomeproxy.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognomeproxy.so
/nix/store/ags5bbxz1jx92ffnsk3v1wd2g9lx5mg4-gvfs-1.42.1/lib/gio/modules/libgioremote-volume-monitor.so: undefined symbol: g_mount_operation_get_is_tcrypt_system_volume
Failed to load module: /nix/store/ags5bbxz1jx92ffnsk3v1wd2g9lx5mg4-gvfs-1.42.1/lib/gio/modules/libgioremote-volume-monitor.so
1573128121434   addons.repository       WARN    Search failed when repopulating cache
Segmentation fault (core dumped)

[danbst@station:~]$ nix-store -qR /nix/var/nix/profiles/per-user/danbst/firefox-java-1-link/bin/firefox | grep glibc
/nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131
/nix/store/27x7pinqdsl9f3rpbm8bsszd9fhwq266-glibc-2.27
/nix/store/p3zkm5isp2a2qbb9zyhc7zhfwk8zbdqj-glibc-2.27-bin
/nix/store/lb3kkvyylnbcxn5jad9i11szxlhkpkjq-glibc-2.27-dev
/nix/store/rk71nxcvkrlr1bavp7zic074w5blzc9i-glibc-iconv-2.27

@7c6f434c
Copy link
Member

7c6f434c commented Nov 7, 2019 via email

@danbst
Copy link
Contributor Author

danbst commented Nov 7, 2019

@7c6f434c you made me think about actually using binary firefox release.

  ff_java2 = with (import <nixpkgs> {
    config = {
      allowUnfree = true;
      firefox = {
        icedtea = true;
      };
    };
  });
    wrapFirefox (firefox-bin-unwrapped.override {
      generated = {
        version = "52.9.0esr";
        sources = [
          { url = "http://ftp.mozilla.org/pub/firefox/releases/52.9.0esr/linux-x86_64/en-US/firefox-52.9.0esr.tar.bz2";
            locale = "en-US";
            arch = "linux-x86_64";
            sha512 = "1a2kij2i99m4aphdnhi7k5i52wa3lfxsfwchdqmvl19mc31ihcb7wpx19l4nxnnisakw2wxsxb84hi36qag5x28b8pyfm33fq0dmmxm";
          }];
      };}) {
        browserName = "firefox";
        name = "firefox-bin-52.9.0esr";
        desktopName = "Firefox";
      };

Maybe I can go forward with adding firefox-bin-52esr attribute, then I will no longer need source-based Firefox. 🤔 But what is this generated attribute about?

Have you tried to use old build with different LOCALE_ARCHIVE value (pointing to the old version of the locale archive suitable for that old glibc)?

no, but I don't think it fails because of locales. In some iteration of debugging I found that chain of calls was firefox -> ffmpeg -> systemd-lib -> glibc. I tried then to disable pulseaudio, but it caused ffmpeg rebuild, so I gave up. Also, even when I add config.firefox.ffmpeg = false; it still uses ffmpeg.

@7c6f434c
Copy link
Member

7c6f434c commented Nov 7, 2019 via email

@danbst
Copy link
Contributor Author

danbst commented Nov 7, 2019

@7c6f434c okay, you were partly right about LD_LIBRARY_PATH. If I clear it up, it moves a bit forward. But still, segfault.

Here is repro steps:

  ff_java4 = with (import (builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/0a70d65fd471e30fc1f300cc4eebaf18b56d90b8.tar.gz) {
    config = {
      firefox = {
        icedtea = true;
      };
    };
  });
    wrapFirefox firefoxPackages.firefox-esr-52 { };

Then:

[danbst@station:~/dev/nixpkgs]$ LOCALE_ARCHIVE= LD_LIBRARY_PATH= ./result/bin/firefox --no-remote

(firefox:1329): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognutls.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognutls.so
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiolibproxy.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiolibproxy.so
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognomeproxy.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognomeproxy.so
/nix/store/ags5bbxz1jx92ffnsk3v1wd2g9lx5mg4-gvfs-1.42.1/lib/gio/modules/libgioremote-volume-monitor.so: undefined symbol: g_mount_operation_get_is_tcrypt_system_volume
Failed to load module: /nix/store/ags5bbxz1jx92ffnsk3v1wd2g9lx5mg4-gvfs-1.42.1/lib/gio/modules/libgioremote-volume-monitor.so

(firefox:1329): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognutls.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognutls.so
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiolibproxy.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiolibproxy.so
/nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognomeproxy.so: undefined symbol: g_task_set_name
Failed to load module: /nix/store/vgfiav03nk4z7mnnzfqkgszhgabsbv3i-glib-networking-2.62.0/lib/gio/modules/libgiognomeproxy.so
/nix/store/ags5bbxz1jx92ffnsk3v1wd2g9lx5mg4-gvfs-1.42.1/lib/gio/modules/libgioremote-volume-monitor.so: undefined symbol: g_mount_operation_get_is_tcrypt_system_volume
Failed to load module: /nix/store/ags5bbxz1jx92ffnsk3v1wd2g9lx5mg4-gvfs-1.42.1/lib/gio/modules/libgioremote-volume-monitor.so
Segmentation fault (core dumped)

While trying to reproduce I found a nixpkgs commit, where FF 52 is still cached, but doesn't segfault. Which is awesome, now I have 2 different ways to run firefox+java without recompiling:

  ff_java3 = with (import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/26cbfe1035547ddb885f66e52aa0ecc33239ae1f.tar.gz) {
    config = {
      firefox = {
        icedtea = true;
      };
    };
  });
    wrapFirefox firefoxPackages.firefox-esr-52 { };

@7c6f434c
Copy link
Member

7c6f434c commented Nov 7, 2019 via email

@danbst
Copy link
Contributor Author

danbst commented Nov 7, 2019

@7c6f434c I've tried to run it in empty env - still segfault.

[danbst@station:~/dev/nixpkgs]$ env -i DISPLAY=:0 ./result/bin/firefox --no-remote
Segmentation fault (core dumped)

[danbst@station:~/dev/nixpkgs]$ nix-store -qR result | grep glibc
/nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131

The working version has glibc 2.27, same as my system.

Anyway, I'll close the PR as I found two ways to achieve what I want without hacks. I may add a binary esr 52 attribute in a separate PR. Thanks, Michael!

@danbst danbst closed this Nov 7, 2019
@danbst danbst deleted the firefox-52-hydra branch November 7, 2019 17:27
@7c6f434c
Copy link
Member

7c6f434c commented Nov 7, 2019 via email

@danbst
Copy link
Contributor Author

danbst commented Nov 8, 2019

@7c6f434c OK, I've tried to debug crash with GDB, but without much luck. Every run ends with Thread 1 "firefox" received signal SIG38, Real-time event 38.. The stack is often corrupted and random. The best stack trace I've got was:

Thread 1 "firefox" received signal SIG38, Real-time event 38.
0x00007ffff7deb806 in dl_open_worker () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/ld-linux-x86-64.so.2
(gdb) backtrace
#0  0x00007ffff7deb806 in dl_open_worker () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/ld-linux-x86-64.so.2
#1  0x00007ffff6e4ac31 in _dl_catch_error () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/libc.so.6
#2  0x00007ffff7deb1e7 in _dl_open () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/ld-linux-x86-64.so.2
#3  0x00007ffff79b6f66 in dlopen_doit () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/libdl.so.2
#4  0x00007ffff6e4ac31 in _dl_catch_error () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/libc.so.6
#5  0x00007ffff79b7569 in _dlerror_run () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/libdl.so.2
#6  0x00007ffff79b6ff1 in dlopen@@GLIBC_2.2.5 () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/libdl.so.2
#7  0x00007ffff08e1ad2 in open_library () from /nix/store/8zin477qzyl9l27a24x4rvrmd7psvycb-libX11-1.6.5/lib/libX11.so.6
#8  0x00007ffff08e1bff in _XNoticeCreateBitmap () from /nix/store/8zin477qzyl9l27a24x4rvrmd7psvycb-libX11-1.6.5/lib/libX11.so.6
#9  0x00007ffff08e2231 in XCreatePixmap () from /nix/store/8zin477qzyl9l27a24x4rvrmd7psvycb-libX11-1.6.5/lib/libX11.so.6
....

but it is not the place where it fails - when going in debugger, XCreatePixmap function finishes fine, and fails in some upper frame (which is denoted with (??)):

#9  0x00007fffec91e93f in g_signal_emit () from /nix/store/yfab5qaigzgyqh4njf77b3g76057vw3f-glib-2.54.3/lib/libgobject-2.0.so.0
#10 0x00007ffff5cc70b6 in gtk_widget_realize () from /nix/store/igbys961f13y7jdzy2f53ydg9l8bkc95-gtk+3-3.22.28/lib/libgtk-3.so.0
#11 0x00007fffe8b5677a in ?? () from /nix/store/h1zc97mm7bsp823f5zng8hqr216walx9-firefox-esr-unwrapped-52.7.3esr/lib/firefox-52.7.3/libxul.so
#12 0x00007fffe9221697 in ?? () from /nix/store/h1zc97mm7bsp823f5zng8hqr216walx9-firefox-esr-unwrapped-52.7.3esr/lib/firefox-52.7.3/libxul.so
#13 0x00007fffe9221fef in ?? () from /nix/store/h1zc97mm7bsp823f5zng8hqr216walx9-firefox-esr-unwrapped-52.7.3esr/lib/firefox-52.7.3/libxul.so
#14 0x00007fffe9222534 in ?? () from /nix/store/h1zc97mm7bsp823f5zng8hqr216walx9-firefox-esr-unwrapped-52.7.3esr/lib/firefox-52.7.3/libxul.so
#15 0x00007fffe9439617 in ?? () from /nix/store/h1zc97mm7bsp823f5zng8hqr216walx9-firefox-esr-unwrapped-52.7.3esr/lib/firefox-52.7.3/libxul.so
#16 0x00007fffe94af5d3 in ?? () from /nix/store/h1zc97mm7bsp823f5zng8hqr216walx9-firefox-esr-unwrapped-52.7.3esr/lib/firefox-52.7.3/libxul.so
#17 0x00007fffe94aff29 in ?? () from /nix/store/h1zc97mm7bsp823f5zng8hqr216walx9-firefox-esr-unwrapped-52.7.3esr/lib/firefox-52.7.3/libxul.so
#18 0x00007fffe94b0215 in XRE_main ()
   from /nix/store/h1zc97mm7bsp823f5zng8hqr216walx9-firefox-esr-unwrapped-52.7.3esr/lib/firefox-52.7.3/libxul.so
#19 0x0000000000405ec2 in ?? ()
--Type <RET> for more, q to quit, c to continue without paging--
#20 0x00000000004051fd in ?? ()
#21 0x00007ffff6d43020 in __libc_start_main () from /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131/lib/libc.so.6
#22 0x000000000040545a in _start ()

At this point I don't even know what goes bad

To reproduce (my kernel is 5.3.7):

$ export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/0a70d65fd471e30fc1f300cc4eebaf18b56d90b8.tar.gz

$ export LA=$(nix-build '<nixpkgs>' -A glibcLocales --no-out-link)/lib/locale/locale-archive
these paths will be fetched (3.32 MiB download, 108.94 MiB unpacked):
  /nix/store/vg0s4sl74f5ik64wrrx0q9n6m48vvmgs-glibc-locales-2.26-131
copying path '/nix/store/vg0s4sl74f5ik64wrrx0q9n6m48vvmgs-glibc-locales-2.26-131' from 'https://cache.nixos.org'...

$ nix-build '<nixpkgs>' -A firefox-esr-52
/nix/store/9sxj7bim2iajkh4lv5s1l7872rzkrgk9-firefox-52.9.0esr

$ env -i DISPLAY=:0 LOCALE_ARCHIVE=$LA ./result/bin/firefox --no-remote
Segmentation fault (core dumped)

@danbst
Copy link
Contributor Author

danbst commented Nov 8, 2019

(sorry I've messed with FF versions, I had one previously working, 52.7.3 installed, and a new one 52.9.0, and both segfault. The newer gives more random stacktraces, the older gives consistently corrupted stacktraces)

@7c6f434c
Copy link
Member

7c6f434c commented Nov 8, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants