Giter Site home page Giter Site logo

Comments (5)

yorickvP avatar yorickvP commented on September 23, 2024 1

IIRC: it's hard to detect stack overflows on darwin, the error message for that doesn't always work, so this might be an ordinary stack overflow instead of memory corruption.

from nix.

nixos-discourse avatar nixos-discourse commented on September 23, 2024

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rust-in-nix-discussion-thread/5092/21

from nix.

n8henrie avatar n8henrie commented on September 23, 2024

No luck with GC_DONT_GC=1 this time

from nix.

n8henrie avatar n8henrie commented on September 23, 2024

Thanks for your input, I think you're probably correct.

This shows the basics idea of my flake setup, which has been working fairly well for the last year or so:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs";
    nixpkgs-stable.url = "github:nixos/nixpkgs/release-23.11";
  };

  outputs = {
    self,
    nixpkgs,
    ...
  } @ inputs: let
    inherit (nixpkgs) lib;

    hosts = {
      mymachine.system = "aarch64-darwin";
      othermachine = {
        system = "aarch64-darwin";
        nixpkgs = inputs.nixpkgs-stable;
      };
    };
  in
    lib.foldlAttrs (acc: hostname: conf: let
      nixpkgs = conf.nixpkgs or inputs.nixpkgs;
    in
      lib.recursiveUpdate acc {
        packages.${conf.system}.default = nixpkgs.legacyPackages.${conf.system}.hello;
      }) {}
    hosts;
}

(This minimal example builds, whereas mine segfaults.)

In my actually crashing flake, if I change nixpkgs = conf.nixpkgs or inputs.nixpkgs; to nixpkgs = conf.nixpkgs or self.inputs.nixpkgs;, I go from a segfault to an infinite recursion error, even though AFAICT inputs.nixpkgs and self.inputs.nixpkgs should be the same thing.

I'm also not sure why it gives me segfault or infinite recursion whereas this works. Maybe I'm barking up the wrong tree.

from nix.

n8henrie avatar n8henrie commented on September 23, 2024

I noted that 2.20 seems to have some changes relevant to stack overflows; this seems to confirm the issue (with a much better error message):

$ nix run github:nixos/nix/2.20-maintenance -- build .#darwinConfigurations.natepro.config.system.build.toplevel
warning: updating lock file '/Users/n8henrie/git/nixos/flake.lock':
• Updated input 'modules':
    'path:/nix/store/4d3ygplv20ymmsx0az7yh136asmm1vr2-source/modules?lastModified=1&narHash=sha256-zPNgdnLrKUd2c0wMzH3wyivqivC5JQmAHMCEVz00ZG4%3D' (1970-01-01)
  → 'path:/nix/store/my2zyiknkk118jjblmf3gd3arcwf62hn-source/modules?lastModified=1&narHash=sha256-zPNgdnLrKUd2c0wMzH3wyivqivC5JQmAHMCEVz00ZG4%3D' (1970-01-01)
error:
       … while evaluating the attribute 'config'
         at /nix/store/8gsd9h76snq5sgcnwjip3c3p9wxbrjzm-source/lib/modules.nix:322:9:
          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          323|         _module = checked (config._module);

       … while calling the 'seq' builtin
         at /nix/store/8gsd9h76snq5sgcnwjip3c3p9wxbrjzm-source/lib/modules.nix:322:18:
          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          323|         _module = checked (config._module);

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: stack overflow; max-call-depth exceeded
       at /nix/store/8gsd9h76snq5sgcnwjip3c3p9wxbrjzm-source/lib/trivial.nix:438:10:
          437|     then f.__functionArgs or (functionArgs (f.__functor f))
          438|     else builtins.functionArgs f;
             |          ^
          439|

I suspect this is already covered in #8281

Thanks for pointing me in the right direction @yorickvP!

from nix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.