- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While I'm at it, let me express some frustration for trying to post this and instead getting a web page that said...
Service Unavailable - Zero size object
The server is temporarily unable to service your request. Please try again later.
Reference #15.17b0d040.1250118897.3ef4367
Anyway, I am trying to get a stack trace from a Fortran dll/library upon a floating point crash, such as divide by zero. I've tried to get the same from a managed app calling the Fortran dll. I do get a stack trace, but it only gives me the managed stack trace, leaving out the Fortran part.
So I've tried to write a C++/Fortran combo, and here's what happens:
C++ code calls _set_se_translator
C++ code calls Fortran function
Fortran calls SETENVQQ("FOR_DIAGNOSTIC_LOG_FILE=c:\error_log.txt")
Fortran calls a function
Stated function causes a divide-by-zero crash
I am now in the function registered with _set_se_translator
I "walk the stack" using the Windows API calls, and my stack includes C++ functions, but no Fortran functions.
I don't get the c:\error_log.txt file either
So is there any way to get the FP stack trace from a Fortran dll/library?
Service Unavailable - Zero size object
The server is temporarily unable to service your request. Please try again later.
Reference #15.17b0d040.1250118897.3ef4367
Anyway, I am trying to get a stack trace from a Fortran dll/library upon a floating point crash, such as divide by zero. I've tried to get the same from a managed app calling the Fortran dll. I do get a stack trace, but it only gives me the managed stack trace, leaving out the Fortran part.
So I've tried to write a C++/Fortran combo, and here's what happens:
C++ code calls _set_se_translator
C++ code calls Fortran function
Fortran calls SETENVQQ("FOR_DIAGNOSTIC_LOG_FILE=c:\error_log.txt")
Fortran calls a function
Stated function causes a divide-by-zero crash
I am now in the function registered with _set_se_translator
I "walk the stack" using the Windows API calls, and my stack includes C++ functions, but no Fortran functions.
I don't get the c:\error_log.txt file either
So is there any way to get the FP stack trace from a Fortran dll/library?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the Fortran exception handler never gets invoked, and it won't when the main program isn't Fortran, then setting FOR_DIAGNOSTIC_LOG_FILE will have no effect for errors that aren't Fortran-specific (I/O errors, etc.) I am not really familiar with C++ structured exception handling, but it might be that the Fortran frames are no longer on the stack. You may want to try adding the option /Oy- to the Fortran compiles. This will preserve the use of EBP as a frame pointer and may help with stack traces.

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