- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a Fortran main application that calls intoa C/C++ library. The very first thing that the Fortran main does is call into the C library to register an exception handler via the Win32 function SetUnhandledExceptionFilter.
Then further into the Fortran program, I deliberately create an access violation in the C library by writing to a NULL pointer to test the exception filter function. However, I am not seeing the exception filter function being invoked. Instead, I am seeing the forrtl error listing. I also tried defining the environment variable FOR_IGNORE_EXCEPTIONS, but I get the JIT debugger popup dialog instead of the exception filter being invoked. Why isn't the exception filter function being invoked? Is there any special build setting I need to enable? My test program source and solution filesare included in the for_runtime_tests.zip file.
I've also have a c_main program that does a similar kind of thing; and the exception filter function is invoked.
Compiler information:
Intel Visual Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20070913 Package ID: w_fc_p_10.1.011, and
Microsoft C/C++ Optimizing Compiler Version 14.00.50727.762 for x64
Thanks,
-brian
I have a Fortran main application that calls intoa C/C++ library. The very first thing that the Fortran main does is call into the C library to register an exception handler via the Win32 function SetUnhandledExceptionFilter.
Then further into the Fortran program, I deliberately create an access violation in the C library by writing to a NULL pointer to test the exception filter function. However, I am not seeing the exception filter function being invoked. Instead, I am seeing the forrtl error listing. I also tried defining the environment variable FOR_IGNORE_EXCEPTIONS, but I get the JIT debugger popup dialog instead of the exception filter being invoked. Why isn't the exception filter function being invoked? Is there any special build setting I need to enable? My test program source and solution filesare included in the for_runtime_tests.zip file.
I've also have a c_main program that does a similar kind of thing; and the exception filter function is invoked.
Compiler information:
Intel Visual Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20070913 Package ID: w_fc_p_10.1.011, and
Microsoft C/C++ Optimizing Compiler Version 14.00.50727.762 for x64
Thanks,
-brian
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Brian,
I can reproduce what you're seeing and I agree it does not look correct. I'll have to pass this on to the developers for investigation - when I hear more, I'll let you know. The issue ID is DPD200121369.
I was not familiar with this particular API - the recommended way of catching errors is to wrap the Fortran code in a C++ code that uses a try-except block. Have you considered that?
I can reproduce what you're seeing and I agree it does not look correct. I'll have to pass this on to the developers for investigation - when I hear more, I'll let you know. The issue ID is DPD200121369.
I was not familiar with this particular API - the recommended way of catching errors is to wrap the Fortran code in a C++ code that uses a try-except block. Have you considered that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Brian,
I can reproduce what you're seeing and I agree it does not look correct. I'll have to pass this on to the developers for investigation - when I hear more, I'll let you know. The issue ID is DPD200121369.
I was not familiar with this particular API - the recommended way of catching errors is to wrap the Fortran code in a C++ code that uses a try-except block. Have you considered that?
I can reproduce what you're seeing and I agree it does not look correct. I'll have to pass this on to the developers for investigation - when I hear more, I'll let you know. The issue ID is DPD200121369.
I was not familiar with this particular API - the recommended way of catching errors is to wrap the Fortran code in a C++ code that uses a try-except block. Have you considered that?
Yes, I've done some experiments wrapping the Fortran main inside a C/C++ main, similar to what's described in the documentation under:
Error Handling -> Handling Run-Time Errors ->Advanced Exception and Termination Handling
->Handlers for the Application (Project) Type.
and that works.We have a lot of existing Fortran applications.So I want tomake sure there is absolutelynothing I can do strictly on the Fortran side, before suggesting itto the rest of the development team to pursue the alternative of wrappingthe Fortran code inside C/C++.
Thanks,
-brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
I am new to this forum. How do I monitor the issue ID? Can you give me an idea when I could expect any feedback from the developers? I am trying to resolve this issue which is important to our customers.
Thanks in advance,
-brian
I am new to this forum. How do I monitor the issue ID? Can you give me an idea when I could expect any feedback from the developers? I am trying to resolve this issue which is important to our customers.
Thanks in advance,
-brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will get notified when there is an update and will post a reply here. I would not expect a quick resolution to this, given its complexity and use of a Win32 API routine, but I will let the developers know that this is important to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The cause of this problem has been found and fixed. I do not yet know when the fix will appear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The fix should appear in Update 4, scheduled for mid-December.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue was resolved in 11.1 Update 4. Defining the environment variable FOR_IGNORE_EXCEPTIONS now has the desired behavior.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page