* * *

Author Topic: GDB crashes on Win7/64  (Read 698 times)

Sylvain_26

  • New member
  • *
  • Posts: 6
GDB crashes on Win7/64
« on: July 25, 2017, 01:13:41 pm »
Hello,

I've been using Lazarus for a while on a previous computer, and I am now trying to install it on a new computer, and I systematically get a SIGSEGV error related to GDB, when I close the graphical window of the program I'm working on.

I'm running Win 7, 64 bits version. I have the admin rights.

To give you more details:
-the error is systematic, whatever the project I'm working on. For example, if I compile a new, empty project, with just a blank window and not a single line of code added, the program is successfully compiled, but upon closing, I get this SIGSEGV error.
- I tried to install several versions of Lazarus (taking great care of removing any trace of previous install between each version): 1.4, 1.6, and the beta 1.8. All give the same error.
- I tried replacing the default GDB with an alternative version, taken from the Lazarus sourceforge, and I still get the error.
- I tried all compilation options (Dwarf, etc.), and I get an error with all version.
- I checked in my MS-Windows configuration that there is no path associated with an alternative GDB install. I also made a global search on the computer for alternative GDB installs, but could not find one. So, I'm pretty sure the problem does not come from a conflict between two GDB installs.
- I tried disabling my antivirus software.

I'm pretty sure that the error comes from GDB, because :
- when I disable it in Lazarus options, I do not get any error.
- when I launch the compiled project exe from Windows, I do not get any error upon closing.

Following previous suggestions, I took care of installing Lazarus in a simple directory (c:\Lazarus).

Do you please any idea of where the problem could come from?
My guess would be that some dll is missing in windows, but then this problem should have been solved upon Lazarus (re)installation, right?

Thanks for any help you could provide!
Sylvain
« Last Edit: July 25, 2017, 01:19:21 pm by Sylvain_26 »

Thaddy

  • Hero Member
  • *****
  • Posts: 4441
Re: GDB crashes on Win7/64
« Reply #1 on: July 25, 2017, 01:28:49 pm »
1. WHAT version of FPC.... that's the important one...
2. WHAT version of Lazarus... o, you did that...
3. WHAT version of GDB.... that is also really important...

This is a silly question. I am not angry yet, but plz give that information.
 8-)
« Last Edit: July 25, 2017, 01:31:52 pm by Thaddy »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

Sylvain_26

  • New member
  • *
  • Posts: 6
Re: GDB crashes on Win7/64
« Reply #2 on: July 25, 2017, 01:35:42 pm »
Hi,

thanks for taking time to answer.
No problem, I'm not really in the computer field - I'm a physicist, so I fully understand that my question can be unclear :-)

For example, I currently I am trying to make it work with the lastest stable Lazarus version.
This means Lazarus 1.6.4, FPC 3.0.2, and I currently am playing with GDB 7.2.1, 7.3.5 and 7.7.1.

Hope it helps?

Thaddy

  • Hero Member
  • *****
  • Posts: 4441
Re: GDB crashes on Win7/64
« Reply #3 on: July 25, 2017, 02:40:51 pm »
Which version of GDB crashes? Can you give me a small reproducable example?
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

Sylvain_26

  • New member
  • *
  • Posts: 6
Re: GDB crashes on Win7/64
« Reply #4 on: July 25, 2017, 02:47:05 pm »
Actually, all three crash exactly the same way.

Concerning the example, I'm not sure that it will be really helpful, because the crash occurs even when I create an empty project (generated through the "new project" option of Lazarus) that I then immediately compile.
Do you want that I upload the "empty" code sheet?

Thanks again!

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4333
    • wiki
Re: GDB crashes on Win7/64
« Reply #5 on: July 25, 2017, 02:57:00 pm »
Is it
1) your app crashes, when running under gdb?
2) gdb itself crashes?

In any case, try:

1) http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working
 switch off "solib"

2) (if it is gdb that crashes) compile with dwarf ONLY
that is recompile LCL and all packages, using dwarf (or without debug info).
Each package has its own setting for stabs/dwarf. And some newer gdb may have issues with stabs. So if a single package is left on stabs, that may be an issue.


Thaddy

  • Hero Member
  • *****
  • Posts: 4441
Re: GDB crashes on Win7/64
« Reply #6 on: July 25, 2017, 03:03:18 pm »
Concerning the example, I'm not sure that it will be really helpful, because the crash occurs even when I create an empty project (generated through the "new project" option of Lazarus) that I then immediately compile.
Any compilebale example will help me in debugging. Sorry there are really too many questions that can be answered without code.
Everybody is guessing, you see?
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

