gcc internal error when building unionfs-fuse #120

Closed
edwintorok opened this Issue Mar 12, 2013 · 6 comments

Comments

Projects
None yet
3 participants
@edwintorok

Installed nixos from nixos-graphical-0.2pre4545_763835e-b8339a1-x86_64-linux.iso

GCC (or libc?) seems to be seriously broken, attached testcase from failed unionfs build [*]:

# gcc -c foo.i -O2
/tmp/nix-build-unionfs-fuse-0.26.drv-4/unionfs-fuse-0.26/src/unionfs.c: In function ‘unionfs_statfs’:
/tmp/nix-build-unionfs-fuse-0.26.drv-4/unionfs-fuse-0.26/src/unionfs.c:837:1: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

I've tried using nix-env -i gcc-wrapper-4.6.3 and nix-env -i gcc-wrapper.4.7.2, and both of those failed.
Using same compiler version (4.6.3 and 4.7.2) on Debian does NOT crash.

nixos info:

# nixos-version 
0.2pre4545_763835e-b8339a1
# uname -a
Linux nixos 3.2.39 #1 SMP Wed Mar 6 15:09:30 UTC 2013 x86_64 GNU/Linux
# /nix/store/hi387lq9x38cfwb915vv4b0zdh76wazc-gcc-4.6.3/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/nix/store/hi387lq9x38cfwb915vv4b0zdh76wazc-gcc-4.6.3/bin/gcc
COLLECT_LTO_WRAPPER=/nix/store/hi387lq9x38cfwb915vv4b0zdh76wazc-gcc-4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: 
Thread model: posix
gcc version 4.6.3 (GCC)

If I run the compiler under valgrind in nixos, it doesn't crash again, and no errors are shown:
valgrind --trace-children=yes /nix/store/hi387lq9x38cfwb915vv4b0zdh76wazc-gcc-4.6.3/bin/gcc -O1 foo.i -c -B/nix/store/hi387lq9x38cfwb915vv4b0zdh76wazc-gcc-4.6.3/lib64 -B/nix/store/zpr8jdx10napidkyz62f3nzl5fm87jyr-glibc-2.17/lib/ -B/nix/store/qihqla2a8s253lbnr72gp2kyp1m69fa0-gcc-wrapper-4.6.3/bin/

Tried to build a CD image as described in the manual but it complained about memtest being a 404, so I've added the nixos-unstable channel, used nixos-checkout to get newer version, and tried to use nixos-build or nixos-rebuild test -I /etc/nixos/nixos. Both failed when trying to build unionfs.

@viric

This comment has been minimized.

Show comment Hide comment
@viric

viric Mar 12, 2013

Member

On Tue, Mar 12, 2013 at 06:03:20AM -0700, edwintorok wrote:

Here is the testcase:
https://gist.github.com/edwintorok/5142704/raw/8a166cde3f2f28ec9da7ec588cfbc844d770c08c/foo.i

Can you try using a recent kernel? 3.7 or 3.8. It's a matter of defining
kernelPackages in configuration.nix.

I'm not sure, but I think nixpkgs requires 3.7 or 3.8.

Regards,
Lluís.

Member

viric commented Mar 12, 2013

On Tue, Mar 12, 2013 at 06:03:20AM -0700, edwintorok wrote:

Here is the testcase:
https://gist.github.com/edwintorok/5142704/raw/8a166cde3f2f28ec9da7ec588cfbc844d770c08c/foo.i

Can you try using a recent kernel? 3.7 or 3.8. It's a matter of defining
kernelPackages in configuration.nix.

I'm not sure, but I think nixpkgs requires 3.7 or 3.8.

Regards,
Lluís.

@viric

This comment has been minimized.

Show comment Hide comment
@viric

viric Mar 12, 2013

Member

On Tue, Mar 12, 2013 at 02:17:36PM +0100, Lluís Batlle i Rossell wrote:

On Tue, Mar 12, 2013 at 06:03:20AM -0700, edwintorok wrote:

Here is the testcase:
https://gist.github.com/edwintorok/5142704/raw/8a166cde3f2f28ec9da7ec588cfbc844d770c08c/foo.i

Can you try using a recent kernel? 3.7 or 3.8. It's a matter of defining
kernelPackages in configuration.nix.

I'm not sure, but I think nixpkgs requires 3.7 or 3.8.

I checked again, and the master glibc requires 2.6.35 minimum, not more.

Nevertheless, I tried that 'foo.i', and it builds fine here, using the very same
gcc you use.

This builds perfectly: /nix/store/5xqgsd101i4ah40639zbpizydvf1cgvh-unionfs-fuse-0.26

