Author Topic: SIGFPE crash when debug Excel dll  (Read 11846 times)

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
SIGFPE crash when debug Excel dll
« on: January 22, 2016, 02:10:41 pm »
I have set the Project "programmes arguments" so that on debug the current code (which is a Fortran DLL/Excel Add In) first launches Excel, and a particular XLS file that relies on the source Fortran loaded in C::B.

On clicking the Debug process (red arrow/triangle), the debug appears to begin, it starts to launch Excel, however it crashes before Excel completes its launch.  The Crash is a SIGFPE (arithmetic fault) raised be kernel32.dll, following msvbvm60.dll.

This exact some process works correctly when the dll/debug is launched from any of CVF/Intel/VisualStudio etc.

To be clear, it never makes it back to C::B or any lines in the source.

I have tried it with a couple specific xls's, and also without any xls, just Excel on its own.  Always the same crash, at the same point.

I would be grateful for any assistance as without this facility the entire C::B/GCC/MingW strategy is shot ... and I would like to move away from the commercial compilers.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: SIGFPE crash when debug Excel dll
« Reply #1 on: January 22, 2016, 07:23:39 pm »
This is probably a problem with gdb...

you can try to update gdb, or use CDB instead

you can try to run excel trought gdb without c::b, if this works, it would be great if you can post the output from gdb...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SIGFPE crash when debug Excel dll
« Reply #2 on: January 22, 2016, 08:08:30 pm »
Another option is to use the Debug -> Attach instead of starting Excel under gdb control.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: SIGFPE crash when debug Excel dll
« Reply #3 on: January 24, 2016, 09:32:07 am »
OK, I tried CDB vs GDB, as well as all of the permutation of the GDB's (Default, i686, x86) etc. ... NO JOY.  It always crashes CB/MingW etc in exactly the same way.

I tried the "attach" route also, but after entering the PID, and saving etc, on trying to run it told me that I must choose a PID, and on checking the previously entered PID had disappeared ... I repeated this a few times, always with the same results, again NO JOY.

Once again, and from earlier, when I do this same process with Visual Studio/CVF/IVF etc, it always works (Excel launches from the debugger, and activating DLL Funcs in sheets etc causes entry back into the IDE/source).

Also, on an earlier (non-DLL) project,  I had tested CB/MingW with "console/GUI" code, where debugging worked, more or less ... so it may be something special in relation to DLL's/Excel etc ... but no idea really.

A few other really weird things are noticeable.  For example, the DLL works in Debug compile mode (not running gdb), but Excel crashes with the Release mode of the exact same DLL as soon as one of that DLL's funcs is attempted to be calc'd.

By contrast, both Debug and Release formats from VS etc work as expected.

This is all on WinXP64, using the 32bit MingW64 4.9.1 machinery with gdb 7.81.

... I am a little apprehensive about updating MingW etc, since I had used that to build GTK etc etc, which was very difficult due to the many version collisions/issues ... so I'd rather not have to install a new MingW etc, and the lose some months getting everything else to work.

I attach the CB (crash) log:

Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: E:\FORTRAN\Climate\Hitran1\
Adding source dir: E:\FORTRAN\
Adding file: D:\Apps\MSO\Office10\EXCEL.EXE
Changing directory to: E:/FORTRAN/Climate/Hitran1/.
Set variable: PATH=.;D:\Apps\MingW\mingw32\bin;D:\Apps\MingW\mingw32;C:\Documents and Settings\All Users\Application Data\Oracle\Java\javapath;D:\Apps\Winteracter\bin;d:\Apps\MsDev\Common\TOOLS;d:\Apps\MsDev\Common\MSDEV98\BIN;d:\Apps\MsDev\DF98\BIN;d:\Apps\MsDev\VC98\BIN;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ART\ARTLibXL;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn;C:\Program Files\Microsoft SQL Server\90\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn;D:\Apps\GhostScript\gs\gs9.10\lib;D:\Utilities\Universal Extractor;D:\Apps\Intel\IDB\9.1\IA32\Script;D:\Apps\Intel\Compiler\Fortran\9.1\IA32\Bin;D:\Apps\Intel\Compiler\Fortran\9.1\em64t\bin;D:\Apps\Intel\IDB\9.1\EM64T\Script;D:\Apps\AMD\CodeAnalyst\bin;C:\Program Files (x86)\AMD\CodeAnalyst\bin;D:\Apps\MingW\local32\bin;D:\Apps\MingW\msys\1.0\bin;D:\Apps\CMake\bin
Starting debugger: D:\Apps\MingW\mingw32\bin\gdb.exe -nx -fullname  -quiet  -args D:/Apps/MSO/Office10/EXCEL.EXE
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Reading symbols from D:/Apps/MSO/Office10/EXCEL.EXE...(no debugging symbols found)...done.
Debugger name and version: GNU gdb (GDB) 7.8.1
Child process PID: 192
Program received signal SIGFPE, Arithmetic exception.
In RaiseException () (C:\WINDOWS\syswow64\kernel32.dll)


By contrast, a comparable (successful) Log from VS is:

Loaded 'D:\Apps\MSO\Office10\EXCEL.EXE', no matching symbolic information found.
Loaded 'not_an_image', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\ntdll32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\secur32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\ole32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\shimeng.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\apphelp.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\AppPatch\acgenral.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\shlwapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\winmm.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\oleaut32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msacm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\shell32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\userenv.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\wow64_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.5190_x-ww_B8C2A5B7\comctl32.dll', no matching symbolic information found.
Loaded 'C:\Program Files (x86)\Common Files\Microsoft Shared\Office10\MSO.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msctf.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msctfime.ime', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\ctagent.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\clbcatq.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\comres.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msimtf.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\xpsp2res.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\setupapi.dll', no matching symbolic information found.
Loaded 'D:\Apps\MSO\Office10\Library\Analysis\ANALYS32.XLL', no matching symbolic information found.
Loaded 'D:\Apps\MSO\Office10\Xlcall32.dll', no matching symbolic information found.
Loaded 'C:\Program Files (x86)\Common Files\Microsoft Shared\Office10\RICHED20.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\sxs.dll', no matching symbolic information found.
Loaded 'C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL', no matching symbolic information found.
Loaded 'C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\1033\VBE6INTL.DLL', no matching symbolic information found.
Loaded 'D:\Apps\Adobe\Acrobat 9.0\PDFMaker\Office\PDFMOfficeAddin.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86\msvcp80.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86\msvcr80.dll', no matching symbolic information found.
Loaded 'D:\Utilities\SnagIt 7\SnagItOfficeAddin.dll', no matching symbolic information found.
Loaded 'D:\Utilities\SnagIt 7\SnagItOfficeAddinRes.dll', no matching symbolic information found.
Loaded 'D:\Utilities\SnagIt 7\msvcr71.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_5.82.3790.5190_x-ww_D21E1F39\comctl32.dll', no matching symbolic information found.
Loaded 'D:\XL AddIns\CodeCleaner\VBACodeCleaner.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msvbvm60.dll', no matching symbolic information found.
Loaded 'C:\Program Files (x86)\Common Files\Designer\MSADDNDR.DLL', no matching symbolic information found.
First-chance exception in EXCEL.EXE (KERNEL32.DLL): 0xC000008F: Float Inexact Result.
First-chance exception in EXCEL.EXE (KERNEL32.DLL): 0xC000008F: Float Inexact Result.
First-chance exception in EXCEL.EXE (KERNEL32.DLL): 0xC000008F: Float Inexact Result.
Loaded 'D:\Apps\Adobe\Acrobat 9.0\Acrobat\Adist.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\winspool.drv', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\comdlg32.dll', no matching symbolic information found.
Loaded 'D:\Apps\Adobe\Acrobat 9.0\Acrobat\Adist.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\winspool.drv', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\comdlg32.dll', no matching symbolic information found.
Loaded 'D:\Apps\Adobe\Acrobat 9.0\Acrobat\Adist.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\winspool.drv', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\comdlg32.dll', no matching symbolic information found.
Loaded 'E:\C Work\ARTLibXLCore\CallerDims.xll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\oleacc.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\FM20.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\comdlg32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\linkinfo.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\ntshrui.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\netapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\FM20ENU.DLL', no matching symbolic information found.
Loaded 'D:\Apps\MSO\OFFICE11\REFEDIT.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\asycfilt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\wintrust.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\crypt32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msasn1.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\imagehlp.dll', no matching symbolic information found.
The thread 0x744 has exited with code 1 (0x1).
Loaded 'E:\FORTRAN\ARTLibXLCore\Add-In\ARTLibXLCore.xll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\mfc71d.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\msvcr71d.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\MFC71ENU.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\wininet.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\normaliz.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\urlmon.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\iertutil.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\iphlpapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\psapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\ws2help.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\DFORMDD.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\MSVCRTD.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\wsock32.dll', no matching symbolic information found.
Loaded 'E:\FORTRAN\ARTLibXLCore\Add-In\FuncNmXL.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\mlang.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SysWOW64\hlink.dll', no matching symbolic information found.

