Skip to content
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

llvm-goc: /home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/gofrontend/go/names.cc:595: std::string Type::mangled_name(Gogo *) const: assertion 'c < '0' || c > '9'' failed. #21

Open
advancedwebdeveloper opened this issue Oct 8, 2020 · 2 comments

Comments

@advancedwebdeveloper
Copy link

Hi.
I wasn't able to build your project, if using gollvm compiler.

~/golang_projects/duit$ go build -i -v -x
WORK=/tmp/go-build288395935

get https://proxy.golang.org/github.com/mjl-/go/@v/v0.0.0-20180429123528-fafada5f286e.info

get https://proxy.golang.org/github.com/mjl-/go/@v/v0.0.0-20180429123528-fafada5f286e.info: 200 OK (0.832s)

9fans.net/go/draw/drawfcall
mkdir -p $WORK/b003/
cd $WORK
/home/oceanfish81/gollvm_dist/bin/llvm-goc -fgo-importcfg=/dev/null -c -x c - -o /dev/null || true
cd /home/oceanfish81/go/pkg/mod/github.com/mjl-/[email protected]/draw/drawfcall
/home/oceanfish81/gollvm_dist/bin/llvm-goc -c -O2 -g -m64 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -fgo-pkgpath=9fans.net/go/draw/drawfcall -o $WORK/b003/go.o -I $WORK/b003/importcfgroot ./bit.go ./msg.go ./mux.go

9fans.net/go/draw/drawfcall

llvm-goc: /home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/gofrontend/go/names.cc:595: std::string Type::mangled_name(Gogo ) const: assertion 'c < '0' || c > '9'' failed.
#0 0x0000000000d765f3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0xd765f3)
#1 0x0000000000d7468c llvm::sys::RunSignalHandlers() (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0xd7468c)
#2 0x0000000000d76a85 SignalHandler(int) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0xd76a85)
#3 0x00007f73143713c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x00007f7313ea218b raise /build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f7313e81859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
#6 0x000000000051b662 (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x51b662)
#7 0x00000000004b1397 Type::mangled_name(Gogo
) const (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4b1397)
#8 0x00000000004b3ec8 Gogo::type_descriptor_name(Type const*, Named_type*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4b3ec8)
#9 0x0000000000548101 Sort_types::operator()(Type const*, Type const*) const (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x548101)
#10 0x0000000000547fa9 void std::__1::__sort<Sort_types&, Type const**>(Type const**, Type const**, Sort_types&) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x547fa9)
#11 0x0000000000542a1a Export::assign_type_indices(std::__1::vector<Named_object*, std::__1::allocator<Named_object*> > const&) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x542a1a)
#12 0x0000000000542261 Export::export_globals(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, Package*, std::__1::less<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, Package*> > > const&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, Package*, std::__1::less<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, Package*> > > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, Import_init_set const&, Bindings const*, std::__1::unordered_set<Named_object*, std::__1::hash<Named_object*>, std::__1::equal_to<Named_object*>, std::__1::allocator<Named_object*> >) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x542261)
#13 0x000000000049253d Gogo::do_exports() (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x49253d)
#14 0x0000000000479b28 go_parse_input_files(char const**, unsigned int, bool, bool) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x479b28)
#15 0x000000000046e933 gollvm::driver::CompileGoImpl::invokeFrontEnd() (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x46e933)
#16 0x000000000047118b gollvm::driver::CompileGo::performAction(gollvm::driver::Compilation&, gollvm::driver::Action const&, llvm::SmallVector<gollvm::driver::Artifact
, 3u> const&, gollvm::driver::Artifact const&) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x47118b)
#17 0x0000000000467b12 gollvm::driver::Driver::processAction(gollvm::driver::Action*, gollvm::driver::Compilation&, bool) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x467b12)
#18 0x0000000000467c22 gollvm::driver::Driver::processActions(gollvm::driver::Compilation&) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x467c22)
#19 0x0000000000460f07 main (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x460f07)
#20 0x00007f7313e830b3 __libc_start_main /build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#21 0x000000000045fb2e _start (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x45fb2e)
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/oceanfish81/gollvm_dist/bin/llvm-goc -c -O2 -g -m64 -fdebug-prefix-map=/tmp/go-build288395935=/tmp/go-build -gno-record-gcc-switches -fgo-pkgpath=9fans.net/go/draw/drawfcall -o $WORK/b003/go.o -I $WORK/b003/importcfgroot ../../go/pkg/mod/github.com/mjl-/[email protected]/draw/drawfcall/bit.go ../../go/pkg/mod/github.com/mjl-/[email protected]/draw/drawfcall/msg.go ../../go/pkg/mod/github.com/mjl-/[email protected]/draw/drawfcall/mux.go

Reported that already.
llvm-goc could be installed by

$sudo cp -R * /usr/

after extracting this build.

CC @thanm @cherrymui

@mjl-
Copy link
Owner

mjl- commented Dec 14, 2020

Nice find. I see the issue has been closed at gollvm. Have you been able to build duit with gollvm with the latest version?

@advancedwebdeveloper
Copy link
Author

I didn't re-check - but you can re-use existing scenarios
https://github.com/advancedwebdeveloper/clang_test_cpu_features/actions/runs/405495534
https://github.com/advancedwebdeveloper/clang_test_cpu_features/blob/main/.github/workflows/llvm.yml
to get recently compiled gollvm to build your project.
The above workflows doesn't contain the steps for https://go.googlesource.com/gollvm/#installing - but you can do that yourself.

Hence that nobody limits the project to Github Actions. Especially cause Microsoft doesn't have any VM instances, featuring AMD's CPUs, for this (I tracked two different CPU models, from Intel).
If you can build/test your project on AMD's hardware - you are welcome to report.
Consider using AMD Optimizing C/C++ Compiler instead of "vanilla" LLVM/Clang.
You would have to request enabling specific optimizations, for llvm-goc and various linkers (lld, gold) if you want something more concrete - that would be the cause of a new patch.

@thanm, please explain @mjl how to generate LLVM's build artifacts (include intermediate representation) and how to arrange some in-memory benchmarking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants