grame-cncm / faust

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

Crash when accessing JITted DspInstance #201

Open christoph-hart opened 6 years ago

christoph-hart commented 6 years ago

I've managed to build the static library on Windows and exploring the API. Unfortunately I didn't get too far.

This example creates a JIT factory and an instance, but crashes at the last line with a 0x0000000 access in the function - every call to a instance function results in the same crash, but sometimes the adress is 0xFEFEFEFEFE, so there's definitely something dangling.

std::string message;
auto f = createDSPFactoryFromString("test", "process=_;", 0, nullptr, "x86_64-pc-windows-msvc", message, 0);
auto c = f->getDSPCode();
auto ds = f->getTarget();

auto instance = f->createDSPInstance();

if (instance != nullptr)
    auto n = instance->getNumInputs();  

Could this be related to the other Windows issues (eg #180)?

sletz commented 6 years ago

1) try to not setup the "x86_64-pc-windows-msvc", and just use an empty string. Is this case the machine current configuration is going to be used. 2) are you compiling libfaust + LLVM with Microsoft compilers ?

christoph-hart commented 6 years ago

I tried the empty string target without improvements.

I have built everything using VS2017 with x64 and MTd.

System is Windows 7.

Am 18.07.2018 um 23:50 schrieb Stéphane Letz notifications@github.com:

try to not setup the "x86_64-pc-windows-msvc", and just use an empty string. Is this case the machine current configuration is going to be used. are you compiling libfaust + LLVM with Microsoft compilers ? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

sletz commented 6 years ago

I'm not sure anymore if anybody ever succeeded in compiling and running successfully libfaust + LLVM compiled with VS (but we know that using MinGW works). @pierreguillot probably knows better and can possibly help.

christoph-hart commented 6 years ago

Yes that would be nice to know indeed. If it doesn‘t work with VS, then I ditch Windows support, the JIT part is for development only anyways.

pierreguillot commented 6 years ago

I use FAUST with the LLVM JIT compiler on Windows x64 in the standalone application Kiwi and also in a dynamic library for Pure Data. For both, LLVM and FAUST are linked statically and I use VS2015 (but I don't think that the VS version is a problem). Perhaps you can try to compile one or both of these projects and see if they work.

Do you think this could be related to this post on the dev list ?

And can you give a simple example with all the compilation instructions (and projects) that you use (for LLVM, libFAUST and the project), this way we could try ourself and try to figure out what is wrong?