Sylvain_26

  • New member
  • *
  • Posts: 6
Re: GDB crashes on Win7/64
« Reply #7 on: July 25, 2017, 03:23:22 pm »
Thanks Thaddy and Martin!

Thaddy: problem occurs on really empty file. Typically, this code would make GDB crash upon exiting the compiled window.
Code: Pascal  [Select]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.   private
  13.     { private declarations }
  14.   public
  15.     { public declarations }
  16.   end;
  17.  
  18. var
  19.   Form1: TForm1;
  20.  
  21. implementation
  22.  
  23. {$R *.lfm}
  24.  
  25. end.
  26.  
  27.  

Martin:
Yes, only GDB is crashing.
When I compile the example above from Lazarus, I see the compiled empty window (so compilation is ok), and when I close it (using the cross at the top right of the window), I get the following message (translated from French, so it may be approximative):
Quote
Project1 has raised an error of class "external: SIGSEGV" at address 745B36A8.
and I am returned to the Lazarus interface, where I can work without any problem (including re-compiling and re-having the error).

I have done what you asked me to do in point 1 (both enabling DisableLoadSymbolsForLibraries and switching off solib by inserting the code in the Debugger_startup_Options item), but the problem remains.

I am unsure on how I should proceed with point 2. From what I understood, you asked me to recompile Lazarus. I guess it must be done using the "Tools -> Create Lazarus with profile Normal"? If I'm right, I'm truly sorry, but I don't know how to pass the dwarf option. The only place where I could find where to put this option was in the "project options -> compilator options -> debug" tab. But this is not what you're asking me to do, right?

Thanks again to you too, that's really cool that you take so much time to help me!

Cyrax

  • Hero Member
  • *****
  • Posts: 537
Re: GDB crashes on Win7/64
« Reply #8 on: July 25, 2017, 03:30:08 pm »
Are you perhaps building 32-bit applications? If you are, then you need trunk (development version of FPC) which itself is built with -dTEST_WIN32_SEH option enabled.

Sylvain_26

  • New member
  • *
  • Posts: 6
Re: GDB crashes on Win7/64
« Reply #9 on: July 25, 2017, 05:12:51 pm »
Hello Cyrax,
Thanks for your help. Honnestly, I don't know. How can I check this?
I am right now using the Lazarus 1.6.4, 64 bits version (I thought this would be ok ?), and I did not attempt to change any configuration with regards to the FPC. I just played with the GDB versions.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4333
    • wiki
Re: GDB crashes on Win7/64
« Reply #10 on: July 25, 2017, 09:54:23 pm »
Yes, only GDB is crashing.
Quote
Project1 has raised an error of class "external: SIGSEGV" at address 745B36A8.

To be correct: No GDB is not crashing. Your app is crashing
    Your app is crashing only when running under GDB.
That is very different.

The Dwarf/Stabs is more an issue with GDB itself crashing. So probably not your problem.


745B36A8 => looks like you might have a 32 bit app (I think for 64 bit it would display more digits, but not 100% sure). The address is either kernel or more likely a driver.
It happens occasionally that drivers conflict with gdb, but often the solib setting fixes this.

Quote
Lazarus 1.6.4, 64 bits
And you also downloaded the alternative gdb from the "windows 64 bit" folder on sourceforge?
(There are alternative gdb for 32 bit, in the "windows 32 bit" folder too).


If you install ONLY the 64 bit version of lazarus, then it can only build 64bit apps. (and only comes with the 64 bit gdb too).
So maybe install from scratch.

Just in case, there is a difference between the 64 bit Lazarus, and the 64 bit add on to the 32bit Lazarus.
The one and only installer needed for 64bit windows:
https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%201.6.4/lazarus-1.6.4-fpc-3.0.2-win64.exe/download

Sylvain_26

  • New member
  • *
  • Posts: 6
Re: GDB crashes on Win7/64
« Reply #11 on: July 28, 2017, 01:09:46 pm »
Hi,

First of all, I apologize for answering so late, I've not been able to connect to the Internet these last days.
I removed all existing installs, restarted the computer, and installed the version you suggested, but the problem persists...

I'm not sure we will find a solution (at least, it seems I do not have the level of knowledge required to solve this), and it's not a so big issue: it's just that I have to take care of always stopping the application using the Ctrl + F2 option of Lazarus instead of the normal way.
So, unless there are still tests you would want me to do (that would be with pleasure!), I would say that it's not useful for you wasting so much time trying to help me.

In any case, thanks to all of you!

Sylvain

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus