mtytel / vital

Spectral warping wavetable synth
GNU General Public License v3.0
1.58k stars 151 forks source link

segfault in `juce::AudioFormatWriter::writeFromFloatArrays` when using `--render` on macOS #45

Open 0xdevalias opened 1 year ago

0xdevalias commented 1 year ago

While trying to use the --render command of the Vital CLI on macOS, I got a segfault.

Source: https://www.reddit.com/r/VitalSynth/comments/16hrx39/comment/k86801j/?utm_source=share&utm_medium=web2x&context=3

⇒ cd ~/Desktop

⇒ /Applications/Vital.app/Contents/MacOS/Vital --render "/Users/devalias/Music/Vital/Factory/Presets/Plucked String.vital" --midi 48 --length
3 --bpm 120 --images
Thread 0 Crashed:: JUCE Message Thread Dispatch queue: com.apple.main-thread
0   Vital                                  0x105b4a238 juce::AudioFormatWriter::writeFromFloatArrays(float const* const*, int, int) + 40
1   Vital                                  0x105efb2ac SynthBase::renderAudioToFile(juce::File const&, float, float, std::__1::vector<int, std::__1::allocator<int>>, bool) + 3132
2   Vital                                  0x105ce39be processCommandLine(juce::String const&) + 6334
3   Vital                                  0x105e59ffa StandaloneSynth::initialise(juce::String const&) + 570
4   Vital                                  0x105b8c7e2 juce::JUCEApplicationBase::initialiseApp() + 1042
5   Vital                                  0x105cbed5b juce::JUCEApplication::initialiseApp() + 11
6   Vital                                  0x105b4a578 main + 216
7   dyld                                0x7ff806ac241f start + 1903

crashreport.txt

ChatGPT's advice based on the crash report:

The crash report indicates that the application Vital crashed due to a segmentation fault (SIGSEGV), which is a type of crash where a program attempts to access a restricted area of memory.

Here are the key points from the crash report:

- **Process**: Vital (audio.vital.synth)
- **Version**: 1.5.5
- **Crashed Thread**: 0 JUCE Message Thread (main thread)
- **Exception Type**: EXC_BAD_ACCESS (SIGSEGV)
- **Exception Codes**: KERN_INVALID_ADDRESS at 0x0000000000000018

The crash occurred in thread 0, which is the main thread of the application. The function call stack indicates that the crash happened during a call to `juce::AudioFormatWriter::writeFromFloatArrays`, which is a function from the JUCE framework used to write audio data. It appears that the application attempted to access memory at address `0x18`, which was not a valid address, leading to the segmentation fault.

..snip..
0xdevalias commented 1 year ago

It seems this segfault (or something similar to it) has existed since at least March 2021: