-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
pcloud crashes with SIGSEGV on recent nixpkgs unstable #226339
Comments
This reverts commit 60b5575. pCloud doesn't work. See NixOS/nixpkgs#226339
Having the same issue with NixOS unstable on my machine. |
@Patryk27 hey, sorry to tag you, but maybe you can help ? |
You can try following the revisions in this flake. |
@juanibiapina this is what works for me currently: https://git.sr.ht/~r-vdp/nixos-config/tree/00076882a59b0ba2feb4d43b95a7a298ebb8bcd2/item/package-overrides.nix#L37 |
Unable to figure out why your hash is different, it seems to be the same archive in nixpkgs |
Thanks for tagging - I'll take a look later today or tomorrow! |
Interestingly, it crashes somewhere in icu-60:
... but faking a timezone:
... causes it to both print a weird warning message:
... and segfault somewhere else - during v8's initialization:
This weird-warning-message and crashes don't happen when I checkout older nixpkgs (e.g. This low-key suggests an ABI mismatch on the libnode.so <-> nixpkgs' icu boundary -- maybe we're linking stuff that accidentally produces I'm trying to bisect what's changed but it takes a while 😅 |
Thanks so much @Patryk27 for looking into this! |
Okie, it looks like #209870 is somehow at fault here:
I'm not yet sure what's actually causing it, though 🤔 |
More funky stuff: it looks like the first divergence happens on a
... while the invalid version does:
(note that both traces above exhibit different glibc but I've just checked with newer pcloud downgraded to glibc-2.35-224 and the same thing happens) Edit: what's even weirder is that judging by the source code: ... this Edit 2: yeah, it looks like for some reason the invalid libnode.so gets the address wrong -- the correct code has:
... while the invalid code uses a different address for some reason:
(the addresses for |
Okie, I think I've found the culprit - patchelf generates an invalid Downgrading patchelf doesn't help here though, and that kinda suggests that there exist some another issue in patchelf that has just gotten exacerbated by #209870. No fix just yet, although I'm open to ideas 😅 |
Could you offer a workaround while this patchelf-error is not fixed? For non-flake users? |
@StefanSchroeder you can do essentially the same as I did, but instead of getting the 22.11 nixpkgs through a flake input, you get it with |
Ummmh, my Nix-foo is not that well developed. Would you guide me through it? I installed 23.05 yesterday. I can examine and patch pcloud/default.nix. But as far as I understand, the error is outside of pcloud. So, where exactly would I put the |
@StefanSchroeder a basic NixOS module could look something like this: https://gist.github.com/R-VdP/999dd803c96aee0cb6a176eadef0978e I included the part that updates pcloud to the latest 1.13.0 release. |
When I import that file
|
If you're doing:
... then you'll have to change |
That worked! |
Ah yeah, that should have been |
Any news on when this will be merged? Thanks everyone! |
No idea, unfortunately - it looks like patchelf has an unresolved bug so it's not just a matter of waiting for when something gets merged somewhere, but rather waiting for someone to fix that bug; I don't have enough time on my hands to taking a stab at it, though 👀 |
Thanks for the response and all the work that you contributed! Right now my skill set is not very high in this area, I wish I could help more. Maybe in the future as I lean more. |
@Patryk27: I had a quick look today, and I noticed that pcloud uses So I guess we might need to report the issue in that repo. It could also be that actually using the |
fwiw, @r-vdp, it looks like that hook uses pyelftools to scan the binary files, but all the patching ultimately ends up happening through patchelf - e.g.:
This also matches my observations in NixOS/patchelf#482 (comment) where changing the version of patchelf generates files that are broken in different ways, which suggests that something might be going on there 👀 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/pcloud-gives-segmentation-fault/31330/2 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Status: I've gotten back to fixing this bug - currently I've narrowed the issue down to this place: ... which doesn't implement support for rewriting values other than I think this used not to be a problem before #209870 got merged, because that change made tl;dr when building pcloud, patchelf modifies pcloud's libraries (shuffling stuff in the memory), but then forgets to update other parts of binary, which continue to refer to the older memory addresses instead of the new ones - this causes sigsegv when trying to start the app I'll report back once I have more information. Related:
ProgressPatch is ready! |
Thanks a lot for providing this workaround. Just in case anybody else still needs to use this workaround...
|
Even though the title of this issue no longer applies, because I am reporting for 24.05-stable here, |
can confirm issue persists on 24.05 |
@Patryk27 you had done some work on this. It seems that NixOS/patchelf#544 might be the solution. |
So, the remaining issue is a couple of tests failing on less popular architectures - if you scroll down to the bottom of the pull request, right after I haven't had much time to re-investigate it, but I do have a couple of spare hours this weekend, so I'll try giving it another shot. That being said, you can still apply the patch on your system in the meantime, you don't have to wait until it's merged. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Describe the bug
Running pcloud from nixos-unstable crashes with a segmentation fault:
The same build used to work before, so I guess there is an ABI incompatibility in one of the runtime dependencies.
The text was updated successfully, but these errors were encountered: