Bug#913271: segfault - broken rust compiling

2018-11-13 Thread Sylvestre Ledru
forwarded 913271 https://bugs.llvm.org/show_bug.cgi?id=39427
thanks

Hello,

Le 13/11/2018 à 21:05, Josh Stone a écrit :
> There's an ABI incompatibility between LLVM compiled with GCC and Clang:
> https://bugs.llvm.org/show_bug.cgi?id=39427
>
> So if you have a Clang-built libLLVM.so, and rustc's src/rustllvm is
> built with GCC, then I think you may be hitting this problem.
>
well spoted, thanks :)

S



Bug#913271: segfault - broken rust compiling

2018-11-13 Thread Josh Stone
There's an ABI incompatibility between LLVM compiled with GCC and Clang:
https://bugs.llvm.org/show_bug.cgi?id=39427

So if you have a Clang-built libLLVM.so, and rustc's src/rustllvm is
built with GCC, then I think you may be hitting this problem.



Bug#913271: [Pkg-rust-maintainers] Bug#913271: segfault - broken rust compiling

2018-11-10 Thread Ximin Luo
Ximin Luo:
> [..]
> Thread 1 "rustc" received signal SIGSEGV, Segmentation fault.
> 0x71e273bc in llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) 
> () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
> (gdb) bt
> #0  0x71e273bc in 
> llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) () from 
> /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
> #1  0x71f654c9 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
> #2  0x71f65491 in llvm::MDString::get(llvm::LLVMContext&, 
> llvm::StringRef) () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
> #3  0x71ee69cd in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1

Hopefully the stack trace is informative even though some stuff is missing. 
They are missing because the debug symbols are missing for this version of LLVM:

$ dpkg -S /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
libllvm7:amd64: /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
$ apt-cache policy libllvm7   
libllvm7:
  Installed: 1:7.0.1~+rc2-2
  Candidate: 1:7.0.1~+rc2-2
  Version table:
 *** 1:7.0.1~+rc2-2 500
500 http://deb.debian.org/debian unstable/main amd64 Packages
100 /var/lib/dpkg/status
$ apt-cache policy libllvm7-dbgsym
libllvm7-dbgsym:
  Installed: (none)
  Candidate: 1:7-8
  Version table:
 1:7-8 500
500 http://deb.debian.org/debian-debug unstable-debug/main amd64 
Packages

Would you be able to re-enable them Sylvestre?

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git



Bug#913271: segfault - broken rust compiling

2018-11-10 Thread Ximin Luo
The segfault is triggered by the presence of debuginfo=N where N != 0. You can 
avoid it by setting RUSTFLAGS or running "cargo rustc -- -C debuginfo=0" 
instead of "cargo build".

Together with the workaround for #913414, this means a temporary workaround for 
users could be to set RUSTFLAGS="-C debuginfo=0 -C relocation-model=default" in 
their environment. This works in some cases, unfortunately it doesn't work for 
packages that have a custom build.rs and use cc in it. (Perhaps the workaround 
can be extended to cover these cases too but I couldn't figure out how.)

Here is a backtrace of the segfault, would be good if someone else more 
familiar with LLVM than me could take a look:

hello_world$ gdb -q rustc
Reading symbols from rustc...Reading symbols from 
/usr/lib/debug/.build-id/e9/0dc62b102986d644f980ffeab6adab6f53625d.debug...done.
done.
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /usr/bin/rustc.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) run src/main.rs -C debuginfo=2
Starting program: /usr/bin/rustc src/main.rs -C debuginfo=2
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee0ed700 (LWP 10750)]
[New Thread 0x7fffedeec700 (LWP 10751)]
[New Thread 0x7fffedceb700 (LWP 10752)]
[New Thread 0x7fffedae8700 (LWP 10753)]
[Thread 0x7fffedae8700 (LWP 10753) exited]
[Thread 0x7fffedceb700 (LWP 10752) exited]

Thread 1 "rustc" received signal SIGSEGV, Segmentation fault.
0x71e273bc in llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) () 
from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
(gdb) bt
#0  0x71e273bc in llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) 
() from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
#1  0x71f654c9 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
#2  0x71f65491 in llvm::MDString::get(llvm::LLVMContext&, 
llvm::StringRef) () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
#3  0x71ee69cd in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
#4  0x71ee2d12 in llvm::DIBuilder::createFile(llvm::StringRef, 
llvm::StringRef, llvm::Optional >, 
llvm::Optional) () from 
/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1
#5  0x750a01f2 in LLVMRustDIBuilderCreateFile (Builder=0x555d4180, 
Filename=0x7ffeedd8 "src/main.rs", Directory=0x55b3dd10 
"$HOME/hello_world")
at /usr/lib/llvm-7/include/llvm/ADT/StringRef.h:85
#6  0x7501d39e in 
rustc_codegen_llvm::debuginfo::metadata::compile_unit_metadata (tcx=..., 
codegen_unit_name=..., debug_context=0x7ffeeeb0) at 
librustc_codegen_llvm/debuginfo/metadata.rs:859
#7  0x74f75946 in rustc_codegen_llvm::context::CodegenCx::new (tcx=..., 
codegen_unit=..., llvm_module=) at 
librustc_codegen_llvm/context.rs:272
#8  0x74ffad3e in 
rustc_codegen_llvm::base::compile_codegen_unit::module_codegen (tcx=..., 
cgu_name=...) at librustc_codegen_llvm/base.rs:1225
#9  0x7503e642 in rustc::dep_graph::graph::DepGraph::with_task_impl 
(self=0x7fff15d8, arg=..., no_tcx=false, task=0x800e8150, key=..., 
cx=..., create_task=, 
finish_task_and_alloc_depnode=) at 
librustc/dep_graph/graph.rs:342
#10 rustc::dep_graph::graph::DepGraph::with_task (self=0x7fff15d8, key=..., 
cx=..., arg=..., task=0x74ffac40 
) at 
librustc/dep_graph/graph.rs:208
#11 0x74ff8b8f in rustc_codegen_llvm::base::compile_codegen_unit 
(tcx=..., cgu_name=...) at librustc_codegen_llvm/base.rs:1199
#12 rustc_codegen_llvm::base::codegen_crate (tcx=..., rx=...) at 
librustc_codegen_llvm/base.rs:905
#13 0x7502df70 in ::codegen_crate 
(self=, tcx=..., rx=...) at librustc_codegen_llvm/lib.rs:215
#14 0x77deb832 in rustc_driver::driver::phase_4_codegen::{{closure}} () 
at librustc_driver/driver.rs:1369
#15 rustc::util::common::time_ext (do_it=, what=..., 
sess=, f=...) at librustc/util/common.rs:163
#16 rustc::util::common::time (sess=, what=..., f=...) at 
librustc/util/common.rs:157
#17 0x77e104ae in rustc_driver::driver::phase_4_codegen 
(codegen_backend=..., tcx=..., rx=...) at librustc_driver/driver.rs:1369
#18 0x77ebd614 in rustc_driver::driver::compile_input::{{closure}} 
(tcx=..., analysis=..., rx=..., result=...) at librustc_driver/driver.rs:328
#19 0x77eb7446 in 
rustc_driver::driver::phase_3_run_analysis_passes::{{closure}} (tcx=...) at 
librustc_driver/driver.rs:1352
#20 rustc::ty::context::tls::enter_global::{{closure}}::{{closure}} () at 
librustc/ty/context.rs:1986
#21 rustc::ty::context::tls::enter_context::{{closure}} () at 
librustc/ty/context.rs:1954
#22 rustc::ty::context::tls::set_tlv (value=, f=...) at 
librustc/ty/context.rs:1893
#23 rustc::ty::context::tls::enter_context (context=, f=...) at 
librustc/ty/context.rs:1953
#24 0x77e6e1cb in rustc::ty::context::tls::enter_global::{{closure}} () 
at librustc/ty/context.rs:1985
#25 

Bug#913271: segfault - broken rust compiling

2018-11-10 Thread Sylvestre Ledru


Le 10/11/2018 à 21:12, Santiago Vila a écrit :
> On Thu, 8 Nov 2018, Sylvestre Ledru wrote:
>
>> Le 08/11/2018 à 21:30, jnq...@gmail.com a écrit :
>>> Package: llvm-7
>>> Version: 1:7.0.1~+rc2-1
>>> Severity: grave
>>>
>>> I've just updated my Sid install and found that building Rust crates
>>> with Cargo now fails with a seg fault.
>>>
>>> Initially I fired a bug report at cargo to kick things off, but I've
>>> now discovered that it relates to the llvm-7 update, as switching llvm7
>>> packages back to testing versions fixes the problem.
>> Do you have more info than "it segfaults"?
> I believe the reported problem is the same that makes all these
> recently uploaded rust packages to FTBFS:
>
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-arc-swap.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-encoding.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-encode-unicode.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-crossbeam-epoch-0.5.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-gobject-sys.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-grep-regex.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-heck.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-iso8601.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-mio-uds.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-rustc-version.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-term.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-stringprep.html
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-string-cache-codegen.html

