NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.08k forks source link

zipkin server broken when used in a nix-shell #111911

Open pallix opened 3 years ago

pallix commented 3 years ago

Describe the bug The zipkin package crashes when used within a nix-shell on debian 10.

To Reproduce Steps to reproduce the behavior:

[user@work-dev ~/projects/extern/nixos_bug_report]
λ cat default.nix 
{...}:
let pkgs_stable_src = builtins.fetchGit {
    name = "nixpkgs-nixos-20.09";
    url = "https://github.com/nixos/nixpkgs/";
    ref = "refs/heads/nixos-20.09";
    rev = "90cec09c3642b9be6699015a35e404ecb503aa0d";
    };
    pkgs_unstable_src = builtins.fetchGit {
      name = "nixpkgs-unstable-2021-02-02";
      url = "https://github.com/nixos/nixpkgs/";
      ref = "refs/heads/nixos-unstable";
      rev = "65211f5afcc3637c55423b327157a5eae05dff67";
    };
    zipkin_overlay = (self: super: {
      zipkin = super.zipkin.overrideAttrs (old:
        let
          version = "2.9.4";
          src = builtins.fetchurl {
            url = "https://search.maven.org/remotecontent?filepath=io/zipkin/java/zipkin-server/${version}/zipkin-server-${version}-exec.jar";
            sha256 = "1p8gxscjbzjszvp7710yb4hjmz8x56dvbffacsg9d944q0qn2n2z";
          };
        in {
          inherit version src;

          buildCommand =
            ''
            mkdir -p $out/share/java
            cp ${src} $out/share/java/zipkin-server-${version}-exec.jar
            mkdir -p $out/bin
            makeWrapper ${super.jre}/bin/java $out/bin/zipkin-server \
                  --add-flags "-cp $out/share/java/zipkin-server-${version}-exec.jar org.springframework.boot.loader.JarLauncher"
          '';
        }
      );
    });
    pkgs_stable = import pkgs_stable_src {};
    pkgs_unstable = import pkgs_unstable_src {};
    pkgs_unstable_with_latest_zipkin = import pkgs_unstable_src { overlays = [ zipkin_overlay
                                                                             ];
                                                                             };
in
pkgs_unstable.mkShell {
  buildInputs = [
    # pkgs_stable.zipkin # working
    # pkgs_unstable.zipkin # not working
    pkgs_unstable_with_latest_zipkin.zipkin # not working
  ];
}
[user@work-dev ~/projects/extern/nixos_bug_report]
λ nix-shell

[nix-shell:~/projects/extern/nixos_bug_report]$ zipkin-server 
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
[...]
[nix-shell:~/projects/extern/nixos_bug_report]$ cat /etc/debian_version 
10.7

Expected behavior zipkin starts without crashing.

Screenshots Here a log of the console output:

λ nix-shell

[nix-shell:~/projects/extern/nixos_bug_report]$ zipkin-server 
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
                                    ********
                                  **        **
                                 *            *
                                **            **
                                **            **
                                 **          **
                                  **        **
                                    ********
                                      ****
                                      ****
        ****                          ****
     ******                           ****                                 ***
  ****************************************************************************
    *******                           ****                                 ***
        ****                          ****
                                       **
                                       **

             *****      **     *****     ** **       **     **   **
               **       **     **  *     ***         **     **** **
              **        **     *****     ****        **     **  ***
             ******     **     **        **  **      **     **   **

:: Powered by Spring Boot ::         (v2.0.3.RELEASE)

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/nix/store/pw0zg1hql1akgdd1yw5snga3pw1zsi2z-zipkin-server-2.9.4/share/java/zipkin-server-2.9.4-exec.jar!/BOOT-INF/lib/spring-core-5.0.7.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-02-04 13:28:15.639  INFO 10417 --- [           main] o.xnio                                   : XNIO version 3.3.8.Final
2021-02-04 13:28:15.670  INFO 10417 --- [           main] o.x.nio                                  : XNIO NIO Implementation Version 3.3.8.Final
2021-02-04 13:28:15.813  WARN 10417 --- [           main] i.u.w.jsr                                : UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
2021-02-04 13:28:15.813  WARN 10417 --- [           main] i.u.w.jsr                                : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2021-02-04 13:28:15.881  INFO 10417 --- [           main] i.u.servlet                              : Initializing Spring embedded WebApplicationContext
2021-02-04 13:28:17.583  INFO 10417 --- [           main] c.d.d.core                               : DataStax Java driver 3.5.0 for Apache Cassandra
2021-02-04 13:28:17.602  INFO 10417 --- [           main] c.d.d.c.GuavaCompatibility               : Detected Guava >= 19 in the classpath, using modern compatibility layer
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000000000000, pid=10417, tid=10418
#
# JRE version: OpenJDK Runtime Environment (15.0.1) (build 15.0.1+0-adhoc..jdk15u-jdk-15.0.1-ga)
# Java VM: OpenJDK 64-Bit Server VM (15.0.1+0-adhoc..jdk15u-jdk-15.0.1-ga, mixed mode, sharing, tiered, compressed oops, serial gc, linux-amd64)
# Problematic frame:
# C  0x0000000000000000
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/user/projects/extern/nixos_bug_report/hs_err_pid10417.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted

Additional context It crashes with nixpkgs pinned on unstable and also with an overlay updating the zipkin package. I am using a debian 10 VM on Qubes OS.

Log of the JVM crash: hs_err_pid10296.log

Notify maintainers

Metadata

λ nix-shell -p nix-info --run "nix-info -m" these paths will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/l5gksj4fh6ipwk58aiavn9c69p05lh9y-stdenv-linux /nix/store/lg0jidy4549q44z3hggv3vb1ljin223k-nix-info copying path '/nix/store/lg0jidy4549q44z3hggv3vb1ljin223k-nix-info' from 'https://cache.nixos.org'... copying path '/nix/store/l5gksj4fh6ipwk58aiavn9c69p05lh9y-stdenv-linux' from 'https://cache.nixos.org'...

Maintainer information:
```yaml
# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
turion commented 3 years ago

CC @hectorj

turion commented 3 years ago

On NixOS, I don't experience the crash. Must be related to Nix on a non-Nixos system (Debian in this case).

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info