grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.58k stars 322 forks source link

FAUST 2.37.3 with LLVM 13.0.0 crashes #684

Closed ventosus closed 2 years ago

ventosus commented 2 years ago

System

Parabola GNU/Linux-libre

LLVM version

LLVM (http://llvm.org/):
 LLVM version 13.0.0
 Optimized build.
 Default target: x86_64-pc-linux-gnu
 Host CPU: ivybridge

FAUST version

FAUST Version 2.37.3
Embedded backends: 
 DSP to C
 DSP to C++
 DSP to CSharp
 DSP to DLang
 DSP to FIR
 DSP to Interpreter
 DSP to Java
 DSP to Julia
 DSP to LLVM IR
 DSP to old C++
 DSP to Rust
 DSP to SOUL
 DSP to WebAssembly (wast/wasm)
Build with LLVM version 13.0.0

Example DSP code

import("stdfaust.lib");
process = _, _;

Command line

faust -lang llvm sample.dsp

Error message

 /usr/include/llvm/IR/Instructions.h:959: static llvm::GetElementPtrInst* llvm::GetElementPtrInst::Create(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&, llvm::Instruction*): Assertion `PointeeType && "Must specify element type"' failed.

Backtrace

#0  0x00007ffff7c01d22 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff7beb862 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff7beb747 in __assert_fail_base.cold () from /usr/lib/libc.so.6
#3  0x00007ffff7bfa616 in __assert_fail () from /usr/lib/libc.so.6
#4  0x00007ffff0c7f5b4 in ?? () from /usr/lib/libfaust.so.2
#5  0x00007ffff0c8f429 in LLVMInstVisitor::visitNameAddressAux(NamedAddress*) () from /usr/lib/libfaust.so.2
#6  0x00007ffff0c8fbdc in LLVMInstVisitor::visit(StoreVarInst*) () from /usr/lib/libfaust.so.2
#7  0x00007ffff0c85c2e in LLVMInstVisitor::visit(BlockInst*) () from /usr/lib/libfaust.so.2
#8  0x00007ffff0c85c2e in LLVMInstVisitor::visit(BlockInst*) () from /usr/lib/libfaust.so.2
#9  0x00007ffff0c8c535 in LLVMInstVisitor::visit(DeclareFunInst*) () from /usr/lib/libfaust.so.2
#10 0x00007ffff0c8462b in LLVMCodeContainer::produceFactory() () from /usr/lib/libfaust.so.2
#11 0x00007ffff0a43c04 in generateCode(CTree*, int, int, bool) () from /usr/lib/libfaust.so.2
#12 0x00007ffff0a46f70 in ?? () from /usr/lib/libfaust.so.2
#13 0x00007ffff0a487ed in createFactory(char const*, char const*, int, char const**, std::__cxx11::basic_string<char,    std::char_traits<char>, std::allocator<char> >&, bool) () from /usr/lib/libfaust.so.2
#14 0x00007ffff0ca06a4 in createDSPFactoryFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std :::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, char const**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int) () from /usr/lib/libfaust.so.2
#15 0x00007ffff0ca1656 in createCDSPFactoryFromString () from /usr/lib/libfaust.so.2
sletz commented 2 years ago

Its's a known problem: so 1) either use LLVM 12 or previous 2) use latest GitHub master-dev version.