Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29277 Discussions

intel fortran DLL is klobbering my SIGINT handler!

Groos__Geoff
Beginner
1,031 Views

Hey guys,

I'm doing an integration piece between a Java front-end and a very mathy chunk of fortran we've written. We've got it being loaded and executed properly.

The one annoying thing is that I'm using the JVM to subscribe to SIGINT, so I can do some persistence-ee things if the user hits Ctrl + C on one of our command line tools. This works well, except for that if I load the fortran dll after the signal handler was registered with the JVM, the fortran DLL appears to over-write the signal handler I put in with its own.

Fortran's default SIGINT handler prints out this:

error (200): program aborting due to control-C event
Image              PC        Routine            Line        Source
SOGOV1.dll         6B0B69C8  Unknown               Unknown  Unknown
KERNELBASE.dll     772123C4  Unknown               Unknown  Unknown
KERNEL32.DLL       74E07C04  Unknown               Unknown  Unknown
ntdll.dll          775DB54F  Unknown               Unknown  Unknown
ntdll.dll          775DB51A  Unknown               Unknown  Unknown

Whereas mine is a little more subtle, and I've got it working so long as I use stub code and avoid loading the fortran code (SOGOV1.dll).

Thanks for any help!

-Geoff

0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,031 Views

Actually, it's the Console Control Event Handler that is doing this. In version 16, currently in beta, we have introduced a new environment variable FOR_DISABLE_CONSOLE_CTRL_HANDLER which, if you set it to 1 before running the program, will prevent the run-time library (RTL) from establishing this handler. Feel free to download the beta and try this.

The RTL does check to see if you have a SIGINT handler and should avoid overriding it if there is one, but perhaps this test is not working for your environment. It can't check for use of SetConsoleCtrlEventHandler, though, which is why we created this new environment variable.

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,032 Views

Actually, it's the Console Control Event Handler that is doing this. In version 16, currently in beta, we have introduced a new environment variable FOR_DISABLE_CONSOLE_CTRL_HANDLER which, if you set it to 1 before running the program, will prevent the run-time library (RTL) from establishing this handler. Feel free to download the beta and try this.

The RTL does check to see if you have a SIGINT handler and should avoid overriding it if there is one, but perhaps this test is not working for your environment. It can't check for use of SetConsoleCtrlEventHandler, though, which is why we created this new environment variable.

0 Kudos
Groos__Geoff
Beginner
1,031 Views

Steve Lionel (Intel) wrote:

Actually, it's the Console Control Event Handler that is doing this. In version 16, currently in beta, we have introduced a new environment variable FOR_DISABLE_CONSOLE_CTRL_HANDLER which, if you set it to 1 before running the program, will prevent the run-time library (RTL) from establishing this handler. Feel free to download the beta and try this.

The RTL does check to see if you have a SIGINT handler and should avoid overriding it if there is one, but perhaps this test is not working for your environment. It can't check for use of SetConsoleCtrlEventHandler, though, which is why we created this new environment variable.

Thanks Dr Fortran!

I must admit I've had much more success asking technical questions on this board than I have technical ones about java on stack overflow.

I suppose this question is better off aimed at the Intel sales support, but we purchased our compiler license about 8 months ago now and I'm wondering: will we be able to upgrade to version 16 without additional cost? Also, are you confident enough in the current beta to suggest that we go to production with it if we cant find any problems? I would really like to get the ability to hit Ctrl + C to our customers soon, and this is the only thing blocking that.

 

Cheers,

-Geoff

0 Kudos
Steven_L_Intel1
Employee
1,029 Views

Geoff,

Assuming the license I found for your company is correct - it's the only one for the Fortran Windows product that is still valid - then yes, you would be able to install and use version 16 when it first releases, and maybe even the first update. I see a support end date of November 28, 2015. 

Version 16 beta is pretty good, but you can keep multiple versions around and select which one you want in Visual Studio. However, you must not "go to production" using a beta compiler!

0 Kudos
Reply