agraef / pure-lang

Pure programming language
https://agraef.github.io/pure-lang/
315 stars 20 forks source link

Faust bitcode interface broken #12

Closed agraef closed 6 years ago

agraef commented 6 years ago

Symptom:

$ cd pure/examples/bitcode/
$ pure faust_examp.pure 
Segmentation fault (core dumped)

Segfault happens at line 52 in faust_examp.pure when calling the info method:

using faustui;
let k,l,ui = test::info dsp;

Looks like recent breakage in the Faust LLVM bitcode ABI, or maybe some change in the global meta data.

agraef commented 6 years ago

This only affects Faust inline code, importing Faust bitcode modules created with faust -lang llvm (e.g., freeverb.pure example) or clang -emit-llvm via pure.c (e.g., pd-faust) works without any hitches.

agraef commented 6 years ago

Actually it affects both inline code and bitcode modules in the same way, but only if the dsp has meta data on a control variable. E.g., faust_examp.pure works fine if the [midi:ctrl 0x01] meta data on the gain control is removed.

agraef commented 6 years ago

Root cause is upstream ABI breakage in the UI struct (new callback inserted before the declare() callback, which also explains why meta data tripped the segfault), cf. addSoundfile() in faust/gui/UI.h. Solution is to provide a dummy implementation of that callback for now, but we'll have to figure out how to properly implement it later.