grame-cncm / faust

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

Getting executable code with llvm-dsp on win 64 ? #158

Closed jcelerier closed 6 years ago

jcelerier commented 6 years ago

I'm having some trouble with getting faust to work on windows. I am calling the following:

 createCDSPFactoryFromString( "score", "process = _;", 0, nullptr, "x86_64-pc-windows-msvc", err, -1);

The code generation seems to happen, but I get a crash when calling dsp_imp* dsp = fNew(); in llvm_dsp* llvm_dsp_factory_aux::createDSPInstance(dsp_factory* factory) : Exception thrown at 0x000000000A130040 in score.exe: 0xC0000005: Access violation executing location 0x000000000A130040..

Couldn't it mean that the memory hasn't been marked as executable in some way ? I'm using LLVM 6, and the latest MSVC - everything in 64 bit.

dfober commented 6 years ago

So far, I’ve got similar issues when using MSVC (LLVM 5.0 - x64). The good news is that it works when compiled using MSYS2. See the build/README.md for the packages you need.

Le 17 mars 2018 à 01:10, Jean-Michaël Celerier notifications@github.com a écrit :

I'm having some trouble with getting faust to work on windows. I am calling the following:

createCDSPFactoryFromString( "score", "process = _;", 0, nullptr, "x86_64-pc-windows-msvc", err, -1); The code generation seems to happen, but I get a crash when calling dsp_imp dsp = fNew(); in llvm_dsp llvm_dsp_factory_aux::createDSPInstance(dsp_factory* factory) : Exception thrown at 0x000000000A130040 in score.exe: 0xC0000005: Access violation executing location 0x000000000A130040..

Couldn't it mean that the memory hasn't been marked as executable in some way ? I'm using LLVM 6, and the latest MSVC - everything in 64 bit.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/faust/issues/158, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaTwz8pk8_slO-jmCjYCO8Yk4G160zOks5tfFSKgaJpZM4Sulgr.

jcelerier commented 6 years ago

Thanks ! Maybe a bug in LLVM codegen ?

pierreguillot commented 6 years ago

Indeed, the LLVM compilation throw an exception that is not catched. The exception gives: "Broken function found, compilation aborted!", (so you have to catch it otherwise the program will crash). Anyway, I don't know how to fix this so it doesn't help... Perhaps, the build/readme.md should inform about this problem?

sletz commented 6 years ago

The crash described by @jcelerier is different from the ""Broken function found, compilation aborted!"" issue. Does it happens with any DSP you've tested? Can you locate the precise place with the exception occurs?

pierreguillot commented 6 years ago

Alright, sorry for the confusion. I'll be back on the Windows machine next week and give you further information. Do you want me to create a new issue?

sletz commented 6 years ago

Yes, a new issue would be better. Goggling ""Broken function found, compilation aborted!"" reports LLVM code generation issue, as if the Faust LLVM backend was not generating correct IR code, before even JITing it. It would be interesting to see if the issue happens with any DSP. You can also possibly test the LLVM backend using the Faust command line, like : faust -lang llvm foo.dsp