NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.49k stars 13.67k forks source link

[xmrig] `*** buffer overflow detected ***: terminated` on recent NixOS #245534

Closed MrFoxPro closed 1 year ago

MrFoxPro commented 1 year ago

Describe the bug

In NixOS after recent nixpkgs updates I'm getting Xmrig error on rx/0 algorithm. However, kawpow with CUDA works fine. It was working before. I tried both 6.19.4 and 6.20.0, none worked

Steps To Reproduce

systemd.services.xmrig-rx =
  mkXmrig
  {
    pools = [
      {
        enabled = true;
        url = "127.0.0.1:3333";
        user = "huanazhi";
        keepalive = true;
        tls = false;
      }
      {
        enabled = true;
        url = "gulf.moneroocean.stream:10128";
        user = moneroWallet;
        algo = "rx/0";
        pass = "<>";
        keepalive = false; # Mandatory for moneroocean
        tls = false;
      }
    ];
    randomx."1gb-pages" = true;
    cpu.huge-pages = true;
    cpu.yield = false;
    cpu.priority = 4;
  }
  {after = ["p2pool.service"];};

Expected behavior

It should just work.

Screenshots

image

Additional context

Trace: https://paste.mozilla.org/aSMka3oZ Linux huananzhi 6.1.38 #1-NixOS SMP PREEMPT_DYNAMIC Wed Jul 5 17:27:38 UTC 2023 x86_64 GNU/Linux NixOS Related: https://github.com/xmrig/xmrig/issues/3305

Notify maintainers

@ratsclub @kim0

Metadata

I built remotely from flake, no output here

eitau commented 1 year ago

I started getting *** buffer overflow detected ***: terminated errors when running zip and mtr very recently (gdb says __mbstowcs_chk and __snprintf_chk respectively are failing). Odd if coincidence…

Edit: mtr indeed got some snprintf related fixes recentish.

ratsclub commented 1 year ago

I'm sorry for taking this long to reply. I tried debugging this issue and couldn't find a root cause for now, it's out of my league...

Just to make it clear what I tried:

ratsclub commented 1 year ago

@MrFoxPro @eitau check out #250775, please.

eitau commented 11 months ago

@ratsclub I'm incredibly sorry that I haven't respond earlier here and in #250775. I'm not that active on GitHub and it logged me out. I'll redirect notifications to an unbloated email inbox so this'll never happen again.