Do you run that in a virtual machine? GMP used to segfault (or
sigabrt) in qemu, unless some flags were given about the processor type.

Regards,
Lluís.

Member

viric commented Mar 12, 2013

On Tue, Mar 12, 2013 at 02:17:36PM +0100, Lluís Batlle i Rossell wrote:

On Tue, Mar 12, 2013 at 06:03:20AM -0700, edwintorok wrote:

Here is the testcase:
https://gist.github.com/edwintorok/5142704/raw/8a166cde3f2f28ec9da7ec588cfbc844d770c08c/foo.i

Can you try using a recent kernel? 3.7 or 3.8. It's a matter of defining
kernelPackages in configuration.nix.

I'm not sure, but I think nixpkgs requires 3.7 or 3.8.

I checked again, and the master glibc requires 2.6.35 minimum, not more.

Nevertheless, I tried that 'foo.i', and it builds fine here, using the very same
gcc you use.

This builds perfectly: /nix/store/5xqgsd101i4ah40639zbpizydvf1cgvh-unionfs-fuse-0.26

Do you run that in a virtual machine? GMP used to segfault (or
sigabrt) in qemu, unless some flags were given about the processor type.

Regards,
Lluís.

@edwintorok

This comment has been minimized.

Show comment Hide comment
@edwintorok

edwintorok Mar 12, 2013

Yes, I've run it in KVM.
I've set it to copy the host's capabilities now, and it no longer crashes:
-cpu Opteron_G3,+wdt,+skinit,+ibs,+osvw,+3dnowprefetch,+cr8legacy,+extapic,+cmp_legacy,+3dnow,+3dnowext,+pdpe1gb,+fxsr_opt,+mmxext,+ht,+vme

Could this be documented somewhere? Or better yet, could GMP be fixed to not crash when run in a VM?

Yes, I've run it in KVM.
I've set it to copy the host's capabilities now, and it no longer crashes:
-cpu Opteron_G3,+wdt,+skinit,+ibs,+osvw,+3dnowprefetch,+cr8legacy,+extapic,+cmp_legacy,+3dnow,+3dnowext,+pdpe1gb,+fxsr_opt,+mmxext,+ht,+vme

Could this be documented somewhere? Or better yet, could GMP be fixed to not crash when run in a VM?

@viric

This comment has been minimized.

Show comment Hide comment
@viric

viric Mar 12, 2013

Member

On Tue, Mar 12, 2013 at 06:56:35AM -0700, edwintorok wrote:

Yes, I've run it in KVM.
I've set it to copy the host's capabilities now, and it no longer crashes:
-cpu Opteron_G3,+wdt,+skinit,+ibs,+osvw,+3dnowprefetch,+cr8legacy,+extapic,+cmp_legacy,+3dnow,+3dnowext,+pdpe1gb,+fxsr_opt,+mmxext,+ht,+vme

Could this be documented somewhere? Or better yet, could GMP be fixed to not crash when run in a VM?

GMP people consider this a feature. We used to have it patched, but I don't know
what were the decisions around the last stdenv-updates. Maybe we decided to drop
the patch, maybe we forgot to add it. :)

When we had the patch, I didn't know about the "-cpu" flag of qemu.

Maybe the git logs for gmp tell more.

Member

viric commented Mar 12, 2013

On Tue, Mar 12, 2013 at 06:56:35AM -0700, edwintorok wrote:

Yes, I've run it in KVM.
I've set it to copy the host's capabilities now, and it no longer crashes:
-cpu Opteron_G3,+wdt,+skinit,+ibs,+osvw,+3dnowprefetch,+cr8legacy,+extapic,+cmp_legacy,+3dnow,+3dnowext,+pdpe1gb,+fxsr_opt,+mmxext,+ht,+vme

Could this be documented somewhere? Or better yet, could GMP be fixed to not crash when run in a VM?

GMP people consider this a feature. We used to have it patched, but I don't know
what were the decisions around the last stdenv-updates. Maybe we decided to drop
the patch, maybe we forgot to add it. :)

When we had the patch, I didn't know about the "-cpu" flag of qemu.

Maybe the git logs for gmp tell more.

@domenkozar

This comment has been minimized.

Show comment Hide comment
@domenkozar

domenkozar May 20, 2016

Member

Please open an issue at https://github.com/NixOS/nixpkgs/issues if issue persists.

Member

domenkozar commented May 20, 2016

Please open an issue at https://github.com/NixOS/nixpkgs/issues if issue persists.

@domenkozar domenkozar closed this May 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment