Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-09

(Still googling for it) GDB error 31 ?

21 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lukasz Sokol

Hi,

I have installed 0.9.30 (2011-03-08), FPC 2.4.2 rev. 29749 (i386-win32-win32/win64) on another machine with Windows XP Prof. SP3, from the installer download, then used SVN to copy a project onto it and run with Lazarus;

It compiles, and runs OK, but for some reason at some point (when I press a key on my keyboard when caret is in a TMemo), the GDB bails out with Error: 31 (found in debug log) at which time Lazarus panics and pulls a plug...

I did what http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips suggested, i.e. no -Xs, no -XX, no optimization or -O1.

I can replicate it with a small test project,
this is so small it's pointless to write code here :
- start a new project
- put a TMemo on it
- save&compile&run
- click on the Memo1 when running
- type any alphanumeric character on the keyboard
-> GDB crashes, this time not even reporting an Error number.

Still googling for what the Error: 31 means.

This does not happen on Lazarus 0.9.28.2 r22279 FPC 2.2.4 i386-win32-win32/win64.

Shall I report to bugtracker ?

Lukasz

Reply by email

Lukasz Sokol
to Lukasz Sokol

I shall mention:

The other (XP Pro) machine is a laptop and on my project, (as opposed to the test project, dunno why) the Error: 31 code appears just before line where one of the libraries is loaded :

Error: 31=library-loaded,id="c:\\Program Files\\Apoint\\Apoint.dll" [snip rest of line] _________
^ This does however /NOT/ appear when I run my test project, only the rest of the line;

But I gather now, this may be due to spaces in the path of the DLL...? (the infamous Program Files...)

The Apoint.dll is the part of the pointing device driver on this laptop so I guess disabling it is out of question...

?
Lukasz

Reply by email

Lubos Pintes
to Lukasz Sokol: I have installed 0.9.30 (2011-03-08), FPC 2.4.2 rev. 29749 (i386-win32-win32/win64) on…

I cannot confirm this.
I put TMemo on form, run, the "Memo1" text is in. I can do what I want and everything seems to work.
D?a 22.9.2011 13:16, Lukasz Sokol wrote / nap?sal(a):

Show quoted text 39 lines
Hi, I have installed 0.9.30 (2011-03-08), FPC 2.4.2 rev. 29749 (i386-win32-win32/win64) on another machine with Windows XP Prof. SP3, from the installer download, then used SVN to copy a project onto it and run with Lazarus; It compiles, and runs OK, but for some reason at some point (when I press a key on my keyboard when caret is in a TMemo), the GDB bails out with Error: 31 (found in debug log) at which time Lazarus panics and pulls a plug... I did what http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips suggested, i.e. no -Xs, no -XX, no optimization or -O1. I can replicate it with a small test project, this is so small it's pointless to write code here : - start a new project - put a TMemo on it - save&compile&run - click on the Memo1 when running - type any alphanumeric character on the keyboard -> GDB crashes, this time not even reporting an Error number. Still googling for what the Error: 31 means. This does not happen on Lazarus 0.9.28.2 r22279 FPC 2.2.4 i386-win32-win32/win64. Shall I report to bugtracker ? Lukasz -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Martin
to Lukasz Sokol: I have installed 0.9.30 (2011-03-08), FPC 2.4.2 rev. 29749 (i386-win32-win32/win64) on…
Lukasz Sokol wrote
Hi, I have installed 0.9.30 (2011-03-08), FPC 2.4.2 rev. 29749 (i386-win32-win32/win64) on another machine with Windows XP Prof. SP3,

32 Bit CPU? or 64 bit?

If 32, then please download latest GDB from
http://svn.freepascal.org/svn/lazarus/binaries (include libraries) and try with that.

It compiles, and runs OK, but for some reason at some point (when I press a key on my keyboard when caret is in a TMemo), the GDB bails out with Error: 31 (found in debug log) at which time Lazarus panics and pulls a plug...

I don't currently have my XP test environment ready, so I'll ask questions.

The 32 one must have some context (even if you can't see it currently (Signal, OS error, File-system error....)

The latest 0.9.31 (trunk / unstable snapshot) displays added info in the "oops debugger" message.
You might try the 0.9.30.1 (fixes branch / usually quite stable), though I am not sure it does have the extra info.

In any case, you do not need to upgrade, but you should at least run with --debug-log (NO need to recompile with the extra define) and also provide the output from the "debug output" window, as described on the wiki.

I did what http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips suggested, i.e. no -Xs, no -XX, no optimization or -O1.

With or without "dwarf (-gw)" ? Does dwarf make a difference (probably not).

Show quoted text 9 lines
I can replicate it with a small test project, this is so small it's pointless to write code here : - start a new project - put a TMemo on it - save&compile&run - click on the Memo1 when running - type any alphanumeric character on the keyboard -> GDB crashes, this time not even reporting an Error number.

Exact text, of the output of GDB or the Lazarus IDE?

Show quoted text 7 lines
Still googling for what the Error: 31 means. This does not happen on Lazarus 0.9.28.2 r22279 FPC 2.2.4 i386-win32-win32/win64. Shall I report to bugtracker ?

I would advice first to update gdb (or even try with the old gdb from 0.9.28), and also provide the info I indicated above.

Maybe it will be solved with the new gdb => which will already be part of the next Lazarus.
If not, reporting it as a bug, will raise the same questions...

Reply by email

Martin
to Lukasz Sokol: I shall mention: The other (XP Pro) machine is a laptop and on my project, (as opposed to…
Lukasz Sokol wrote 18 lines
I shall mention: The other (XP Pro) machine is a laptop and on my project, (as opposed to the test project, dunno why) the Error: 31 code appears just before line where one of the libraries is loaded : Error: 31=library-loaded,id="c:\\Program Files\\Apoint\\Apoint.dll" [snip rest of line] _________ ^ This does however /NOT/ appear when I run my test project, only the rest of the line; But I gather now, this may be due to spaces in the path of the DLL...? (the infamous Program Files...) The Apoint.dll is the part of the pointing device driver on this laptop so I guess disabling it is out of question...

I don't think it is the spaces in this case....
the text to google is "library load error 31", but doesn't get to much info either.

Some libraries do indeed "not behave" if run under gdb (I suspect some libraries do that intentionally others by accident), and if it is a library misbehaving, then there is nothing that can be fixed in the IDE.

The best approach is to try different versions of GDB => try the link I posted first, it has the latest released windows 32 bit gdb. Otherwise go to the mingw website, and find older gdb (I recommand to try 6.8.3 or 6.7.5 first, then any 7.x.x) those are known to work fine in Lazarus. Anything older I wouldn't try.

Another thing to try, is to disable (or if available try "game mode") your anti-virus solution. While I have not seen the specific case you reported, it is known that some AV solutions do interfere with gdb.

Reply by email

Martin
to Martin
Martin wrote 11 lines
On 22/09/2011 12:34, Lukasz Sokol wrote: > I shall mention: > > The other (XP Pro) machine is a laptop and on my project, (as opposed > to the > test project, dunno why) the Error: 31 code appears just before line > where > one of the libraries is loaded : I don't think it is the spaces in this case.... the text to google is "library load error 31", but doesn't get to much info either.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382%28v=vs.85%29.aspx

Reply by email

Lukasz Sokol
to Martin: 32 Bit CPU? or 64 bit? If 32, then please download latest GDB from…
Martin wrote 8 lines
On 22/09/2011 12:16, Lukasz Sokol wrote: > Hi, > > I have installed 0.9.30 (2011-03-08), FPC 2.4.2 rev. 29749 > (i386-win32-win32/win64) on another machine with Windows XP Prof. > SP3, 32 Bit CPU? or 64 bit?

32bit (Dell Lattitude D600 Intel(R) Pentium(R) M)

If 32, then please download latest GDB from http://svn.freepascal.org/svn/lazarus/binaries (include libraries) and try with that.

OK will try.

Show quoted text 36 lines
> It compiles, and runs OK, but for some reason at some point (when I > press a key on my keyboard when caret is in a TMemo), the GDB bails > out with Error: 31 (found in debug log) at which time Lazarus > panics and pulls a plug... I don't currently have my XP test environment ready, so I'll ask questions. The 32 one must have some context (even if you can't see it currently (Signal, OS error, File-system error....) The latest 0.9.31 (trunk / unstable snapshot) displays added info in the "oops debugger" message. You might try the 0.9.30.1 (fixes branch / usually quite stable), though I am not sure it does have the extra info. In any case, you do not need to upgrade, but you should at least run with --debug-log (NO need to recompile with the extra define) and also provide the output from the "debug output" window, as described on the wiki. > > I did what http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips > suggested, i.e. no -Xs, no -XX, no optimization or -O1. With or without "dwarf (-gw)" ? Does dwarf make a difference (probably not). > > I can replicate it with a small test project, this is so small it's > pointless to write code here : - start a new project - put a TMemo > on it - save&compile&run - click on the Memo1 when running - type > any alphanumeric character on the keyboard -> GDB crashes, this > time not even reporting an Error number. Exact text, of the output of GDB or the Lazarus IDE?

First the
gdb.exe <in title bar
gdb.exe has encountered a problem and needs to close(...) (OS communicates)
then

Debuger error

Ooops, the debugger entered the error state
Save your work now !

Hit Stop, and hope for the best, we're pullin the plug.

OK

---> lazarus window appears.

Excerpt from the log file (of the test project):

[TCompiler.Compile] end
TMainIDE.DoInitProjectRun ProgramFilename=C:\Products\test_project\testproject.exe[TCmdLineDebugger] Debug PID: 288 [Debugger] Running GDB version: GDB
[TDebugger.SetFileName] "C:\Products\test_project\testproject.exe" TGDBMIDebugger.StartDebugging WorkingDir="C:\Products\test_project\" TGDBMIDebugger.ProcessResult Error: ,msg="No symbol \"FPC_THREADVAR_RELOCATE_PROC\" in current context." [Debugger] Log output: &"info functions FPC_CPUINIT\n" [Debugger] Log output: &"set width 50000\n"
[Debugger] Log output: &"info address main\n"
[Debugger] Log output: &"ptype TObject\n"
[Debugger] Log output: &"info address FPC_RAISEEXCEPTION\n" [Debugger] Log output: &"info address FPC_BREAK_ERROR\n" [Debugger] Log output: &"info address FPC_RUNERROR\n" [Debugger] Log output: &"info file\n"
[Debugger] File type: pei-i386
[Debugger] Entry point: 0x521940
[Debugger] Log output: &"Function \"foo\" not defined.\n" [WARNING] Debugger: Unexpected async-record: =thread-group-started,id="i1",pid="2464" [Debugger] Log output: &"info program\n"
[Debugger] Target PID: 2464
PeekNamedPipe failed, GetLastError is 109
[TCmdLineDebugger.Getoutput] Error waiting
[TCmdLineDebugger.SendCmdLn] Unable to send <-gdb-exit>. No process running. PeekNamedPipe failed, GetLastError is 109
[TCmdLineDebugger.Getoutput] Error waiting
[WARNING] TGDBMIDebugger: ExecuteCommand "-gdb-exit" failed. LAZARUS END - cleaning up ...
[TCmdLineDebugger.SendCmdLn] Unable to send <-gdb-exit>. No process running. PeekNamedPipe failed, GetLastError is 109
[TCmdLineDebugger.Getoutput] Error waiting
[WARNING] TGDBMIDebugger: ExecuteCommand "-gdb-exit" failed.

Hope this helps ?

Lukasz

Reply by email

Lukasz Sokol
to Martin: http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382%28v=vs.85%29.aspx
Martin wrote 11 lines
On 22/09/2011 12:49, Martin wrote: > On 22/09/2011 12:34, Lukasz Sokol wrote: >> I shall mention: >> >> The other (XP Pro) machine is a laptop and on my project, (as opposed to the >> test project, dunno why) the Error: 31 code appears just before line where >> one of the libraries is loaded : > I don't think it is the spaces in this case.... > the text to google is "library load error 31", but doesn't get to much info either. http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382%28v=vs.85%29.aspx

No so it's not that.

(old joke)
Who the hell is General Failure and why is he reading my disk...? (/old joke)

Lukasz

Reply by email

Lukasz Sokol
to Lukasz Sokol: 32bit (Dell Lattitude D600 Intel(R) Pentium(R) M) OK will try. First the gdb.exe <in…

Ooops ommited this question:

Show quoted text 9 lines
On 22/09/2011 12:41, Martin wrote: > On 22/09/2011 12:16, Lukasz Sokol wrote: >> I did what http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips >> suggested, i.e. no -Xs, no -XX, no optimization or -O1. > With or without "dwarf (-gw)" ? Does dwarf make a difference > (probably not). > >>

I tried with all (-g, -gl, -gw) enabled.

Lukasz

Reply by email

Lukasz Sokol
to Lukasz Sokol

On 22/09/2011 13:09, Lukasz Sokol wrote:

With new GDB 7.3 (svn checkout then copy to c:\lazarus\mingw\bin : gdb.exe, libintf-8, libexpat-1 libiconv-2 (*.dll) is enough ?)

still the same happens.

Log output exactly the same (error 109 (broken pipe)).

Which revision of that binaries svn contains the gdb version 6.8 (2008) ?

Thank you for helping so far,
I hope this can be resolved...

Lukasz

(p.s. haven't tried to just copy the 6.8 gdb from one computer to the other, will try)

Reply by email

Lukasz Sokol
to Lukasz Sokol
Lukasz Sokol wrote
(p.s. haven't tried to just copy the 6.8 gdb from one computer to the other, will try)

Just tried that,

still the same. (copied only the gdb.exe, left the dll's as from svn)

Lukasz

Reply by email

Flávio Etrusco
to Lukasz Sokol
Lukasz Sokol wrote 10 lines
On 22/09/2011 13:39, Lukasz Sokol wrote: > (p.s. haven't tried to just copy the 6.8 gdb from one computer to the other, will try) > Just tried that, still the same. (copied only the gdb.exe, left the dll's as from svn) Lukasz
Error: 31=library-loaded,id="c:\\Program Files\\Apoint\\Apoint.dll" [snip rest of line]

I guess having the whole line might be of use. AFAICG (Google ;-) this DLL is part of touchpad driver (utility), is that right? Have you installed it recently? Is this a new Lazarus installation?

-Fl?vio

Reply by email

Lukasz Sokol
to Flávio Etrusco: I guess having the whole line might be of use. AFAICG (Google ;-) this DLL is part of…
Fl?vio Etrusco wrote 9 lines
> Error: 31=library-loaded,id="c:\\Program Files\\Apoint\\Apoint.dll" [snip rest of line] I guess having the whole line might be of use. AFAICG (Google ;-) this DLL is part of touchpad driver (utility), is that right? Have you installed it recently? Is this a new Lazarus installation? -Fl?vio

Yes it's a new installation, from installer provided on lazarus webpage :) And that driver is the vendor driver for touchpad (did I mention the system is a laptop?)

When using gdb 6.8 the =library-loaded line does not show in debug output...

When using gdb 7.3 again :

(last lines of debug output)
^running
*running,thread-id="all"
(gdb)
=library-loaded,id="C:\\WINDOWS\\system32\\msimg32.dll",target-name="C:\\WINDOWS\\system32\\msimg32.dll",host-name="C:\\WINDOWS\\system32\\msimg32.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\uxtheme.dll",target-name="C:\\WINDOWS\\system32\\uxtheme.dll",host-name="C:\\WINDOWS\\system32\\uxtheme.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\msctf.dll",target-name="C:\\WINDOWS\\system32\\msctf.dll",host-name="C:\\WINDOWS\\system32\\msctf.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\msctfime.ime",target-name="C:\\WINDOWS\\system32\\msctfime.ime",host-name="C:\\WINDOWS\\system32\\msctfime.ime",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\mpusbapi.dll",target-name="C:\\WINDOWS\\system32\\mpusbapi.dll",host-name="C:\\WINDOWS\\system32\\mpusbapi.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\setupapi.dll",target-name="C:\\WINDOWS\\system32\\setupapi.dll",host-name="C:\\WINDOWS\\system32\\setupapi.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\wintrust.dll",target-name="C:\\WINDOWS\\system32\\wintrust.dll",host-name="C:\\WINDOWS\\system32\\wintrust.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\crypt32.dll",target-name="C:\\WINDOWS\\system32\\crypt32.dll",host-name="C:\\WINDOWS\\system32\\crypt32.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\msasn1.dll",target-name="C:\\WINDOWS\\system32\\msasn1.dll",host-name="C:\\WINDOWS\\system32\\msasn1.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\imagehlp.dll",target-name="C:\\WINDOWS\\system32\\imagehlp.dll",host-name="C:\\WINDOWS\\system32\\imagehlp.dll",symbols-loaded="0",thread-group="i1" Error: 31=library-loaded,id="C:\\Program Files\\Apoint\\Apoint.dll",target-name="C:\\Program Files\\Apoint\\Apoint.dll",host-name="C:\\Program Files\\Apoint\\Apoint.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\comdlg32.dll",target-name="C:\\WINDOWS\\system32\\comdlg32.dll",host-name="C:\\WINDOWS\\system32\\comdlg32.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\Vxdif.dll",target-name="C:\\WINDOWS\\system32\\Vxdif.dll",host-name="C:\\WINDOWS\\system32\\Vxdif.dll",symbols-loaded="0",thread-group="i1"

Hope this helps....

Lukasz

Reply by email

Lukasz Sokol
to Flávio Etrusco: I guess having the whole line might be of use. AFAICG (Google ;-) this DLL is part of…
Fl?vio Etrusco wrote 9 lines
> Error: 31=library-loaded,id="c:\\Program Files\\Apoint\\Apoint.dll" [snip rest of line] I guess having the whole line might be of use. AFAICG (Google ;-) this DLL is part of touchpad driver (utility), is that right? Have you installed it recently? Is this a new Lazarus installation? -Fl?vio

It was /the/ culprit - I've uninstalled it and gdb does not crash any more...

(Hint: my laptop probably has a Synaptic touchpad... don't know who installed alps driver on it (I've inherited it))

Lukasz

Reply by email

Martin
to Lukasz Sokol: uninstalled the ALPS Touchpad driver... Now the gdb still spews error 31 but... on a…
Lukasz Sokol wrote 14 lines
Had a brainwave, uninstalled the ALPS Touchpad driver... Now the gdb still spews error 31 but... on a different library (c:\Program Files\Dell\QuickSet\dadkeyb.dll) AND DOES NOT bail out any more - continues to run seemingly with no problems as of yet. Thanks everybody ! :)

Good to hear.

The best is probably to check on the mingw site, if they have feedback/bugtracker.
But it may be a lot of work, they will need a lot of information...

Since it is resolved for you, i don't know if you want to go that way. And also, I would not be able to assist n that.

Reply by email

Lukasz Sokol
to Martin

On 22/09/2011 16:36, Martin wrote:
[...]

Show quoted text 9 lines
Good to hear. The best is probably to check on the mingw site, if they have feedback/bugtracker. But it may be a lot of work, they will need a lot of information... Since it is resolved for you, i don't know if you want to go that way. And also, I would not be able to assist n that.

And not sure if they take this seriously since it was my system's fault.

And since I'm not willing to reproduce this error again...

Thanks again, anyhoo ;)

Lukasz

Reply by email

Hans-Peter Diettrich
to Lukasz Sokol: Yes it's a new installation, from installer provided on lazarus webpage :) And that…
And that driver is the vendor driver for touchpad (did I mention the system is a laptop?)

I usually disble the touchpad, because it can get into the way when typing text on the keyboard. Perhaps the error results from an inadvertent touch of the touchpad, not from typing?

Can you reproduce the error by using the touchpad only, not typing?

DoDi

Reply by email

Lukasz Sokol
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 13 lines
Lukasz Sokol schrieb: > And that driver is the vendor driver for touchpad (did I mention > the system is a laptop?) I usually disble the touchpad, because it can get into the way when typing text on the keyboard. Perhaps the error results from an inadvertent touch of the touchpad, not from typing? Can you reproduce the error by using the touchpad only, not typing? DoDi

I have uninstalled this APoint ALPS driver completely, leaving it as the ordinary system ps2 mouse... no scrolling zones any more, but. I think now this must have been some weird interaction of components, because the gdb still does report error 31 on some other driver dll, (some native dell device driver) but does not crash any more.

Moreover if that was the touchpad only it would have happened when I moved mouse or clicked over the test application, supposedly ? But this was only happening when
1. I clicked into TMemo.
2. I typed one key on the keyboard.

If there was no TMemo on the form, nothing bad happened. If there was only a TButton i could click it, still nothing bad happened.

Thanks,

Lukasz

Reply by email

Martin
to Lukasz Sokol: Yes it's a new installation, from installer provided on lazarus webpage :) And that…
Lukasz Sokol wrote
O=library-loaded,id="C:\\WINDOWS\\system32\\msasn1.dll",target-name="C:\\WINDOWS\\system32\\msasn1.dll",host-name="C:\\WINDOWS\\system32\\msasn1.dll",symbols-loaded="0",thread-group="i1" =library-loaded,id="C:\\WINDOWS\\system32\\imagehlp.dll",target-name="C:\\WINDOWS\\system32\\imagehlp.dll",host-name="C:\\WINDOWS\\system32\\imagehlp.dll",symbols-loaded="0",thread-group="i1" Error: 31=library-loaded,id="C:\\Program Files\\Apoint\\Apoint.dll",target-name="C:\\Program Files\\Apoint\\Apoint.dll",host-name="C:\\Program Files\\Apoint\\Apoint.dll",symbols-loaded="0",thread-group="i1"

The error 31 may refer to the library above: imagehlp.dll. (Because the equal sign normally belongs at the start of a line)

It is probably not critical.

Since the apoint.ddl fixed the problem anyway, there is little point in investigating it any further. It would have required more info, with extra debug log, and special recompiled Lazarus.
But there is no point to that any more. Especially, since even with more info the only fix would probably have been to uninstall it.

Reply by email