EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Invalid Handle Specified and SEHException

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#32326
Posted: 02/24/2015 05:14:01
by Stelios Mavridis (Basic support level)
Joined: 01/09/2015
Posts: 34

As i am developing my program i am now encountering 'random' crashes with the following message in the output window of Visual Studio:
The program '[3816] App.exe: Managed (v4.0.30319)' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'.

I have done the following in order to capture more info or a stack trace but they did not work:
Added try{}catch() in main() function.Nothing gets caught.
Also enabled/ticked the Common Language Runtime Exceptions in the Exception dialog with no results.

I do not use contexts or other IntPtr variables so i don't understand what the cause of this is.
According to my Applications log this seems to happen right after a PostOpen to a virtual file.

I also occasionally get a SEHException originating from a SafeHandle.finalize().
Even though i get a stack trace , it is useless as i only get something like this:

mscorlib.dll SafeHandle.finalize()
Managed Code
Managed Code

So i can not trace to a code line.

I there a tool that can assist me in figuring out what is happening?
Any other recommendations?

Thanks in advance.
#32327
Posted: 02/24/2015 07:14:09
by Eugene Mayevski (EldoS Corp.)

Is your question related to our product in any way?

We don't have any tools that you are looking for.


Sincerely yours
Eugene Mayevski
#32328
Posted: 02/24/2015 07:32:49
by Stelios Mavridis (Basic support level)
Joined: 01/09/2015
Posts: 34

Sorry for leaving this detail out.
Yes i am using the callback filter library.
In particular i am using a lot of virtual files in order to expose some non filesystem data.
Since posting and after re-reading the relevant documentation, it seems that the handle returned by CbFlt.CreateVirtualFiles should be kept open for the duration of the program execution.Am i correct in assuming this?
Would keeping the handles and closing them at program exit resolve the issue i am having?
#32329
Posted: 02/24/2015 07:44:17
by Vladimir Cherniga (EldoS Corp.)

The problem is in invalid handle value. May be that caused by the double closing the handle ?
#32330
Posted: 02/24/2015 08:28:52
by Stelios Mavridis (Basic support level)
Joined: 01/09/2015
Posts: 34

Quote
Vladimir Cherniga wrote:
The problem is in invalid handle value. May be that caused by the double closing the handle ?


I am supposed to close the handle, albeit when the program is exiting.
I guess CbFlt uses the handle in its operations and didn't like me closing it early?

Thanks for the feedback.
#32331
Posted: 02/24/2015 08:45:59
by Vladimir Cherniga (EldoS Corp.)

It shouldn't have any problems with closing the handle returned by CreateVirtualFile. Where did you get an exception exactly, did you try to close the virtual file right after creation ? Did you get a corresponding callback when call CreateVirtualFile ?
Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.

Reply

Statistics

Topic viewed 2675 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!