Exception not caught when project is on network drive

delphi package - automated exception handling

Exception not caught when project is on network drive

Postby A. Balslev » Fri May 01, 2020 1:34 pm

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
A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Re: Exception not caught when project is on network drive

Postby madshi » Mon May 04, 2020 2:06 pm

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?
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception not caught when project is on network drive

Postby A. Balslev » Tue May 05, 2020 9:34 am

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
Attachments
Madshi_1.PNG
2 identical projects
Madshi_1.PNG (5.5 KiB) Viewed 457 times
Project2_NonMapped.zip
Using non-mapped drive Madexcept works
(6.33 KiB) Downloaded 12 times
Project2_Mapped.zip
Using mapped drive Madexcept doesnt work
(6.43 KiB) Downloaded 11 times
A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Re: Exception not caught when project is on network drive

Postby madshi » Tue May 05, 2020 10:00 am

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.
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception not caught when project is on network drive

Postby A. Balslev » Tue May 05, 2020 1:42 pm

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
A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Re: Exception not caught when project is on network drive

Postby madshi » Tue May 05, 2020 1:46 pm

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:\.
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception not caught when project is on network drive

Postby A. Balslev » Tue May 05, 2020 1:53 pm

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
A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Re: Exception not caught when project is on network drive

Postby madshi » Tue May 05, 2020 2:02 pm

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.
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception not caught when project is on network drive

Postby A. Balslev » Tue May 05, 2020 2:31 pm

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
A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Re: Exception not caught when project is on network drive

Postby madshi » Tue May 05, 2020 2:33 pm

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.
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception not caught when project is on network drive

Postby A. Balslev » Tue May 05, 2020 2:40 pm

A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Re: Exception not caught when project is on network drive

Postby madshi » Tue May 05, 2020 2:45 pm

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.
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception not caught when project is on network drive

Postby A. Balslev » Tue May 05, 2020 3:04 pm

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
A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Re: Exception not caught when project is on network drive

Postby madshi » Tue May 05, 2020 3:10 pm

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...
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception not caught when project is on network drive

Postby A. Balslev » Tue May 05, 2020 3:17 pm

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
A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Next

Return to madExcept

Who is online

Users browsing this forum: No registered users and 15 guests