-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Termonad Segfaults from commit 56b1fa5 onwards on NixOS 18.09 #107
Comments
@craigem When you say building on NixOS 18.09, do you mean running something like: $ nix-build --arg nixpkgs '<nixpkgs>' Or do you mean just running As far as I am aware, the second one should work (although I don't have any support for the first one). Would you be able to describe a little bit more about how you're compiling Termonad? Also, you're compiling and running on Linux, correct? |
I thought I may have be being a little vague, so the work flow specifically is:
Which completes successfully. I then delete my cache:
and then I install the new build:
Lastly I run termonad, it then successfully builds my cached binary but segfaults when running it. This happened on every commit from 56b1fa5 except 56b1fa5 itself which refused to build in the nix-build phase due to a missing heterocephalus, as indicated in the commit message itself. Hopefully that clears up the workflow. |
Thanks for the updated info. I'll take a look at this and see if I can reproduce the problem. |
For the sake of reproduction, I first hit the issue whith a simple "git pull" on master, encountered the described segfault and worked back from there (including rolling back NixOS to make sure I'd not introduced some breakage). |
@craigem I had a chance to look at this, but I'm not able to reproduce this segfault on my system. Doing Ideally Termonad should not be segfaulting, especially if it successfully compiles. Would you be able to run Termonad in $ nix-build
/nix/store/1h6rp136j9xn2y2mg75i94ialarlvdyl-termonad-with-packages-8.6.3
$ ls -l /nix/store/1h6rp136j9xn2y2mg75i94ialarlvdyl-termonad-with-packages-8.6.3/bin
-r-xr-xr-x 1 root root 1553 Jan 1 1970 termonad
$ cat /nix/store/1h6rp136j9xn2y2mg75i94ialarlvdyl-termonad-with-packages-8.6.3/bin/termonad
#! /nix/store/gayzik3jx16rpc64czk5cy5s953431s6-bash-4.4-p23/bin/bash -e
export GIO_EXTRA_MODULES='/nix/store/m0ais13znv0g6g72mcs7k63zqg48dzsh-dconf-0.30.1-lib/lib/gio/modules'${GIO_EXTRA_MODULES:+':'}$GIO_EXTRA_MODULES
export GIO_EXTRA_MODULES='/nix/store/m0ais13znv0g6g72mcs7k63zqg48dzsh-dconf-0.30.1-lib/lib/gio/modules'${GIO_EXTRA_MODULES:+':'}$GIO_EXTRA_MODULES
export NIX_GHC='/nix/store/h2kpqakj951sqa97knhh9xsanscamk6n-ghc-8.6.3-with-packages/bin/ghc'
export XDG_DATA_DIRS='/nix/store/bll64d7jbr5xanwgyxh3wdbzdjmd0408-adwaita-icon-theme-3.30.1/share:/nix/store/bll64d7jbr5xanwgyxh3wdbzdjmd0408-adwaita-icon-theme-3.30.1/share:/nix/store/xrf7kkz9vh02rhmr9p2ssc05lbzlrvhr-hicolor-icon-theme-0.17/share:/nix/store/xrf7kkz9vh02rhmr9p2ssc05lbzlrvhr-hicolor-icon-theme-0.17/share:/nix/store/xrf7kkz9vh02rhmr9p2ssc05lbzlrvhr-hicolor-icon-theme-0.17/share:/nix/store/xrf7kkz9vh02rhmr9p2ssc05lbzlrvhr-hicolor-icon-theme-0.17/share:/nix/store/bll64d7jbr5xanwgyxh3wdbzdjmd0408-adwaita-icon-theme-3.30.1/share:/nix/store/bll64d7jbr5xanwgyxh3wdbzdjmd0408-adwaita-icon-theme-3.30.1/share:/nix/store/xrf7kkz9vh02rhmr9p2ssc05lbzlrvhr-hicolor-icon-theme-0.17/share:/nix/store/xrf7kkz9vh02rhmr9p2ssc05lbzlrvhr-hicolor-icon-theme-0.17/share:/nix/store/xrf7kkz9vh02rhmr9p2ssc05lbzlrvhr-hicolor-icon-theme-0.17/share:/nix/store/xrf7kkz9vh02rhmr9p2ssc05lbzlrvhr-hicolor-icon-theme-0.17/share'${XDG_DATA_DIRS:+':'}$XDG_DATA_DIRS
exec -a "$0" "/nix/store/1h6rp136j9xn2y2mg75i94ialarlvdyl-termonad-with-packages-8.6.3/bin/.termonad-wrapped" "${extraFlagsArray[@]}" "$@" The file Or, if you could come up with some sort of virtual machine that also exhibits this segfaulting behavior, that would be easier for me to take a look at. I have an example NixOps definition for Termonad here. You might be able to base something off of this: |
@craigem I tried updating to the latest release of 18.09 and Termonad still seems to work fine. I'm not able to reproduce the segfaults. One more thing you could try to do is to put |
In transit, just dropped into an airport, awaiting a connecting flight. Following your steps, the latest master still segfaults for me but your testing clearly shows this is a local issue. I've attached a strace I collected on the flight but have yet to examine myself, should curiosity get to you :-D |
@craigem I took a look at the strace output, but unfortunately it doesn't say a lot. Here's the relevant parts right before the segfault:
You can see that it reads However, I guess it is possible there are multiple threads doing other stuff, so you might need to run Also, it may be easier to just do some " I am definitely still interested in figuring this out and fixing it though, so let me know if you have any trouble with this. |
I ran into this too. I ran it through GDB. Here is a trace back:
and I'm wondering if we, the ones who run into this, use the same version of libpng? |
I have two versions installed but at this juncture I'm going to respond with a tentative "yes". In IRC I recently said this to @romanofski :
but as I've not been at it for a few days, what that was will elude me til I have another look at it.
|
You could try just commenting out the place where the Lines 291 to 292 in 94c5d51
Although it is puzzling why you would be seeing this, and I wouldn't, since we should be using the exact same version of $ nix-build
...
/nix/store/1h6rp136j9xn2y2mg75i94ialarlvdyl-termonad-with-packages-8.6.3
$ nix-store --query --requisites /nix/store/1h6rp136j9xn2y2mg75i94ialarlvdyl-termonad-with-packages-8.6.3 | grep png
/nix/store/3cl6mshpdrzbiz88307wmjbkwxdsmghi-libpng-apng-1.6.35
/nix/store/bsjs7p3cn1sdcvx1y2i49ikb3ygmardc-libpng-apng-1.6.35-dev |
@craigem @romanofski |
@cdepillabout Cheers! I tried to get a small reproducer running with debug symbols this morning, but failed. I did the same nix-build on a different distro and did not see the crash. I'm almost tempted to think it might be platform/kernel specific ... |
I've gotten around to try out HEAD (963d912) against Linux 4.14.104 #1-NixOS SMP Wed Feb 27 09:08:09 UTC 2019 x86_64 GNU/Linux (in case that is important) and no luck.
Different version of libpng, same version of glibc. I'm still interested in getting debug symbols. Perhaps it's related to our version of glibc we're using ... |
@romanofski Did you try commenting out the lines that load the PNG? I'm interested in whether or not that fixes this crash. If so, we know it is definitely a PNG-related issue. Also, are you on NixOS-18.09? Or NixOS-unstable? I'm on 18.09 here.
Looking at the backtrace, I think we're using the same version of libpng, glibc, etc. From your backtrace, it looks like you have the following:
Here's what it looks like for me, looking at it with $ nix-store --query --requisites /nix/store/i66kpbqff3mh1dbv2yycc7brpnxgn4p9-termonad-with-packages-8.6.3 | grep libpng
/nix/store/parrh56r6sr4ccp9ypl4sh7h5b19rijg-libpng-apng-1.6.36
/nix/store/8bfqx13gj1ibg9q440bqqxgk8i0hk1dq-libpng-apng-1.6.36-dev
$ nix-store --query --requisites /nix/store/i66kpbqff3mh1dbv2yycc7brpnxgn4p9-termonad-with-packages-8.6.3 | grep glibc
/nix/store/sw54ph775lw7b9g4hlfvpx6fmlvdy8qi-glibc-2.27
/nix/store/p1aicp5gllvlnnr8a49i3inrgal1w812-glibc-2.27-bin
/nix/store/qmg2fkspkzl0xsdqpmg3k06bmgp27saz-glibc-2.27-dev
$ nix-store --query --requisites /nix/store/i66kpbqff3mh1dbv2yycc7brpnxgn4p9-termonad-with-packages-8.6.3 | grep gdk-pixbuf
/nix/store/vyibwikjzxwr2l19xhz3b5zmrj73d8sw-gdk-pixbuf-2.38.0
/nix/store/gck5xpcgrd7krswqnni04p17g9q8mxkg-gdk-pixbuf-2.38.0-dev
$ nix-store --query --requisites /nix/store/i66kpbqff3mh1dbv2yycc7brpnxgn4p9-termonad-with-packages-8.6.3 | grep gtk+
/nix/store/xywpyd0gf2fca3vxczkra72y29phlz4d-gtk+3-3.24.4
/nix/store/yrbj7k2ajhnmbf2mwk0zrxnkn3n48xwq-gtk+3-3.24.4-dev Oh wait, it looks like you have anolder version of $ ldd /nix/store/i66kpbqff3mh1dbv2yycc7brpnxgn4p9-termonad-with-packages-8.6.3/bin/.termonad-wrapped | grep -i pixbuf
libgdk_pixbuf-2.0.so.0 => /nix/store/vyibwikjzxwr2l19xhz3b5zmrj73d8sw-gdk-pixbuf-2.38.0/lib/libgdk_pixbuf-2.0.so.0 (0x00007feabe708000) |
@cdepillabout Sorry I keep ignoring that point, am I (re commenting out loading of the PNG). Will definitely have a look tonight. In regards to the other points:
Also will check the gdk-pixbuf version. |
Alright answers:
and same output with
However, you're right... when I run the binary which causes the segfault there is this older version of gdk-pixbuf again:
So .. aeh.. wtf? I'll check if I can get rid of it ... |
@romanofski Thanks for looking into this. So I guess for now if you (or anyone else) is running into this but still want to use Termonad, then commenting out the problematic lines is a reasonable workaround.
Oh sorry, we do actually get the same output here. I had removed the
That's very strange. One version of gdk-pixbuf calling into an older version definitely sounds like it could result in a segfault. I have no idea how that could happen in practice though. Do you maybe have something strange in your LD_LIBRARY_PATH env var? Or maybe you could try running |
@cdepillabout Yes I'm surprised as well. I've found several binaries on the system mainly installed from NixOS-18.09 which are linked against Cheers for the pointer to |
I
The librsvg has a gdkpixbuf loaders.cache which points to
loading the PNG by the different version of gdk-pixbuf. I'm surprised that librsvg has it's own loaders.cache. I guess it would defeat any isolation Nix is trying to accomplish here. Same thing also happens with my I'm currently not sure if using a different version actually corrupts the loading, but it's certainly very odd. |
I tried searching on nixpkgs for this problem and it seems like there are other people running into this: NixOS/nixpkgs#54278 I just sent a PR that makes sure to set XDG_DATA_DIRS to point to pixbuf. I don't know if that would help at all, but you could try it out: |
I believe this has been fixed in #109, so I am going to go ahead and merge this. If anyone else is seeing this problem, please leave a message on this thread. |
Cheers @cdepillabout and @craigem. Getting behind this was an enjoying puzzle. |
Confirming that it's fixed for me. Thanks! (built Termonad from master on NixOS 18.09) |
From the commit logs I expect that this behaviour is expected in the transition to the latest nixpkgs but I felt it was worth flagging in case my assumption was incorrect.
Termonad beyond commit 56b1fa5 builds OK on NixOS 18.09 but segfaults after compiling then attempting to run user's Termonad binary.
I've got strace output etc should it be deemed useful.
The text was updated successfully, but these errors were encountered: