Page 1 of 2

Exception not caught when project is on network drive

Posted: Fri May 01, 2020 1:34 pm
by A. Balslev
Mad except ver. 5.0.0
Delphi Rio
I develop in Delphi 10.3.3 running on a virtual machine (VMware)
I save project files on a shared drive on host
I enable MadExcept on the project.
By executing "raise Exception.Create('Error Message');" I expected madExcept to catch this, but it doesn't

By saving the åroject on a local drive on my VM it works.

Any suggestions?
br.

Anders Balslev

Re: Exception not caught when project is on network drive

Posted: Mon May 04, 2020 2:06 pm
by madshi
Is it the linking itself which seems to not work correctly? Or is it just the path where the files are executed? E.g. if you link in the same way you did when it failed to work, and if then copy the "failed" EXE over to the local drive, does it work then?

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 9:34 am
by A. Balslev
Consider a Delphi project is located on a test folder on a HOST computer (carrying a VM)
On the VM, I map the project folder to a "Z:\"-drive


On the VM, Delphi 10.3.3 is running.
I open the project specified by "\\MyHost\MyProjectFolder\MyProject.dproj"

Build it
Run it.

MadExcept catches the exception

I close it

I open the the project specified by "Z:\MyProjectFolder\MyProject.dproj"

Build it
Run it

MadExcept does NOT catch the exception.

Same project in the 2 cases - just addressed on different ways.

Very strange

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 10:00 am
by madshi
What happens if you build the project using Z:\, but then run it through the Explorer using the UNC path? Does it work then or fail?

Basically I want to know if it's the compiling or the running which is the problem.

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 1:42 pm
by A. Balslev
In both cases I do as follows:

Build
Go to the windows explorer, and double click on the ,EXE file, means running from windows explorer

If you want to look at it, I could share my screen. If so - send a direct mail

br.

Anders

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 1:46 pm
by madshi
It seems you don't understand what I'm aiming at. I'm now asking for the 3rd time in a row:

Is it the compiling (to Z:\ vs UNC) or the running (from Z:\ vs UNC) which is the problem?

You can test this by compiling to Z:\ and then running from UNC. Or by compiling to UNC and then running from Z:\.

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 1:53 pm
by A. Balslev
Compiling to Z:
Running from Z: -->Problem
Running from UNC --> Problem

Compiling to UNC
Running from Z: --> No problem
Running from UNC --> No problem

br.

Anders

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 2:02 pm
by madshi
Ok, thanks. So clearly compiling is the problem, not running. Can you please create an empty file named "madExceptWizard.txt" on your desktop, then start Delphi and compile to Z:. Afterwards the madExceptWizard.txt file should be filled. Now please rename the file to "problem.txt". Then please stop Delphi. Create another empty file named "madExceptWizard.txt", start Delphi and compile to UNC. Please rename the file to "ok.txt". Finally, please upload the files somewhere for me to look at.

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 2:31 pm
by A. Balslev
I have created the 2 files (OK.txt and Problem.txt) which are both filled.

I can't upload it since "The extension txt is not allowed." (why?)

Can I send them directly at to an e-mail
br.

Anders

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 2:33 pm
by madshi
I'm not sure, maybe if you zip them you can upload them here? Not sure how I configured the forum, to be honest.

You can also send them to me directly, or upload them to a file host, e.g. MediaFire.

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 2:40 pm
by A. Balslev

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 2:45 pm
by madshi
Those 2 files look almost identical. It seems that madExceptPatch.exe (which is the tool which does some additional patching on your EXE file after the Delphi compiler & linker have run through) believes that patching suceeded just fine. So I'm at a loss right now to understand what's going on.

Can you please upload the two EXE files as "problem.exe" vs "ok.exe"? I don't need to be able to execute them, I just want to look at their resource section and file size etc, to check if I can see a meaningful difference somehow.

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 3:04 pm
by A. Balslev
Uploaded to same one-drive server:
https://itqconsult-my.sharepoint.com/:f ... Q?e=Ceikvd
2 executable files
2 new OK_2 and Problem_2 txt-files

br.

Anders

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 3:10 pm
by madshi
Can't see anything wrong, both look nearly identical... :shock: And one of these works and one doesn't?

I guess the only thing you could do now is try to debug madExcept.pas by setting breakpoints and trying to figure out why it doesn't work when compiled to Z:\. In order to set breakpoints you need to copy "madExcept.pas" and "mad.inc" into your project folder and then recompile. First breakpoint to set might be in madExcept.HandleException().

It's all very weird, to be honest.

Of course alternatively you could always compile using the UNC path. But it shouldn't be necessary. Not sure what's going on...

Re: Exception not caught when project is on network drive

Posted: Tue May 05, 2020 3:17 pm
by A. Balslev
Yes - very strange.
Try to run both executables, and click on button1
Problem : Just a messagebox showing an exception
OK : The wellknown MadExcept dialog box shows up

I'll try to follow your instructions

br.
Anders