Exception not caught when project is on network drive

delphi package - automated exception handling

Re: Exception not caught when project is on network drive

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

Hi again

I have found in the file madExcept.pas there is a difference in execution:

Line 19452 the pointer
Forms_TApplication_HandleException
is nil in the problematic execution and non-nil in the OK execution

Hopefully this will help

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 4:04 pm

If you check where that variable is defined, there are a lot more pointers. Are they all "nil"? E.g.:

- Forms_TApplication_HandleException
- Forms_TApplication_ShowException
- SysUtils_ShowException
- System_ExceptionHandler

These should all be non-nil. According to the "madExceptWizard.txt" file you uploaded, these variables should all have been initialized correctly (to non-nil values) by madExceptPatch.exe.

Ideas:

1) Maybe when using Z:\, the YourProject.map file can't be created/updated correctly by the linker, so madExcept uses an old one?
2) Maybe when using Z:\, some anti-virus or similar software blocks some of the modifications madExcept does?
3) Maybe when using Z:\, the VM network logic somehow loses some of the modifications madExcept does?

None of that makes a lot of sense to me. But looking at the "madExceptWizard.txt" file, the variable "madExcept.Forms_TApplication_HandleException" was properly initialized with a non-"nil" value. So either the initialization was done to a wrong EXE file offset, which could happen if the map file wasn't correct. Or alternatively, the initialization was done, but somehow got lost by the file system or network handler, or blocked by an anti-virus software or something.

No other ideas right now, sadly...
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 8:59 pm

In madExcept.Pas, I have tried to debug the code.
I have set a breakpoint all lines where the pointer "Forms_TApplication_HandleException" is assigned.
The very first time the code hits a breakpoint is
Line 19062:
AddPtr(Forms_TApplication_HandleException, HInstance);

At this point the pointer already got a value on the good compilation, and nil at the bad compilation.
I do not find the code where it was assigned - despite the variable was initiated to nil
Are there any other source files where this pointer is assigned?

It will unfortunately not be possible for me to change generally to UNC - and we also do not know the root cause for the difference
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 9:32 pm

The pointer is changed by madExceptPatch.exe. Basically madExceptPatch.exe reads the map file for your EXE file to locate "Forms_TApplication_HandleException" within your compiled EXE file, and then modifies the EXE file to initialize the pointer. So when your EXE starts, the variable is no longer nil. So there isn't really any code at all within your compiled EXE file which sets "Forms_TApplication_HandleException".

Or in short: madExceptPatch.exe "hacks" your EXE file by modifying the EXE file bytes on harddisk to initialize Forms_TApplication_HandleException. And according to the "madExceptWizard.txt" log you uploaded, it succeeded. So Forms_TApplication_HandleException should not be nil. Which is why I think it's like to problems 1), 2) or 3) in my previous comment.
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 » Wed May 06, 2020 7:44 am

Problem solved
(but root cause was not found)
The Z:\ drive was defined as "\\vmware-host\"
We do not know why this should pose a problem.
But by mapping the network drive as "\\ITQ-HP2\..." to a new driveletter it works.

In my investigation I did as follows:
- Delete the .map file just to be sure there was no old .map file
- temporarily turn off the realtime scanning from my McAfee antivirus

None of those tests worked.
So the conclusion is your proposal 3)
We can close the issue (but on long term it could be interesting to know why the mapped "\\vmware-host\" brings 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 » Wed May 06, 2020 8:31 am

It's quite interesting. I'm happy to hear you found a solution.
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception not caught when project is on network drive

Postby iconic » Thu May 07, 2020 3:53 pm

A. Balslev,

VMWare likely does this for security reasons. Try clicking on your VM and perform the following:

"Edit Virtual Machine Settings" -> click "Options" tab to the right of "Hardware" tab and navigate down to "Shared Folders"

You should see some settings there. Can't say if that would make a difference or not but I've run into a similar issue in the
past, just can't recall exactly what I did at the time to remedy it :?

--Iconic
iconic
Site Admin
 
Posts: 959
Joined: Wed Jun 08, 2005 5:08 am

Re: Exception not caught when project is on network drive

Postby A. Balslev » Mon May 11, 2020 6:17 am

Hi again

I couldn't find any settings on my VM that could - intuitively - change the issue.

I do not consider it as a critical issue as long the alternative works :D

br.

Anders
Attachments
Madshi_5.PNG
Fileshare property
Madshi_5.PNG (22.52 KiB) Viewed 288 times
Madshi_4.PNG
Property of the individual shared folders
Madshi_4.PNG (55.51 KiB) Viewed 288 times
A. Balslev
 
Posts: 15
Joined: Fri Apr 06, 2012 2:40 pm

Previous

Return to madExcept

Who is online

Users browsing this forum: No registered users and 12 guests