This commit is contained in:
Robin E.R. Davies
2026-05-06 14:37:17 -04:00
parent d217af035d
commit 44db94a955
3 changed files with 28 additions and 9 deletions
+25 -8
View File
@@ -83,7 +83,7 @@ static bool isJackServiceRunning()
return std::filesystem::exists(path);
}
#if 0 && ENABLE_BACKTRACE
#if 0 && ENABLE_BACKTRACE
// void segvHandler(int sig)
// {
// void *array[10];
@@ -107,12 +107,15 @@ static bool isJackServiceRunning()
#endif
#define ENABLE_SEGV_DEBUG 0
#define ENABLE_SIGXCPU_DEBUG 1
#if ENABLE_SEGV_DEBUG
void debug_segvHandler(int sig)
{
// Print out all the frames to stderr
const char *message = "Error: SEGV signal received.\n";
auto _ = write(STDERR_FILENO, message, strlen(message));
flush(STD_ERR_FILENO);
_exit(EXIT_FAILURE);
}
@@ -126,6 +129,17 @@ static void EnableDebugSevHandler()
#endif
#if ENABLE_SIGXCPU_DEBUG
void debug_XSigXcpuHandler(int sig)
{
}
static void EnableSigXcpuHandler()
{
signal(SIGXCPU, debug_XSigXcpuHandler);
}
#endif
static bool TryGetLogLevel(const std::string &strLogLevel, LogLevel *result)
{
@@ -153,7 +167,6 @@ static bool TryGetLogLevel(const std::string &strLogLevel, LogLevel *result)
return false;
}
int main(int argc, char *argv[])
{
@@ -277,11 +290,13 @@ int main(int argc, char *argv[])
const std::filesystem::path webTempDirectory = "/var/pipedal/web_temp";
if (!webTempDirectory.empty())
{
try {
try
{
std::filesystem::remove_all(webTempDirectory); //// user must belong to the pipedald grop when debugging.
std::filesystem::create_directories(webTempDirectory);
}
catch (const std::exception e) {
catch (const std::exception e)
{
Lv2Log::warning(e.what());
}
}
@@ -317,7 +332,6 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS; // indiate to systemd that we don't want a restart.
}
try
{
{
@@ -340,7 +354,7 @@ int main(int argc, char *argv[])
sigset_t sigSet;
int s;
sigemptyset(&sigSet);
sigaddset(&sigSet, SIGINT);
sigaddset(&sigSet, SIGTERM);
sigaddset(&sigSet, SIGUSR1);
@@ -354,16 +368,19 @@ int main(int argc, char *argv[])
// Clear any pending signals before waiting
struct timespec timeout = {0, 0};
while (sigtimedwait(&sigSet, NULL, &timeout) > 0) {
while (sigtimedwait(&sigSet, NULL, &timeout) > 0)
{
// Consume any pending signals
}
#if ENABLE_SEGV_DEBUG
EnableDebugSevHandler();
#endif
#if ENABLE_SIGXCPU_DEBUG
EnableSigXcpuHandler();
#endif
PiPedalModel model;
model.SetNetworkChangedListener(
[&server]() mutable
{
+1 -1
View File
@@ -202,7 +202,7 @@ void profilePlugin(const ProfileOptions &profileOptions)
reader.read(&bankFile);
if (bankFile.presets().size() != 1)
{
throw new std::runtime_error(SS("Invalid preset file. Expection one preset, but " << bankFile.presets().size() << " presets were found."));
throw new std::runtime_error(SS("Invalid preset file. Expecting one preset, but " << bankFile.presets().size() << " presets were found."));
}
Pedalboard pedalboard = (bankFile.presets()[0]->preset());
model.SetPedalboard(-1, pedalboard);