Topic: Build/launch error 575

I'm not sure this is a new topic, but I'm having sporadic problems with build or launch of my exe. First, my first attempt to run my exe  after launch of SF gives me this error message, "Error launching", but it seems to build. If I launch my exe right after without a recompilation (no changes to any source file), it runs successfully. If I then make any change(s) to my source and then try to launch, I get the error message, "Process failed to start with error code 575. Contact support@approximatrix.com". I also get the error message, "cannot open output file target.exe: Permission denied". Mcaffee has worked with me unsuccessfully to exclude target.exe from virus scanning.

Re: Build/launch error 575

Error 575 means:

ERROR_APP_INIT_FAILURE

    575 (0x23F)

    {Application Error} The application was unable to start correctly (0x%lx). Click OK to close the application.

The application is not initializing.  This error is usually caused by the virus scanner, though not necessarily.  Can you start your program, which is target.exe by default, from Windows Explorer every time?

The Mcaffee virus scanning product, especially the consumer version, seems exceptionally hostile towards executables produced by compilers on your local machine.  I assume you can "turn off" Mcaffee on your machine temporarily.  If you simply disable the virus scanner for a short time, does everything work as expected?

I personally just use Microsoft's virus protection that comes free with Windows.  I don't have any insight into why Mcaffee wouldn't work.

Jeff Armstrong
Approximatrix, LLC

3 (edited by tun_day 2021-05-21 22:52:02)

Re: Build/launch error 575

Hi Jeff,
I don't think it's a virus scan problem for the following reasons.
   1. Both build and launch problems occur when target.exe is "whitelisted".
   2. Both build and launch problems occur when the virus scan firewall is turned off.
   3. I have been using SF for a couple of years and the problem just started coming up only lately. I haven't changed my virus        scanner, McAfee.
   4. Neither the error during build or upon launch happens every time. See below for success and fail patterns.

Patterns
   1. Build always succeeds if it's the first thing I do upon launching SF. That is before any source file editing.
   2. Build always fails otherwise. Hence my strategy is to complete any needed source file editing, close SF, re-open SF, and         then run the build only. Always works.
   3. Target.exe always runs successfully if copied or moved out of the IDE and launched like from, say, the desktop. Or run       from a desktop shortcut to it.
   4. Target.exe seems to always run successfully after a clear of the console. I'm not really sure of the always part, but a       high percentage of the time.
   5. Target.exe eventually runs in SF after several fails.

Re: Build/launch error 575

This error code can also be caused by DLLs missing from the path.  You can also make sure you're using static linking in Project Options to avoid this.

However, I should explain that Simply Fortran is using the Windows API call "CreateProcess" to launch your executable.  It attempts to do so in the specified working directory, and will do so in the project directory if the working directory is blank.  When CreateProcess returns false, the error code is reported to users, nothing more.  Simply Fortran isn't taking any other steps.  You might need to whilelist the Simply Fortran IDE as well in your virus scanner to allow it to arbitrarily access CreateProcess.

I'll continue to look, but I can't replicate this behavior on our Windows test systems.  Another user has reported similar issues when using Windows Defender as opposed to McAfee.  The McAfee virus product, though, has always been a problem for Simply Fortran users.

Jeff Armstrong
Approximatrix, LLC

Re: Build/launch error 575

Thanks Jeff,
Based on your comments, I believe the virus scanner is the problem. I will bug Mcafee again to look into the problem. In the meantime, what's the name of the SF IDE to whitelist?

Re: Build/launch error 575

The IDE executable is fwin.exe.

Jeff Armstrong
Approximatrix, LLC

Re: Build/launch error 575

I mentioned another user was having this issue with Windows Defender, and he provided the project and source code to help with the bug.  The surprising source of the issue seems to be a safety timeout we've implemented to ensure the application actually starts via CreateProcess.  Simply Fortran has a safety measure to make sure the process is actually created, not necessarily doing anything, within 3 seconds.  It appears that, under the right circumstances, this amount of time is insufficient.  I believe it is a combination of processor power, disk speed, and the virus scanner itself.  Regardless, either disabling the timeout or lengthening it by an order of magnitude seems to resolve the issue. 

Right now I'm adding some features to Simply Fortran to fix the problem.  The way Simply Fortran launches a process (by assuming creating a process is fast), seems extremely problematic in some cases.  I'll provide a pre-release build when the issue is resolved.

Jeff Armstrong
Approximatrix, LLC