Process::isForegroundProcess() hits assertion in File

Calling Process::isForegroundProcess() on Mac OS X results in:

JUCE Assertion failure in juce_File.cpp:174

The problem is that it tries to parse juce_argv[0] as an absolute path, but this can be a relative path when you start an executable from the terminal.

Backtrace:

  * frame #0: 0x0000000100099e25 octane`juce::File::parseAbsolutePath(p=0x00007fff5fbfdf38) + 1317 at juce_File.cpp:174
    frame #1: 0x00000001000998ed octane`juce::File::File(this=0x00007fff5fbfe038, fullPathName=0x00007fff5fbfdf38) + 29 at juce_File.cpp:30
    frame #2: 0x00000001000997dd octane`juce::File::File(this=0x00007fff5fbfe038, fullPathName=0x00007fff5fbfdf38) + 29 at juce_File.cpp:32
    frame #3: 0x000000010009a9a0 octane`juce::File::getSpecialLocation(type=invokedExecutableFile) + 1152 at juce_mac_Files.mm:221
    frame #4: 0x00000001000b6f46 octane`juce::SystemStats::isRunningInAppExtensionSandbox() + 22 at juce_SystemStats.cpp:195
    frame #5: 0x00000001000d924d octane`juce::Process::isForegroundProcess() + 13 at juce_mac_Threads.mm:41


Roeland

Good catch, thanks! Will sort that out today…