!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

905 Members
For people hacking on the Nix package manager itself191 Servers

Load older messages


SenderMessageTime
26 Dec 2024
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) Yeah, that makes more sense. Though I hope there could be a better way to find the broken usages in nixpkgs. Unspecified result makes the eval non-deterministic by nature. Does this mean that if this bug gets fixed and replaced with unspecified order instead of C++ UB nixpkgs would suddenly eval differently? 10:37:58
@aloisw:julia0815.de@aloisw:julia0815.deI don't think it is possible to determine in general whether a given comparator is broken. And I think literally depending on C++ UB is one of the cases where breaking evaluation compatibility is acceptable.10:40:06
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)At the very least we could first trace the problematic usages with a custom cppnix build and evaluate the scope of the disaster. Checking strict weak order properties by hand + random shuffling before the sort should surface at least some problems.10:43:29
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) Though random shuffling would have to preserve the order, since the sort is stable. 10:44:30
@aloisw:julia0815.de@aloisw:julia0815.deHow do you know what the problematic usages are in the first place?10:44:43
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)

See the original https://github.com/NixOS/nix/issues/12106#issue-2759417825 issue. I just reproduced the problem on my end on nixpkgs master (9a90c6b6218860ab29f79ecd6213c3a547c15c7e):

../nixpkgs-check-strict-weak-order/result/bin/nix-env -qa --json --arg config 'import pkgs/top-level/packages-config.nix'
/nix/store/4KRAB2H0HD4WVXXMSCXRW21PL77J4I7J-gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5117:
In function:
    void std::stable_sort(_RAIter, _RAIter, _Compare) [with _RAIter =
    nix::Value**; _Compare = nix::prim_sort(EvalState&, PosIdx, Value**,
    Value&)::<lambda(nix::Value*, nix::Value*)>]

Error: comparison doesn't meet irreflexive requirements, assert(!(a < a)).

Objects involved in the operation:
    instance "functor" @ 0x7ffff3cb8c90 {
      type = nix::prim_sort(nix::EvalState&, nix::PosIdx, nix::Value**, nix::Value&)::{lambda(nix::Value*, nix::Value*)#1};
    }
    iterator::value_type "ordered type"  {
      type = nix::Value*;
    }
[1]    2675868 abort (core dumped)  ../nixpkgs-check-strict-weak-order/result/bin/nix-env -qa --json --arg config
11:14:58
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)I'm not sure that if that actually explodes with normal usage though11:26:03
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)

A quick glance also shows that this gets triggered in tests.coq, so this is not a one-off problem:

nix-instantiate -A tests.coq

/nix/store/4KRAB2H0HD4WVXXMSCXRW21PL77J4I7J-gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5117:
In function:
    void std::stable_sort(_RAIter, _RAIter, _Compare) [with _RAIter =
    nix::Value**; _Compare = nix::prim_sort(EvalState&, PosIdx, Value**,
    Value&)::<lambda(nix::Value*, nix::Value*)>]

Error: comparison doesn't meet irreflexive requirements, assert(!(a < a)).

Objects involved in the operation:
    instance "functor" @ 0x7ffc7a9bef10 {
      type = nix::prim_sort(nix::EvalState&, nix::PosIdx, nix::Value**, nix::Value&)::{lambda(nix::Value*, nix::Value*)#1};
    }
    iterator::value_type "ordered type"  {
      type = nix::Value*;
    }
[1]    2713634 abort (core dumped)  nix-instantiate -A tests.coq
11:44:28
@trofi:matrix.orgtrofihttps://bpa.st/raw/JNGQ allows a bit better exception reporting. like https://bpa.st/raw/NBNQ11:52:31
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) Thanks! I guess it's just up to someone to rain nixmas gifts of bugfixes on nixpkgs. 11:59:34
@elikoga:matrix.orgelikoga changed their display name from elikoga to elikoga (@38c3 📞448{0,1}.15:21:56
@elikoga:matrix.orgelikoga changed their display name from elikoga (@38c3 📞448{0,1} to elikoga (@38c3 📞448{0,1}).15:26:08
@elikoga:matrix.orgelikoga changed their display name from elikoga (@38c3 📞448{0,1}) to elikoga (@38c3 📞488{0,1}).15:26:50
@trofi:matrix.orgtrofiExample fix: https://github.com/NixOS/nixpkgs/pull/36836615:49:49
@interacsion:matrix.org@interacsion:matrix.org joined the room.18:59:31
@czl92783719:mozilla.orgCarter Zhang[M] joined the room.22:55:39
@czl92783719:mozilla.orgCarter Zhang[M] Hello everyone, I just sudo apt install nix-bin and followed the steps mentioned in cat /usr/share/doc/nix-bin/README.Debian. What's next? 22:56:56
@trofi:matrix.orgtrofi* Example fix: https://github.com/NixOS/nixpkgs/pull/368366 (and also https://github.com/NixOS/nixpkgs/pull/368429 and https://github.com/NixOS/nixpkgs/pull/368433).23:15:07
27 Dec 2024
@perchun:matrix.orgPerchun Pak [don't ping; dm instead]
In reply to @czl92783719:mozilla.org
Hello everyone, I just sudo apt install nix-bin and followed the steps mentioned in cat /usr/share/doc/nix-bin/README.Debian. What's next?
Nix pills are a good way to learn nix
https://nixos.org/guides/nix-pills/
06:36:02
@czl92783719:mozilla.orgCarter Zhang[M]
In reply to @perchun:matrix.org
Nix pills are a good way to learn nix
https://nixos.org/guides/nix-pills/
Thanks
06:36:39
@raitobezarius:matrix.orgraitobezarius changed their display name from raitobezarius to raitobezarius (DECT: 3538 / EPVPN 2681).07:30:29
@tilpner:tx0.cotilpner changed their display name from tilpner to tilpner (38c3 3209).09:40:23
@garbas:matrix.orggarbas left the room.10:29:05
@dimitarnestorov:matrix.orgDimitar set a profile picture.11:41:07
@dimitarnestorov:matrix.orgDimitar changed their display name from dimitarnestorov to Dimitar.11:42:17
28 Dec 2024
@ronnypfannschmidt:matrix.org@ronnypfannschmidt:matrix.org left the room.17:57:34
@matthewcroughan:defenestrate.itmatthewcroughan changed their display name from matthewcroughan to matthewcroughan (DECT: 56490).18:55:44
29 Dec 2024
@anund_:matrix.organund_ joined the room.04:43:12
@sinan:sinanmohd.comsinan changed their profile picture.07:27:55
@elikoga:matrix.orgelikoga changed their display name from elikoga (@38c3 📞488{0,1}) to elikoga (@38c3 📞488{0,1,9}).11:03:22

Show newer messages


Back to Room ListRoom Version: 6