Skip to content

compiling libstd with -Z extra-debug-info results in "intrinsics.rs:402:8: 402:38 warning: debuginfo: Could not find namespace node for function. This is a bug! ..." #9190

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

Closed
glycerine opened this issue Sep 14, 2013 · 2 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@glycerine
Copy link

On Ubuntu 12.04/amd64, gcc 4.7.2, when I'm trying to build rust with -Z debug-info on stage1 and -Z extra-debug-info on stage2, libstd will not compile, and possibly points out a compiler bug if the error message is to be believed.

me@host:/usr/cn/rust/debug-build/rust$ make VERBOSE=1 
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu
cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE)
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: disabling C++ optimization (CFG_DISABLE_OPTIMIZE_CXX)
cfg: using ccache gcc
cfg: enabling valgrind (CFG_ENABLE_VALGRIND)
cfg: no llnextgen found, omitting grammar-verification
cfg: disabling doc build (CFG_DISABLE_DOCS)
x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1   --cfg debug -Z no-debug-borrows -Z debug-info --target=x86_64-unknown-linux-gnu  --cfg rustpkg -o x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rustpkg /usr/cn/rust/debug-build/rust/src/driver/driver.rs
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "Warning: removing previous" \'librustpkg-*.so\' "libraries:" $MATCHES; rm $MATCHES ; fi
cp x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustpkg.so x86_64-unknown-linux-gnu/stage2/lib/librustpkg.so
Info: now are following matches for librustpkg-*.so libraries:
cp -R x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustpkg-*.so  x86_64-unknown-linux-gnu/stage2/lib
cp x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rustpkg x86_64-unknown-linux-gnu/stage2/bin/rustpkg
x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1   --cfg debug -Z no-debug-borrows -Z debug-info --target=x86_64-unknown-linux-gnu  --cfg rustdoc -o x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rustdoc /usr/cn/rust/debug-build/rust/src/driver/driver.rs
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "Warning: removing previous" \'librustdoc-*.so\' "libraries:" $MATCHES; rm $MATCHES ; fi
cp x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustdoc.so x86_64-unknown-linux-gnu/stage2/lib/librustdoc.so
Info: now are following matches for librustdoc-*.so libraries:
cp -R x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustdoc-*.so  x86_64-unknown-linux-gnu/stage2/lib
cp x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rustdoc x86_64-unknown-linux-gnu/stage2/bin/rustdoc
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "Warning: removing previous" \'librust-*.so\' "libraries:" $MATCHES; rm $MATCHES ; fi
x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1   --cfg debug -Z no-debug-borrows -Z debug-info --target=x86_64-unknown-linux-gnu  -D warnings --out-dir x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib /usr/cn/rust/debug-build/rust/src/librust/rust.rs && touch x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librust.so
Info: now are following matches for librust-*.so libraries:
librust-28ac9d9c3782cf3d-0.8-pre.so
x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1   --cfg debug -Z no-debug-borrows -Z debug-info --target=x86_64-unknown-linux-gnu  --cfg rust -o x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rust /usr/cn/rust/debug-build/rust/src/driver/driver.rs
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "Warning: removing previous" \'librust-*.so\' "libraries:" $MATCHES; rm $MATCHES ; fi
cp x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librust.so x86_64-unknown-linux-gnu/stage2/lib/librust.so
Info: now are following matches for librust-*.so libraries:
cp -R x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librust-*.so  x86_64-unknown-linux-gnu/stage2/lib
cp x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rust x86_64-unknown-linux-gnu/stage2/bin/rust
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "Warning: removing previous" \'libstd-*.so\' "libraries:" $MATCHES; rm $MATCHES ; fi
x86_64-unknown-linux-gnu/stage2/bin/rustc --cfg stage2   --cfg debug -Z no-debug-borrows -Z extra-debug-info --target=x86_64-unknown-linux-gnu  -D warnings --out-dir x86_64-unknown-linux-gnu/stage2/lib/rustc/x86_64-unknown-linux-gnu/lib /usr/cn/rust/debug-build/rust/src/libstd/std.rs && touch x86_64-unknown-linux-gnu/stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd.so
/usr/cn/rust/debug-build/rust/src/libstd/std.rs:1:0: 1:0 note: debuginfo for trait NYI
/usr/cn/rust/debug-build/rust/src/libstd/std.rs:1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
                                                  ^
/usr/cn/rust/debug-build/rust/src/libstd/unstable/intrinsics.rs:402:8: 402:38 warning: debuginfo: Could not find namespace node for function. This is a bug! Try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
/usr/cn/rust/debug-build/rust/src/libstd/unstable/intrinsics.rs:402     pub fn get_tydesc<T>() -> *TyDesc;
                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/cn/rust/debug-build/rust/src/libstd/repr.rs:628:12: 628:13 note: debuginfo for trait NYI
/usr/cn/rust/debug-build/rust/src/libstd/repr.rs:628         let u = ReprVisitor(ptr, writer);
                                                                 ^
error: internal compiler error: node_id_to_type: no type for node `local (id=154768, name=td)`
make: *** [x86_64-unknown-linux-gnu/stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd.so] Error 101
me@host:/usr/cn/rust/debug-build/rust$ export RUST_LOG=rustc=1
me@host:/usr/cn/rust/debug-build/rust$ x86_64-unknown-linux-gnu/stage2/bin/rustc --cfg stage2   --cfg debug -Z no-debug-borrows -Z extra-debug-info --target=x86_64-unknown-linux-gnu  -D warnings --out-dir x86_64-unknown-linux-gnu/stage2/lib/rustc/x86_64-unknown-linux-gnu/lib /usr/cn/rust/debug-build/rust/src/libstd/std.rs && touch x86_64-unknown-linux-gnu/stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd.so
/usr/cn/rust/debug-build/rust/src/libstd/std.rs:1:0: 1:0 note: debuginfo for trait NYI
/usr/cn/rust/debug-build/rust/src/libstd/std.rs:1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
                                                  ^
/usr/cn/rust/debug-build/rust/src/libstd/unstable/intrinsics.rs:402:8: 402:38 warning: debuginfo: Could not find namespace node for function. This is a bug! Try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
/usr/cn/rust/debug-build/rust/src/libstd/unstable/intrinsics.rs:402     pub fn get_tydesc<T>() -> *TyDesc;
                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/cn/rust/debug-build/rust/src/libstd/repr.rs:628:12: 628:13 note: debuginfo for trait NYI
/usr/cn/rust/debug-build/rust/src/libstd/repr.rs:628         let u = ReprVisitor(ptr, writer);
                                                                 ^
error: internal compiler error: node_id_to_type: no type for node `local (id=154768, name=td)`
task <unnamed> failed at 'explicit failure', /usr/cn/rust/debug-build/rust/src/libsyntax/diagnostic.rs:95
task <unnamed> failed at 'explicit failure', /usr/cn/rust/debug-build/rust/src/librustc/rustc.rs:377
me@host:/usr/cn/rust/debug-build/rust$ grep extra-debug-info Makefile
  RUSTFLAGS_STAGE2 += -Z no-debug-borrows -Z extra-debug-info
me@host:/usr/cn/rust/debug-build/rust$ grep debug-info Makefile
  RUSTFLAGS_STAGE1 += -Z no-debug-borrows -Z debug-info
  RUSTFLAGS_STAGE2 += -Z no-debug-borrows -Z extra-debug-info
me@host:/usr/cn/rust/debug-build/rust$ 
me@host:/usr/cn/rust/debug-build/rust$ gcc --version
gcc (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

me@host:/usr/cn/rust/debug-build/rust$ uname -a
Linux i7 3.8.0-30-generic #44~precise1-Ubuntu SMP Fri Aug 23 18:32:41 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
me@host:/usr/cn/rust/debug-build/rust$

@jdm
Copy link
Contributor

jdm commented Sep 14, 2013

Paging @michaelwoerister.

bors added a commit that referenced this issue Oct 8, 2013
This should fix some outstanding namespace issues. It also fixes an issue with LLVM metadata uniquing that caused an LLVM assertion when compiling libstd.

One thing to keep in mind is that the `-O` flag and the debug info flags are essentially incompatible. It may work but I would not consider this in any way supported at the moment. On the other hand, there is also good news: With the changes in this PR I am able to compile all of rust with extra-debug-info:
```
make RUSTFLAGS_STAGE2='-Zextra-debug-info' check
```
compiles the whole thing without warning and passes the whole test suite (given that `configure` is run with `--disable-optimize`). That's kind of nice `:)` Still, I'm reluctant to automatically close the related issues (#9167, #9190, #9268) without confirmation from the openers. I'll post to the individual threads once this gets merged.
@alexcrichton
Copy link
Member

This appears to have been fixed in the meantime. We have a very large number of debug info tests, so I think we're safe closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)
Projects
None yet
Development

No branches or pull requests

3 participants