Sign in Join

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

Mailing lists / lazarus / 2011-12

Lazarus strange behaviour

17 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Antonio Fortuny

Hi guys.

I've got a very strange behaviour while debugging a program with Lazarus: 0.9.31.31801, fpc 2.4.4.
(see print screen below)
Vista Win32
Made Windows update last week
At the same time I've new problems when launching services and threads which didn't happen before (some weeks ago)
Never had this before, and it appears with all dayly snapshots of Lazarus (up to and including 34263, fpc 2.5.1)

I have an installaion with Winserver 2003 64bit: it works perfectly.

Got any ideas?

Antonio.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/c565b230/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: jhjfahhe.png
Type: image/png
Size: 5530 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/c565b230/attachment.png>

Reply by email

Martin
to Antonio Fortuny
Antonio Fortuny wrote 18 lines
Hi guys. I've got a very strange behaviour while debugging a program with Lazarus: 0.9.31.31801, fpc 2.4.4. (see print screen below) Vista Win32 Made Windows update last week At the same time I've new problems when launching services and threads which didn't happen before (some weeks ago) Never had this before, and it appears with all dayly snapshots of Lazarus (up to and including 34263, fpc 2.5.1) I have an installaion with Winserver 2003 64bit: it works perfectly. Got any ideas?

The first thing to note is the breakpoint number -20 This means this is an gdb internal breakpoint, used in single stepping. (so the ide has little influence here)

Either something went corrupt in gdb or the debug info (for the code for which gdb tried to set the breakpoint ) is wrong
(does it work with fpc 2.5.1, afaik there were fixes)

- what was the last you did? step over/into/out? run?
- the content of the "debug output" window?
- gdb version?

Though most likely there will not be much useful info... -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/137b6ad3/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 5530 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/137b6ad3/attachment.png>

Reply by email

Martin
to Martin
Martin wrote 8 lines
On 19/12/2011 15:15, Antonio Fortuny wrote: > Hi guys. > > I've got a very strange behaviour while debugging a program with > Lazarus: 0.9.31.31801, fpc 2.4.4. > (see print screen below) > Vista Win32

the error below is on your 32 bit system?

Show quoted text 7 lines
> Made Windows update last week > At the same time I've new problems when launching services and > threads which didn't happen before (some weeks ago) > Never had this before, and it appears with all dayly snapshots of > Lazarus (up to and including 34263, fpc 2.5.1) > > I have an installaion with Winserver 2003 64bit: it works perfectly.

I thought 64 bit

Show quoted text 11 lines
> > > > Got any ideas? The first thing to note is the breakpoint number -20 This means this is an gdb internal breakpoint, used in single stepping. (so the ide has little influence here) Either something went corrupt in gdb or the debug info (for the code for which gdb tried to set the breakpoint ) is wrong

anyway the diagnosis stays the same.

Except for 32 bit the address looks wrong (but I am not 100% sure, use the disassembler to check where the rest of your code is

make sure your gdb is up to date 7.3

if it is not gdb then maybe fpc put in the wrong address... -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/18ec401d/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 5530 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/18ec401d/attachment-0001.png>

Reply by email

Antonio Fortuny
to Martin: The first thing to note is the breakpoint number -20 This means this is an gdb internal…

Le 19/12/2011 16:28, Martin a ?crit :

Show quoted text 9 lines
The first thing to note is the breakpoint number -20 This means this is an gdb internal breakpoint, used in single stepping. (so the ide has little influence here) Either something went corrupt in gdb or the debug info (for the code for which gdb tried to set the breakpoint ) is wrong (does it work with fpc 2.5.1, afaik there were fixes)

You should be aware that this error screen appears with EVERY new Lazarus installation whatever the build could be. This means fpc 2.4.4 and 2.5.1. I decided as welle to re-install my very last stable 2011-07-26 and the error is ALWAYS shown whether I use F7 or F8 after the debugger stops on a breakpoint. I relaize that I din't mention all steps:
1. build the project
2. set breakpoints
3. launch the programs within the IDE (F9)
4. the debuggers stops on the firs breakpoint. So far so good.
5. hit F7 (step into) :the debugger DOES nothing: nothing happens in any way.
6. hit F7 again: popup error message
7. same behaviour for all programs, for all Lazarus versions

I begin to suspect Vista once again.

Remember, on Win server 2003 64 bit

- what was the last you did? step over/into/out? run? - the content of the "debug output" window? - gdb version?

no output

Though most likely there will not be much useful info..

right
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/b01e358e/attachment.html>

Reply by email

Martin
to Antonio Fortuny
Antonio Fortuny wrote 28 lines
Le 19/12/2011 16:28, Martin a ?crit : > > The first thing to note is the breakpoint number -20 > This means this is an gdb internal breakpoint, used in single > stepping. (so the ide has little influence here) > > Either something went corrupt in gdb or the debug info (for the code > for which gdb tried to set the breakpoint ) is wrong > (does it work with fpc 2.5.1, afaik there were fixes) > You should be aware that this error screen appears with EVERY new Lazarus installation whatever the build could be. This means fpc 2.4.4 and 2.5.1. I decided as welle to re-install my very last stable 2011-07-26 and the error is ALWAYS shown whether I use F7 or F8 after the debugger stops on a breakpoint. I relaize that I din't mention all steps: 1. build the project 2. set breakpoints 3. launch the programs within the IDE (F9) 4. the debuggers stops on the firs breakpoint. So far so good. 5. hit F7 (step into) :the debugger DOES nothing: nothing happens in any way. 6. hit F7 again: popup error message 7. same behaviour for all programs, for all Lazarus versions I begin to suspect Vista once again.

- Are you using stabs or dwarf ? tproject options / linking )
- Any antivirus
- breakpoint / stepping in your own units or LCL ?

gdb version ?
http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/gdb/bin -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/c85bc300/attachment.html>

Reply by email

Antonio Fortuny
to Martin

Le 19/12/2011 16:57, Martin a ?crit :

Show quoted text 31 lines
On 19/12/2011 15:40, Antonio Fortuny wrote: > > > Le 19/12/2011 16:28, Martin a ?crit : >> >> The first thing to note is the breakpoint number -20 >> This means this is an gdb internal breakpoint, used in single >> stepping. (so the ide has little influence here) >> >> Either something went corrupt in gdb or the debug info (for the code >> for which gdb tried to set the breakpoint ) is wrong >> (does it work with fpc 2.5.1, afaik there were fixes) >> > You should be aware that this error screen appears with EVERY new > Lazarus installation whatever the build could be. This means fpc > 2.4.4 and 2.5.1. I decided as welle to re-install my very last stable > 2011-07-26 and the error is ALWAYS shown whether I use F7 or F8 after > the debugger stops on a breakpoint. I relaize that I din't mention > all steps: > 1. build the project > 2. set breakpoints > 3. launch the programs within the IDE (F9) > 4. the debuggers stops on the firs breakpoint. So far so good. > 5. hit F7 (step into) :the debugger DOES nothing: nothing happens in > any way. > 6. hit F7 again: popup error message > 7. same behaviour for all programs, for all Lazarus versions > > I begin to suspect Vista once again. - Are you using stabs or dwarf ? tproject options / linking )

no, gdb

- Any antivirus

yes F-Secure

- breakpoint / stepping in your own units or LCL ?

my units only

no version on D:\Programmes\lazarus\mingw\bin\gdb.exe (mingw ?) just a date:2010/11/26

But also do not forget it did work a few weeks ogo and under Win64 it still works.

Show quoted text 7 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/4b72b91d/attachment.html>

Reply by email

Martin
to Antonio Fortuny
Antonio Fortuny wrote 5 lines
Le 19/12/2011 16:57, Martin a ?crit : > On 19/12/2011 15:40, Antonio Fortuny wrote: >> I begin to suspect Vista once again.

I have vista 32 bit myself, with all updates applied

> - Are you using stabs or dwarf ? tproject options / linking ) no, gdb

stabs and dwarf are both supported by gdb. it's how fpc encodes debug info.

please see the linking tab
http://wiki.lazarus.freepascal.org/Debugger_Setup#Project_Options

You might also try specifying -Xe on the "Other" page

> - Any antivirus yes F-Secure

ok, no problem reports by others yet

commodo and bitdefender caused trouble in the past

Does it have a game mode? if so try that.

Show quoted text 8 lines
> - breakpoint / stepping in your own units or LCL ? my units only > > > gdb version ? > http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/gdb/bin no version on D:\Programmes\lazarus\mingw\bin\gdb.exe (mingw ?) just a date:2010/11/26

probably 7.2 (you can run gdb in cmd.exe)

try downloading the new one

But also do not forget it did work a few weeks ogo and under Win64 it still works.

yes, and it works on my ,32 too. But there are plenty of things that can go wrong

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/43c7ddc8/attachment.html>

Reply by email

Antonio Fortuny
to Martin

Thanks anyway Martin. Going back home for today.
I'll continue tomorrow.

Antonio.

Le 19/12/2011 17:24, Martin a ?crit :

Show quoted text 52 lines
On 19/12/2011 16:06, Antonio Fortuny wrote: > > > Le 19/12/2011 16:57, Martin a ?crit : >> On 19/12/2011 15:40, Antonio Fortuny wrote: >>> I begin to suspect Vista once again. I have vista 32 bit myself, with all updates applied >> - Are you using stabs or dwarf ? tproject options / linking ) > no, gdb stabs and dwarf are both supported by gdb. it's how fpc encodes debug info. please see the linking tab http://wiki.lazarus.freepascal.org/Debugger_Setup#Project_Options You might also try specifying -Xe on the "Other" page >> - Any antivirus > yes F-Secure ok, no problem reports by others yet commodo and bitdefender caused trouble in the past Does it have a game mode? if so try that. >> - breakpoint / stepping in your own units or LCL ? > my units only >> >> >> gdb version ? >> http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/gdb/bin > no version on D:\Programmes\lazarus\mingw\bin\gdb.exe (mingw ?) just > a date:2010/11/26 probably 7.2 (you can run gdb in cmd.exe) try downloading the new one > > But also do not forget it did work a few weeks ogo and under Win64 it > still works. yes, and it works on my ,32 too. But there are plenty of things that can go wrong -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111219/2dcda225/attachment-0001.html>

Reply by email

Antonio Fortuny
to Martin: I have vista 32 bit myself, with all updates applied stabs and dwarf are both supported…

I have uninstalled Lazarus.
I have deleted the user environment in
C:\Users\MyUserLogin\AppData\Local\lazarus\*
I have deleted the Lazarus directory
Enverithing looks clean
Installed "Lazarus-0.9.31-34263-fpc-2.5.1-20111219-win32.exe" Launch Lazarus
Got first basic IDE
Install 4 packages I need
Rebuild IDE
So far so good.
Make a new console project base on MyTroubleProject.lpr Change some project options: paths, dependencies, debugger (see print screen below), conditional defines, etc...
usual changes per project
Make the project to compile OK
It did compile.
prepare test data, some breakpoints and finally F9 run: Start ok and stop on first breakpoint: OK
hit F7 to step into function: nothing happens on first hit bue on the next one the error is displayed again again !!! >:o

every time I hit OK, same behaviour and error number decreases as well. -50, -52, -54 and so on, with the same address.

I leave everything as it is and I continue my job on a stable Win64. I need a Win32 version anyway

Antonio.

Reply by email

Martin
to Antonio Fortuny
Antonio Fortuny wrote 26 lines
I have uninstalled Lazarus. I have deleted the user environment in C:\Users\MyUserLogin\AppData\Local\lazarus\* I have deleted the Lazarus directory Enverithing looks clean Installed "Lazarus-0.9.31-34263-fpc-2.5.1-20111219-win32.exe" Launch Lazarus Got first basic IDE Install 4 packages I need Rebuild IDE So far so good. Make a new console project base on MyTroubleProject.lpr Change some project options: paths, dependencies, debugger (see print screen below), conditional defines, etc... usual changes per project Make the project to compile OK It did compile. prepare test data, some breakpoints and finally F9 run: Start ok and stop on first breakpoint: OK hit F7 to step into function: nothing happens on first hit bue on the next one the error is displayed again again !!! >:o every time I hit OK, same behaviour and error number decreases as well. -50, -52, -54 and so on, with the same address.

I don't think it is a problem with the installation.

Have you tried a simple form with 3 lines in an event?

Another Idea: is smart-linking off? It may well be that it works on 64bit, but that means nothing

before stepping open the dissasembler, and check what address to expect

Reply by email

Antonio Fortuny
to Martin

Le 20/12/2011 11:22, Martin a ?crit :

I don't think it is a problem with the installation. Have you tried a simple form with 3 lines in an event?

yep: it works !!
So, question: do you have an idea where to search for differences between the two projects ?
The old console program and this new one with GUI which works ?

Show quoted text 12 lines
Another Idea: is smart-linking off? It may well be that it works on 64bit, but that means nothing before stepping open the dissasembler, and check what address to expect -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Martin
to Antonio Fortuny: Le 20/12/2011 11:22, Martin a ?crit : yep: it works !! So, question: do you have an idea…
Antonio Fortuny wrote 11 lines
Le 20/12/2011 11:22, Martin a ?crit : > > I don't think it is a problem with the installation. > > Have you tried a simple form with 3 lines in an event? yep: it works !! So, question: do you have an idea where to search for differences between the two projects ? The old console program and this new one with GUI which works ?

The first steep I suggest would be to check my suspicion, that the address given in the error is indeed wrong
"Error accessing memory address 0x72aa47b8"

When reaching the breakpoint, before doing the fatal single step, please open the disassembler window.
Note the current address, as well as look for any jump. (or copy and paste around 20 lines of assembler and mail them)

* Also you have not confirmed, that smart linking is off ( 2nd green box http://wiki.lazarus.freepascal.org/Debugger_Setup#Project_Options , do a "build" ctrl-F9 afterwards)

* On the same page you have the dropdown for "choose debug type info" which defaults to "automatic" => try selecting "dwarf (with sets)" Do NOT use "dwarf 3"

* An other possibility, in the tree on the left select "Other" (3 below "linking"). It has a big input field "Custom Options". Enter -Xe

If none of that helps it may be necessary to look at your code.
- inline
- try except/finally
- external libraries (dll)
...

Reply by email

Antonio Fortuny
to Martin

Le 20/12/2011 14:27, Martin a ?crit :

Show quoted text 22 lines
On 20/12/2011 12:00, Antonio Fortuny wrote: > > > Le 20/12/2011 11:22, Martin a ?crit : >> >> I don't think it is a problem with the installation. >> >> Have you tried a simple form with 3 lines in an event? > yep: it works !! > So, question: do you have an idea where to search for differences > between the two projects ? > The old console program and this new one with GUI which works ? The first steep I suggest would be to check my suspicion, that the address given in the error is indeed wrong "Error accessing memory address 0x72aa47b8" When reaching the breakpoint, before doing the fatal single step, please open the disassembler window. Note the current address, as well as look for any jump. (or copy and paste around 20 lines of assembler and mail them)

00402EB6 895dd4 mov %ebx,-0x2c(%ebp) 00402EB9 e8e2a70000 call 0x40d6a0 <fpc_initializeunits> :-\ SyncFlat.lpr:36 SyncFlatDaemon := TSyncFlatDaemon.Create(nil); <<< instruction pointer 00402EBE ba54065d00 mov $0x5d0654,%edx 00402EC3 b900000000 mov $0x0,%ecx 00402EC8 b800000000 mov $0x0,%eax 00402ECD bb54065d00 mov $0x5d0654,%ebx 00402ED2 ff93c4000000 call *0xc4(%ebx) 00402ED8 a300606400 mov %eax,0x646000 SyncFlat.lpr:37 try
00402EDD 8d4df4 lea -0xc(%ebp),%ecx 00402EE0 8d55dc lea -0x24(%ebp),%edx 00402EE3 b801000000 mov $0x1,%eax 00402EE8 e8438e0000 call 0x40bd30 <fpc_pushexceptaddr> 00402EED e8beaf0000 call 0x40deb0 <fpc_setjmp> 00402EF2 50 push %eax
00402EF3 85c0 test %eax,%eax 00402EF5 0f85e3000000 jne 0x402fde <main+302> SyncFlat.lpr:39
SyncFlatDaemon.DataModuleAfterInstall(nil);
00402EFB a100606400 mov 0x646000,%eax 00402F00 ba00000000 mov $0x0,%edx 00402F05 e866740300 call 0x43a370
<TSYNCFLATDAEMON__DATAMODULEAFTERINSTALL>
SyncFlat.lpr:43 OK := False;
00402F0A c6051060640000 movb $0x0,0x646010 SyncFlat.lpr:44 SyncFlatDaemon.DataModuleStart(nil, OK); 00402F11 b910606400 mov $0x646010,%ecx 00402F16 a100606400 mov 0x646000,%eax 00402F1B ba00000000 mov $0x0,%edx 00402F20 e8db740300 call 0x43a400
<TSYNCFLATDAEMON__DATAMODULESTART>
SyncFlat.lpr:45 AddLog(0, 'Provide 10 secs for main thread to start', esInfo);
00402F25 6888130000 push $0x1388
00402F2A b900000000 mov $0x0,%ecx 00402F2F baf8895c00 mov $0x5c89f8,%edx 00402F34 b800000000 mov $0x0,%eax 00402F39 e8a25e0300 call 0x438de0 <ADDLOG> SyncFlat.lpr:46 Sleep(10000);

step into in assembler screen works: Create in line 36 is entered and step into continues until
I hit step over. The error screen appears immediately. But if I display the assembler screen again and hit step into it continues to work.

* Also you have not confirmed, that smart linking is off ( 2nd green box http://wiki.lazarus.freepascal.org/Debugger_Setup#Project_Options , do a "build" ctrl-F9 afterwards)

no -XX

* On the same page you have the dropdown for "choose debug type info" which defaults to "automatic" => try selecting "dwarf (with sets)" Do NOT use "dwarf 3"

ok, still the same

Show quoted text 11 lines
* An other possibility, in the tree on the left select "Other" (3 below "linking"). It has a big input field "Custom Options". Enter -Xe If none of that helps it may be necessary to look at your code. - inline - try except/finally - external libraries (dll) ...

Unfortunately I don't have time enough. I'll do the job with my Win2003 server x86_64 but I'll come back first week of next year. It has to work with W32 too.
Thank you very much for your effort anyway

Antonio.

Show quoted text 6 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Martin
to Antonio Fortuny
Antonio Fortuny wrote 22 lines
Le 20/12/2011 14:27, Martin a ?crit : > The first steep I suggest would be to check my suspicion, that the > address given in the error is indeed wrong > "Error accessing memory address 0x72aa47b8" > > When reaching the breakpoint, before doing the fatal single step, > please open the disassembler window. > Note the current address, as well as look for any jump. (or copy and > paste around 20 lines of assembler and mail them) > 00402EB6 895dd4 mov %ebx,-0x2c(%ebp) 00402EB9 e8e2a70000 call 0x40d6a0 <fpc_initializeunits> :-\ SyncFlat.lpr:36 SyncFlatDaemon := TSyncFlatDaemon.Create(nil); <<< instruction pointer 00402EBE ba54065d00 mov $0x5d0654,%edx 00402EC3 b900000000 mov $0x0,%ecx 00402EC8 b800000000 mov $0x0,%eax 00402ECD bb54065d00 mov $0x5d0654,%ebx 00402ED2 ff93c4000000 call *0xc4(%ebx) 00402ED8 a300606400 mov %eax,0x646000 SyncFlat.lpr:37 try

Is the constructor virtual? or do you use Interfaces ? "type TSyncFlatDaemon = class(TBase, SomeInterface)"

Show quoted text 5 lines
step into in assembler screen works: Create in line 36 is entered and step into continues until I hit step over. The error screen appears immediately. But if I display the assembler screen again and hit step into it continues to work.

That confirms my suspicion:
The address address 0x72aa47b8 is not at all in your exe.
- Either fpc wrote the wrong address
- the linker may have gotten it wrong
- gdb has a bug

If you step in the assembler window then it is single asm instr. stepping. GDB probably does this without the debug info. So it isn't affected

Unfortunately I don't have time enough. I'll do the job with my Win2003 server x86_64 but I'll come back first week of next year. It has to work with W32 too. Thank you very much for your effort anyway

Well I will be gone for a few days myself

Reply by email

Martin
to Martin
Martin wrote
Is the constructor virtual? or do you use Interfaces ? "type TSyncFlatDaemon = class(TBase, SomeInterface)"

If TSyncFlatDaemon is in a package that you installed then also open the package, and in the package window click he "Options" tool button, and check the debug settings on the linker tab.

Reply by email

Bernd
to Antonio Fortuny: Le 20/12/2011 14:27, Martin a ?crit : 00402EB6 895dd4 mov …

2011/12/20 Antonio Fortuny :

Show quoted text 5 lines
> * Also you have not confirmed, that smart linking is off ( 2nd green box > http://wiki.lazarus.freepascal.org/Debugger_Setup#Project_Options , do a > "build" ctrl-F9 afterwards) no -XX

Isn't smart linking on windows always on, even if you uncheck this box, or is this only my own (possibly a little messed up fpc.cfg) on my own windows installation?

(BTW: On Linux I cannot debug at all with smart linking on, but I also have a very old GDB there, but it seems smartlinking definitely sometimes can have the ability to disturb the debugger somehow).

Reply by email