... this too has a "float inexact" error, but seems to survive it somehow, and works.

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: SIGFPE crash when debug Excel dll
« Reply #4 on: January 24, 2016, 09:48:16 am »
I have also found a win binary of gdb ver 7.9 ... exactly the same results with that too.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SIGFPE crash when debug Excel dll
« Reply #5 on: January 24, 2016, 01:27:13 pm »
I tried the "attach" route also, but after entering the PID, and saving etc, on trying to run it told me that I must choose a PID, and on checking the previously entered PID had disappeared ... I repeated this a few times, always with the same results, again NO JOY.
What do you mean by this?
The steps are:
1. start excel
2. find the pid of excel
3. debug -> attach
4. enter the pid of excel

For the record the debug format of gcc/gdb is different than the one used by visual studio, also I'm not sure if it follows the abi 100%.
So I'm not surprised that you have these problems.
Also what do you mean by cdb doesn't work? Can you show a log from it?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: SIGFPE crash when debug Excel dll
« Reply #6 on: January 24, 2016, 04:02:14 pm »
1) Re "attach": those were the steps I followed, not sure why it did not work earlier,  it does now :-).

Though, it is a bit of a pain to fiddle with those setting every time a debug is required.

If I had to guess, the previous attempts failed to due the multiplicities of DLL's I am running and they may have had some "cross contamination" (that's a long story).

2) CDB:  I enter the Setting/Debugger bit, and change the radio button from GDB to CDB.  Not sure if that is the correct procedure.

... BTW, I now running GDB 7.9.0

I have attached a couple of images Re the "parameters" approach, showing the messages just after the SEGFPE "balloon".

3) Also some good news, the earlier comment Re Debug compile executing, but Release crashing, has also been resolved (I tried to get a little too clever with the directives/switches for "decorating" the export symbols (notably -mrtd), and that seemed to be the cause of that (along with a little extra stupidity of mine with some OpenMP directives).

Finally, and I hope it is not too cheeky to ask on an unrelated point, but one little thing that is very annoying is that the copy/paste etc access via the "right-click flying menu" is rather distracting, being buried in a sub-menu.  Would there be instructions somewhere to have CB show more typical layout, with the copy/paste etc items on the "top" rather than a sub-menu?

BTW, I am very grateful for your prompt and thoughtful attention ... many thanks.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SIGFPE crash when debug Excel dll
« Reply #7 on: January 24, 2016, 05:46:40 pm »
Have you tried to hit the continue button after getting the SIGFPE?
Have you tried to disable catching of exceptions in the settings of the debugger?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: SIGFPE crash when debug Excel dll
« Reply #8 on: January 24, 2016, 09:00:06 pm »
1) "Continue":  Yes, I always try that.  Just get more SIGFPE "balloons", repeat of same messages in logs,  etc.

2) "Catch Exceptions":  The only thing I found like that was "catch C++ exceptions".  Tried it, no joy.

Cheers for that ...


... BTW, in Project/Programme Args etc.  Presumably, the actual "Program Arguments" field takes the path/file-name of the xls, or whatever, that should be opened by the program (path/app) in the "Host Application" field.  Are there any syntax requirements for the "file-name" etc, such quotes, no blank spaces, "reverse slash" for paths,  etc?   It may not affect the issue here (since I've tried also no file, as well as various permutations), still it's best to know.

« Last Edit: January 24, 2016, 09:06:36 pm by DrOli »

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: SIGFPE crash when debug Excel dll
« Reply #9 on: February 01, 2016, 04:54:28 pm »
FYI, have just dloaded/installed the just released CB 16.  It also fails with SIGFPE exactly as before when attempting to do debug Excel/DLL's etc.

BTW, on a separate note, and I hope this is not too cheeky, I am trying to get some sort of listing/display to show up in a View or Toolbar that shows all the Subroutines/Functions in the currently displayed file (all Fortran 90/95 etc, usually Modules).  Ideal also to be able to navigate between them, etc.  I wasn't sure if that would be the job of the "Symbol Browser" (it did not work for me) or ???.  Is there such a feature in CB?  How is it launched?  ... Perhaps there is a post for this.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: SIGFPE crash when debug Excel dll
« Reply #10 on: February 01, 2016, 05:58:27 pm »
FYI, have just dloaded/installed the just released CB 16.  It also fails with SIGFPE exactly as before when attempting to do debug Excel/DLL's etc.
As i mentioned i don't think that this is a problem of codeblocks, but a problem with gdb and how it handles signals. So i would recommend you to search help in a gdb forum, or on the gdb mailing list. They can help you more.
You may also look at this:
http://stackoverflow.com/questions/15662810/gdb-catching-a-signal-and-continue-debugging
https://www.gnu.org/software/gsl/manual/html_node/Handling-floating-point-exceptions.html
http://fpc-devel.freepascal.narkive.com/klJ6iOWq/hot-to-handle-sigfpe-sigsegv-using-gdb-as-debugger


BTW, on a separate note, and I hope this is not too cheeky, I am trying to get some sort of listing/display to show up in a View or Toolbar that shows all the Subroutines/Functions in the currently displayed file (all Fortran 90/95 etc, usually Modules).  Ideal also to be able to navigate between them, etc.  I wasn't sure if that would be the job of the "Symbol Browser" (it did not work for me) or ???.  Is there such a feature in CB?  How is it launched?  ... Perhaps there is a post for this.
This is the code completition plugin (with the symbols tab as you have found), and should work. Have you checked if the right "View" is selected (in the symbol tab is a drop down menu)? At least it works with c/c++ i don't know if fortran has an cc that supports symbols...

greetings

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: SIGFPE crash when debug Excel dll
« Reply #11 on: February 03, 2016, 02:15:23 am »
Many thanks for that, it was helpful, and have made at least some progress:

1) SIGFPE:  the 2nd link you had kindly provided inspired a guess (I am "math geek" not an "IT geek", so some of this is in the "nether regions" for me).  Notably, I put the expression

handle SIGFPE nostop

into the Settings/Debugger "Debugger Initialization commands" field, for each Debugger ( default/x86/i686, just in case) ... on a hunch.

This works, more or less.  CB/debugger still crashes sometimes (e.g. sometimes when a breakpoint is set), and it still throws various complaints at various times ... still, it is a massive improvement over "attach" etc.

2) Symbol Browser:  Yes I get the Symbol Browser tab/categories etc, just no symbols (with Fortran) files.  Yes, it does work with my C projects, the Symbol Browser tab shows the expected things.  This was not entirely unexpected.  For example, with older MSDev IDE's working with Fortran, one had to ask the "machine/IDE" explicitly to create a special browser file on Build, and it would produce a ".PDB" file, which then could be used with MSDev for at least some listing/navigation for Fortran. 

So, I thought there might be some "hidden switch" to create a ".PDB" equivalent in CB.

... it sounds like not, and so it seems no joy for Fortran ... perhaps this might go on a "wish list".

A couple of points:

1) Please please please, de-couple this from "code completion".  I hate code completion, I just need the symbol browser.

2) There are various times at which the CB interface "re-locates focus" (without indication)  to a portion NOT currently under the cursor.  Then, when using a mouse wheel (expecting the portion where the cursor is) to scroll, instead that "not in focus" portion scrolls.  Sometimes this is just annoying, but at other times it can become more serious.  For example, when I tested one of my C projects with the CB Symbol Browser, I scrolled the wheel while the cursor was over the "symbols", but instead CB scrolled the drop-down field which selects the scope of the symbols.  So, I had it set to "my project", and on its own, it scrolled to "everything" ... and then of course, CB when off to never-never-land for a long time while it sorted the symbols for every single bit of code in any way associated with that C project.

... I am guessing a simple solution is for CB to be a bit more diligent in checking/re-checking the cursor location and the implied "object in focus", perhaps another item for the wish list.

Once again, many many thanks for your prompt and helpful efforts.

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: SIGFPE crash when debug Excel dll
« Reply #12 on: March 19, 2016, 05:19:38 pm »
As a follow-up, it appears that the Excel/Fortran/DLL debuging process also has serious difficulties when large arrays are involved (e.g. 50 meg). 

I don't know enough to decide if this is a CB issue or a GDB issue (or ???).  In short,

1) CB/GFortran/DLL debugging works with the settings discussed previously, at least for "normal" size arrays/vars

2) I have set -Wl,--stack,52800000 in the linker settings (I also use OpenMP, not sure what difference that makes to this issue, but the problems exist for both OpenMP and non-OpemMP code).

3) Everything works in Release mode, and also in Debug "run" mode, at least until I try to set break points in s/r's that pass/use large arrays etc.  Then and or all of the following occurs:

a) CB "goes off into the ether" for a very long time, sometimes crashing CB outright, sometimes crashing Excel, etc, resulting with SIGFPE

At various times, the CB GUI itself does weird things (border changes colour), and generally has the feeling of "not responding" etc.

b) I started experimenting with the array sizes.  If I set small enough arrays, all seems well.  As I increase the array sizes, trying to stop at break points becomes increasingly difficult/time consuming (with much CB cpu/mem usage "whirling and twirling").  At sufficiently small array sizes, even with difficulties, CB can eventually complete the calc (though not stopping at break points in any predictable way, as I click the continue icon).  At large enough array sizes, the full crash occurs ... sometimes requiring CB to be "end process" from TaskManager, etc.

Is there some internal limit in CB or GDB etc?  If so, how/where can that limit be changed?

Many thanks

DrO

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SIGFPE crash when debug Excel dll
« Reply #13 on: March 19, 2016, 10:20:15 pm »
Add this "set print elements 200" to the initial commands in the debugger settings and should fix the problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: SIGFPE crash when debug Excel dll
« Reply #14 on: March 19, 2016, 10:59:07 pm »
Cheers, that fixed it. 

My gut suggested that it might be  a "watch window thing", and this fix appears to limit the number of items per watch window var.  Is that correct?  Does the setting do anything else?


BTW, on a related point, though I am not sure if this should be in a different thread:  I have tried to link in ArrayVisualizer (AV) for "watching" array var's during debug, but I have no idea how to link a watch var to AV (the Tools set up does not have an obvious option for this).  I have tried a few things, and did a search, but no joy.

Also, when watching vars that are of a User Defined Type, the CB watch just presents, effectively, the "flat array block representation".  Is it possible for the Watch viewer to have a "Tree" or "structure relevant"  view/format?

Many thanks