[Bug 250783] ld segmentation fault

2020-11-15 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

Dimitry Andric  changed:

   What|Removed |Added

 Status|In Progress |Closed
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-15 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #12 from commit-h...@freebsd.org ---
A commit references this bug:

Author: dim
Date: Sun Nov 15 11:28:03 UTC 2020
New revision: 367704
URL: https://svnweb.freebsd.org/changeset/base/367704

Log:
  MFC r367623:

  Merge commit 8df4e6094 from llvm git (by Fangrui Song):

[ELF] Don't consider SHF_ALLOC ".debug*" sections debug sections

Fixes PR48071

* The Rust compiler produces SHF_ALLOC `.debug_gdb_scripts` (which
  normally does not have the flag)
* `.debug_gdb_scripts` sections are removed from `inputSections` due
  to --strip-debug/--strip-all
* When processing --gc-sections, pieces of a SHF_MERGE section can be
  marked live separately

`=>` segfault when marking liveness of a `.debug_gdb_scripts` which
is not split into pieces (because it is not in `inputSections`)

This patch circumvents the problem by not treating SHF_ALLOC
".debug*" as debug sections (to prevent --strip-debug's stripping)
(which is still useful on its own).

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D91291

  This should fix lld segfaulting when linking the rust-based parts of the
  devel/py-maturin port.

  Reported by:  Nick Venenga 
  PR:   250783

Changes:
_U  stable/11/
  stable/11/contrib/llvm-project/lld/ELF/InputSection.h
_U  stable/12/
  stable/12/contrib/llvm-project/lld/ELF/InputSection.h

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

Dimitry Andric  changed:

   What|Removed |Added

 Status|Open|In Progress
  Flags||mfc-stable12+,
   ||mfc-stable11+

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #11 from commit-h...@freebsd.org ---
A commit references this bug:

Author: dim
Date: Thu Nov 12 19:25:31 UTC 2020
New revision: 367623
URL: https://svnweb.freebsd.org/changeset/base/367623

Log:
  Merge commit 8df4e6094 from llvm git (by Fangrui Song):

[ELF] Don't consider SHF_ALLOC ".debug*" sections debug sections

Fixes PR48071

* The Rust compiler produces SHF_ALLOC `.debug_gdb_scripts` (which
  normally does not have the flag)
* `.debug_gdb_scripts` sections are removed from `inputSections` due
  to --strip-debug/--strip-all
* When processing --gc-sections, pieces of a SHF_MERGE section can be
  marked live separately

`=>` segfault when marking liveness of a `.debug_gdb_scripts` which
is not split into pieces (because it is not in `inputSections`)

This patch circumvents the problem by not treating SHF_ALLOC
".debug*" as debug sections (to prevent --strip-debug's stripping)
(which is still useful on its own).

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D91291

  This should fix lld segfaulting when linking the rust-based parts of the
  devel/py-maturin port.

  Reported by:  Nick Venenga 
  PR:   250783
  MFC after:3 days

Changes:
  head/contrib/llvm-project/lld/ELF/InputSection.h

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-04 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #10 from Dimitry Andric  ---
(In reply to commit-hook from comment #9)
Oops, wrong PR number. That commit was supposed to be for bug 242053!

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-04 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #9 from commit-h...@freebsd.org ---
A commit references this bug:

Author: dim
Date: Wed Nov  4 14:21:44 UTC 2020
New revision: 554081
URL: https://svnweb.freebsd.org/changeset/ports/554081

Log:
  devel/binutils: Apply upstream patch to fix "undefined symbol:
  bswap_identity_64" and similar errors, when building devel/binutils in
  certain environments.

  This has been sitting in a bug for almost a year now without any action,
  which is why I am committing it now.

  MFH:  2020Q4
  PR:   250783

Changes:
  head/devel/binutils/Makefile
  head/devel/binutils/files/patch-libctf_swap.h

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-04 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

Dimitry Andric  changed:

   What|Removed |Added

   See Also||https://bugs.llvm.org/show_
   ||bug.cgi?id=48071
 Status|New |Open

--- Comment #8 from Dimitry Andric  ---
(In reply to Nick Venenga from comment #7)
Reported upstream as https://bugs.llvm.org/show_bug.cgi?id=48071, as this also
occurs with the latest llvm 12.0.0 builds as of today.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-03 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #7 from Nick Venenga  ---
The file was 70mb so I uploaded it to my website here
https://files.nickv.me/bug250783.tar.xz

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-02 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #6 from Dimitry Andric  ---
Ok, to have something to submit to upstream, we need a reproduction case, and
lld has an option for this, which produces a tarball:

  --reproduce= Write a tar file containing input files and command
line options to reproduce link

So can you repeat the link operation you did on your FreeBSD 13.0 VM with lld
11.0.0, and add an additional flag to the "linking with cc" line, e.g.:

  -Wl,--reproduce=bug250783.tar

If you re-run the link, it should produce a bug250783.tar file with everything
in it to be able reproduce the failure. Please compress this with xz and attach
it here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-01 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #5 from Nick Venenga  ---
I tried the FreeBSD 13.0 VM

# cargo rustc --bin maturin --manifest-path Cargo.toml \-- -C link-arg=-s
   Compiling maturin v0.8.3 (/root/maturin)   
error: linking with `cc` failed: exit code: 254
  |  
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64"
"-Wl,--eh-frame-hdr" "-L" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib"
"/root/maturin/target/debug/deps/maturin-fe53e6c49e774afc.1agzv0ps7sudcbsb.rcgu.o"
"/root/maturin/target/debug/deps/maturin-fe53e6c49e774afc.1cu2a2eew775gbht.rcgu.o"
"/root/matur"
  = note: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and
include the crash backtrace.
  Stack dump:   
  0.Program arguments: /usr/bin/ld -pie --eh-frame-hdr
-dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o
/root/maturin/target/debug/deps/maturin-fe53e6c49e774afc /usr/lib/Scrt1.o
/usr/lib/crti.o /usr/lib/crtbeginS.o
-L/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib -L/root/ma 
  #0 0x01d1f23e PrintStackTrace
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:13
  #1 0x01d1d5a5 RunSignalHandlers
/usr/src/contrib/llvm-project/llvm/lib/Support/Signals.cpp:69:18
  #2 0x01d1f930 SignalHandler
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
  #3 0x000803561b90 handle_signal
/usr/src/lib/libthr/thread/thr_sig.c:0:3
  cc: error: unable to execute command: Segmentation fault (core
dumped)
  cc: error: linker command failed due to signal (use -v to see
invocation)


error: aborting due to previous error

error: could not compile `maturin`.


Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0151245d in enqueue ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:194
194 /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp: No such file or
directory.
[Current thread is 1 (LWP 100106)]
(gdb) bt
#0  0x0151245d in enqueue ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:194
#1 
resolveReloc, true> const> ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:108
#2  0x01511eb0 in mark ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:279
#3  0x0150d6fc in run ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:242
#4  markLive > ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:379
#5  0x0147dcf8 in link > () at /usr/src/contrib/llvm-project/lld/ELF/Driver.cpp:2114
#6  0x014715bc in main ()
at /usr/src/contrib/llvm-project/lld/ELF/Driver.cpp:545
#7  0x0146fa7d in link ()
at /usr/src/contrib/llvm-project/lld/ELF/Driver.cpp:114
#8  0x0161aa45 in main ()
at /usr/src/contrib/llvm-project/lld/tools/lld/lld.cpp:146
(gdb) quit
root@freebsd:~/maturin # uname -a
FreeBSD freebsd 13.0-CURRENT FreeBSD 13.0-CURRENT #0 b9403d7aae8-c254071(main):
Thu Oct 29 08:06:03 UTC 2020
r...@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
root@freebsd:~/maturin # ld --version
LLD 11.0.0 (FreeBSD llvmorg-11.0.0-0-g176249bd673-137) (compatible with GNU
linkers)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-01 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #4 from Nick Venenga  ---
(gdb) bt
#0  0x0125e9b2 in enqueue ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:194
#1 
resolveReloc, true> const> ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:108
#2  0x0125e560 in mark ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:279
#3  0x01259e3c in run ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:242
#4  markLive > ()
at /usr/src/contrib/llvm-project/lld/ELF/MarkLive.cpp:378
#5  0x011d56c4 in link > () at /usr/src/contrib/llvm-project/lld/ELF/Driver.cpp:1970
#6  0x011caa47 in main ()
at /usr/src/contrib/llvm-project/lld/ELF/Driver.cpp:514
#7  0x011c9055 in link ()
at /usr/src/contrib/llvm-project/lld/ELF/Driver.cpp:111
#8  0x01364145 in main ()
at /usr/src/contrib/llvm-project/lld/tools/lld/lld.cpp:151

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-01 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

--- Comment #3 from Nick Venenga  ---
error: linking with `cc` failed: exit code: 254
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64"
"-Wl,--eh-frame-hdr" "-L" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib"
"/root/maturin/target/debug/deps/maturin-fe53e6c49e774afc.1agzv0ps7sudcbsb.rcgu.o"
"/root/maturin/target/debug/deps/maturin-fe53e6c49e774afc.1cu2a2eew775gbht.rcgu.o"
"/root/matur"
  = note: Stack dump:
  0.Program arguments: /usr/bin/ld -pie --eh-frame-hdr
-dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o
/root/maturin/target/debug/deps/maturin-fe53e6c49e774afc /usr/lib/Scrt1.o
/usr/lib/crti.o /usr/lib/crtbeginS.o
-L/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib -L/root/ma 
  #0 0x01b362ae PrintStackTrace
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:13
  #1 0x01b34525 RunSignalHandlers
/usr/src/contrib/llvm-project/llvm/lib/Support/Signals.cpp:69:18
  #2 0x01b36e40 SignalHandler
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
  #3 0x02b9eb70 handle_signal
/usr/src/lib/libthr/thread/thr_sig.c:0:3
  cc: error: unable to execute command: Segmentation fault (core
dumped)
  cc: error: linker command failed due to signal (use -v to see
invocation)


error: aborting due to previous error

error: could not compile `maturin`.

To learn more, run the command again with --verbose.
root@freebsd:~/maturin # ld --version
LLD 10.0.1 (FreeBSD llvmorg-10.0.1-0-gef32c611aa2-1200012) (compatible with GNU
linkers)
root@freebsd:~/maturin # uname -a
FreeBSD freebsd 12.2-STABLE FreeBSD 12.2-STABLE r367116 GENERIC  amd64

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-01 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

Dimitry Andric  changed:

   What|Removed |Added

 CC||d...@freebsd.org

--- Comment #2 from Dimitry Andric  ---
If this happens on 12.1, can you try the same on a more recent 12.2-RELEASE or
snapshot image, or even on 13-CURRENT? 12.1 has lld 8.0.1 which is rather old
now. Alternatively, you can install the llvm 10 or llvm 11 packages, and try to
use the lld from those.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 250783] ld segmentation fault

2020-11-01 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250783

Mark Linimon  changed:

   What|Removed |Added

   Assignee|b...@freebsd.org|toolch...@freebsd.org

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"