Yeah, this is related to the move of llvm toolchain to be compiled using
clang (stage2).

Reverting llvm to the previous version works.

If someone could help debugging the segfault, this would be great :)

Thanks
S



Bug#913271: segfault - broken rust compiling

2018-11-10 Thread Sylvestre Ledru

Le 10/11/2018 à 20:04, brian m. carlson a écrit :
> On Thu, Nov 08, 2018 at 09:29:43PM +0100, Sylvestre Ledru wrote:
>> Do you have more info than "it segfaults"?
> I can provide some reproduction steps, if that's helpful.
>
> 1. Install rustc and cargo.
> 2. git clone https://github.com/rust-lang-nursery/rust-clippy.git
> 3. cd rust-clippy
> 4. git checkout v0.0.212
> 5. cargo build --verbose
> 6. Notice build failures due to SIGSEGV.

Easier:

$ cargo new hello_world --bin

$ cargo build --verbose

$ rustc --crate-name hello_world src/main.rs --color always --crate-type
bin --emit=dep-info,link -C debuginfo=2 -C metadata=923fd6da5ef0e38e -C
extra-filename=-923fd6da5ef0e38e --out-dir
/tmp/hello_world/target/debug/deps -C
incremental=/tmp/hello_world/target/debug/incremental -L
dependency=/tmp/hello_world/target/debug/deps

[1]    7942 segmentation fault  rustc --crate-name hello_world
src/main.rs --color always --crate-type bin  -

S





signature.asc
Description: OpenPGP digital signature


Bug#913271: segfault - broken rust compiling

2018-11-10 Thread Santiago Vila
On Thu, 8 Nov 2018, Sylvestre Ledru wrote:

> Le 08/11/2018 à 21:30, jnq...@gmail.com a écrit :
> > Package: llvm-7
> > Version: 1:7.0.1~+rc2-1
> > Severity: grave
> >
> > I've just updated my Sid install and found that building Rust crates
> > with Cargo now fails with a seg fault.
> >
> > Initially I fired a bug report at cargo to kick things off, but I've
> > now discovered that it relates to the llvm-7 update, as switching llvm7
> > packages back to testing versions fixes the problem.
> 
> Do you have more info than "it segfaults"?

I believe the reported problem is the same that makes all these
recently uploaded rust packages to FTBFS:

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-arc-swap.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-encoding.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-encode-unicode.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-crossbeam-epoch-0.5.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-gobject-sys.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-grep-regex.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-heck.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-iso8601.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-mio-uds.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-rustc-version.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-term.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-stringprep.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/rust-string-cache-codegen.html

Thanks.



Bug#913271: segfault - broken rust compiling

2018-11-10 Thread brian m. carlson
On Thu, Nov 08, 2018 at 09:29:43PM +0100, Sylvestre Ledru wrote:
> Do you have more info than "it segfaults"?

I can provide some reproduction steps, if that's helpful.

1. Install rustc and cargo.
2. git clone https://github.com/rust-lang-nursery/rust-clippy.git
3. cd rust-clippy
4. git checkout v0.0.212
5. cargo build --verbose
6. Notice build failures due to SIGSEGV.

Note that if instead you compile with "cargo build --verbose --release"
in step 5, you get #913414.

rustc did work as recently as November 3, since a project of mine that
exhibits the same behavior has that as its most recent commit.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204


signature.asc
Description: PGP signature


Bug#913271: segfault - broken rust compiling

2018-11-08 Thread Sylvestre Ledru


Le 08/11/2018 à 21:30, jnq...@gmail.com a écrit :
> Package: llvm-7
> Version: 1:7.0.1~+rc2-1
> Severity: grave
>
> I've just updated my Sid install and found that building Rust crates
> with Cargo now fails with a seg fault.
>
> Initially I fired a bug report at cargo to kick things off, but I've
> now discovered that it relates to the llvm-7 update, as switching llvm7
> packages back to testing versions fixes the problem.

Do you have more info than "it segfaults"?

S



Bug#913271: segfault - broken rust compiling

2018-11-08 Thread jnqnfe
Package: llvm-7
Version: 1:7.0.1~+rc2-1
Severity: grave

I've just updated my Sid install and found that building Rust crates
with Cargo now fails with a seg fault.

Initially I fired a bug report at cargo to kick things off, but I've
now discovered that it relates to the llvm-7 update, as switching llvm7
packages back to testing versions fixes the problem.