Windows service crashes during inference
Windows service crashes during inference. Similar user-space code executes without crashing but returns an empty string. Running in a Parallels Desktop virtual machine on MacBook Pro 2018.
std::string model = "C:\\ProgramData\\Transcription\\ggml-model-whisper-tiny.bin";
struct whisper_context_params cparams = whisper_context_default_params();
struct whisper_context * ctx = whisper_init_from_file_with_params(model.c_str(), cparams);
if (ctx == nullptr) {
WriteToLog("Failed to initialize whisper context");
sleep(5);
continue;
}
std::string filename = row[0];
// audio arrays
std::vector<float> pcmf32; // mono-channel F32 PCM
std::vector<std::vector<float>> pcmf32s; // stereo-channel F32 PCM
if (!read_wav(filename, pcmf32, pcmf32s, false))
{
WriteToLog("Failed to read WAV file", filename.c_str());
continue;
}
// run the inference
{
whisper_full_params wparams = whisper_full_default_params(WHISPER_SAMPLING_GREEDY);
WriteToLog("Processing audio");
if (whisper_full(ctx, wparams, pcmf32.data(), pcmf32.size()) != 0) {
WriteToLog("Failed to process audio");
continue;
}
}
Exception thrown at 0x00007FFACDC7543C (KernelBase.dll) in transcription.exe: 0x20474343 (parameters: 0x0000000A00993D30). Exception thrown at 0x00007FFACDC7543C (KernelBase.dll) in transcription.exe: 0x21474343 (parameters: 0x0000000A00993D30, 0x000000000061A7F0, 0x000000053119F5A0, 0x0000000000000000).
Call stack: msys-gcc_s-seh-1.dll!00000005e8174721() Unknown msys-stdc++-6.dll!000000052696eaa9() Unknown msys-stdc++-6.dll!000000052697025c() Unknown msys-stdc++-6.dll!0000000526928db4() Unknown msys-whisper-1.dll!000000053119f228() Unknown msys-whisper-1.dll!000000053119f682() Unknown msys-whisper-1.dll!00000005311ad7ab() Unknown msys-whisper-1.dll!00000005311b24d8() Unknown transcription.exe!0000000100401739() Unknown sechost.dll!00007ffad01dcb42() Unknown msys-2.0.dll!0000000180045f63() Unknown msys-2.0.dll!0000000180046014() Unknown kernel32.dll!00007ffacee2257d() Unknown ntdll.dll!00007ffad02eaa48() Unknown
Whisper causes that in some gcc helper library.
Updating libwhisper.dll did not help.
Microsoft Visual Studio compiled Windows service works.