Sign in Join

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

Mailing lists / fpc-devel / 2017-05

BacktraceStrFunc on linux x86_64?

19 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Nikolai Zhubr

Hello all,

I'm having some trouble to get BacktraceStrFunc to find line numbers. This is with fpc 3.0.0 on linux x86_64 (Centos 7 if it matters). If I compile the following example with

#fpc -gl tt.pas

I only get this output:

Started...
Exception: $0000000000455540
Done.

Evidently line info is somehow not present here.
Am I doing smth wrong or maybe lineinfo is not yet implemented for x86_64?

Thank you,
Nikolai
============================================================== program tt; {$mode delphi }

uses SysUtils, Classes;
procedure Test3;
var list: TList;
begin
   list := TList.Create;
   if list[10] = nil then
     writeln('Wow?');
end;
procedure Test2;
begin
   Test3;
end;
procedure Test;
begin
   writeln('Started...');
   try
     Test2;
   except
     writeln('Exception: ', BackTraceStrFunc(ExceptAddr));
   end;
   writeln('Done.');
end;
begin
   Test;
end.

Reply by email

Michael Van Canneyt
to Nikolai Zhubr
Nikolai Zhubr wrote 16 lines
Hello all, I'm having some trouble to get BacktraceStrFunc to find line numbers. This is with fpc 3.0.0 on linux x86_64 (Centos 7 if it matters). If I compile the following example with #fpc -gl tt.pas I only get this output: Started... Exception: $0000000000455540 Done. Evidently line info is somehow not present here. Am I doing smth wrong or maybe lineinfo is not yet implemented for x86_64?

No, but the units that we distribute do not have debug information included. So if the error is in the RTL, then there is no debug information.

If I run your program with a RTL compiled with debug info, I get:

home: >./st
Started...
Exception: $000000000046F571 CHECKINDEX, line 56 of ../objpas/classes/lists.inc Done.

Michael.

Reply by email

Nikolai Zhubr
to Michael Van Canneyt

01.05.2017 11:21, Michael Van Canneyt:
[...]

No, but the units that we distribute do not have debug information included. So if the error is in the RTL, then there is no debug information.

Ok, right, but then I suppose it should show line number as soon as the example is modified like this:

procedure Test3;
var a, b: integer;
begin
   a := 1; b := 0;
   writeln(a/b);
end;

And I'm still getting just an address anyway...

Thank you,
Nikolai

Show quoted text 13 lines
If I run your program with a RTL compiled with debug info, I get: home: >./st Started... Exception: $000000000046F571 CHECKINDEX, line 56 of ../objpas/classes/lists.inc Done. Michael. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Florian Klämpfl
to Nikolai Zhubr
Nikolai Zhubr wrote 16 lines
01.05.2017 11:21, Michael Van Canneyt: [...] > No, but the units that we distribute do not have debug information > included. > So if the error is in the RTL, then there is no debug information. Ok, right, but then I suppose it should show line number as soon as the example is modified like this: procedure Test3; var a, b: integer; begin a := 1; b := 0; writeln(a/b); end; And I'm still getting just an address anyway...

3.0.x is broken in this regard (stack back trace on x86-64 elf targets), see other threads on the fpc mailing lists regarding this. This is why we discussing a quick as possibile 3.0.4 release.

Reply by email

Nikolai Zhubr
to Florian Klämpfl

01.05.2017 11:46, Florian Klämpfl:
[...]

Show quoted text 5 lines
> And I'm still getting just an address anyway... 3.0.x is broken in this regard (stack back trace on x86-64 elf targets), see other threads on the fpc mailing lists regarding this. This is why we discussing a quick as possibile 3.0.4 release.

Ah, ok. Couldn't find any mentions of the issue (bad googling or whatever) but anyway I'll probably have to wait for 3.0.4 then.

Thank you,
Nikolai

_______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Michael Van Canneyt
to Nikolai Zhubr
Nikolai Zhubr wrote 12 lines
01.05.2017 11:46, Florian Klämpfl: [...] >> And I'm still getting just an address anyway... > > > 3.0.x is broken in this regard (stack back trace on x86-64 elf targets), see other threads on the > fpc mailing lists regarding this. This is why we discussing a quick as possibile 3.0.4 release. Ah, ok. Couldn't find any mentions of the issue (bad googling or whatever) but anyway I'll probably have to wait for 3.0.4 then.

You don't need to wait:

Only 3.0.2 linux for i386 CPU has the problem. 64-bit is OK. And 3.0.0 is OK in this aspect for all platforms.

So you can continue to work.

Michael.

Reply by email

Florian Klaempfl
to Michael Van Canneyt
Michael Van Canneyt wrote 23 lines
On Mon, 1 May 2017, Nikolai Zhubr wrote: > 01.05.2017 11:46, Florian Klämpfl: > [...] >>> And I'm still getting just an address anyway... >> >> >> 3.0.x is broken in this regard (stack back trace on x86-64 elf targets), > see other threads on the >> fpc mailing lists regarding this. This is why we discussing a quick as > possibile 3.0.4 release. > > Ah, ok. Couldn't find any mentions of the issue (bad googling or > whatever) but anyway I'll probably have to wait for 3.0.4 then. You don't need to wait: Only 3.0.2 linux for i386 CPU has the problem. 64-bit is OK. And 3.0.0 is OK in this aspect for all platforms. So you can continue to work.

OPs, sorry, then I was wrong. I thought x86-64 elf is affected ...

Reply by email

Nikolai Zhubr
to Bernd Mueller

01.05.2017 14:35, Bernd Mueller:

Show quoted text 6 lines
On 05/01/2017 11:36 AM, Michael Van Canneyt wrote: > > Only 3.0.2 linux for i386 CPU has the problem. 64-bit is OK. hmm, I don't get the lineinfo on x86-64 (Ubuntu 16.04/Mate, 64-Bit). armel and armhf are affected too.

Personally, for now I'll stick to 2.6.4 -- it works as expected at least on x86_64 linux here.

Besides, I've found my own mistake: when building an rpm package (with pascal program in this case), by default rpmbuild would choose to automagically strip the resulting binaries too much so this behaviour has to be suppressed (E.g. by __os_install_post %{nil} or whatever)

Thank you,
Nikolai

Show quoted text 6 lines
Regards, Bernd. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Marco van de Voort
to Bernd Mueller: hmm, I don't get the lineinfo on x86-64 (Ubuntu 16.04/Mate, 64-Bit). armel and armhf are…

In our previous episode, Bernd Mueller said:

> Only 3.0.2 linux for i386 CPU has the problem. 64-bit is OK. hmm, I don't get the lineinfo on x86-64 (Ubuntu 16.04/Mate, 64-Bit). armel and armhf are affected too.

Please test with the fixes branches. The series of revisions in the bugreport has been merged, but there are still backtrace related fixes unmerged:

http://www.stack.nl/~marcov/mergelogs26/backtrace.txt

Reply by email

Florian Klämpfl
to Marco van de Voort
Marco van de Voort wrote 11 lines
In our previous episode, Bernd Mueller said: >> Only 3.0.2 linux for i386 CPU has the problem. 64-bit is OK. > > hmm, I don't get the lineinfo on x86-64 (Ubuntu 16.04/Mate, 64-Bit). > armel and armhf are affected too. Please test with the fixes branches. The series of revisions in the bugreport has been merged, but there are still backtrace related fixes unmerged: http://www.stack.nl/~marcov/mergelogs26/backtrace.txt

BTW: Could you extend your scripts to include links for the revs to ViewVC? Pattern is: https://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=35495

Reply by email

Marco van de Voort
to Marco van de Voort

In our previous episode, Marco van de Voort said:

Show quoted text 6 lines
> > http://www.stack.nl/~marcov/mergelogs26/backtrace.txt > > BTW: Could you extend your scripts to include links for the revs to ViewVC? > Pattern is: https://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=35495 I tried, and it is now totally fubarred ;-)

I guess it is something with the apache https changes also working for svn now.

Redirecting
to
URL
'https://svn.freepascal.org/svn/fpc/branches/fixes_3_0':

which messes with my program.

Reply by email

Florian Klämpfl
to Marco van de Voort
Marco van de Voort wrote 15 lines
In our previous episode, Marco van de Voort said: >>> http://www.stack.nl/~marcov/mergelogs26/backtrace.txt >> >> BTW: Could you extend your scripts to include links for the revs to ViewVC? >> Pattern is: https://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=35495 > > I tried, and it is now totally fubarred ;-) I guess it is something with the apache https changes also working for svn now. Redirecting to URL 'https://svn.freepascal.org/svn/fpc/branches/fixes_3_0':

Just relocate the check out?

For people using git-svn, the section 'General Case' here: https://git.wiki.kernel.org/index.php/GitSvnSwitch should help.

Reply by email

Marco van de Voort
to Florian Klämpfl

In our previous episode, Florian Kl?mpfl said:

Show quoted text 7 lines
> URL > 'https://svn.freepascal.org/svn/fpc/branches/fixes_3_0': Just relocate the check out? For people using git-svn, the section 'General Case' here: https://git.wiki.kernel.org/index.php/GitSvnSwitch should help.

I already fixed it immediately after the last msg, without coding even, since the urls were in an ini file. It was just confusing that I recompiled the app with minor mods after a long time, and it bombed. Then you don't immediately expect a server config change :-)

The viewvc revs are also live. Clicking on them might be a bit hard though (depending on browser) because the javascript fold old out code is also active on that part of the line. JS is not my forte.

http://www.stack.nl/~marcov/mergelogs26/backtrace.html

Reply by email

Florian Klämpfl
to Marco van de Voort
Marco van de Voort wrote 19 lines
In our previous episode, Florian Kl?mpfl said: >> URL >> 'https://svn.freepascal.org/svn/fpc/branches/fixes_3_0': > > Just relocate the check out? > > For people using git-svn, the section 'General Case' here: > https://git.wiki.kernel.org/index.php/GitSvnSwitch should help. I already fixed it immediately after the last msg, without coding even, since the urls were in an ini file. It was just confusing that I recompiled the app with minor mods after a long time, and it bombed. Then you don't immediately expect a server config change :-) The viewvc revs are also live. Clicking on them might be a bit hard though (depending on browser) because the javascript fold old out code is also active on that part of the line. JS is not my forte. http://www.stack.nl/~marcov/mergelogs26/backtrace.html

Nice :)

Mine should probably not be merged, but maybe r33038 and most likely r35886?

Reply by email

Bernd Mueller
to Marco van de Voort: In our previous episode, Bernd Mueller said: Please test with the fixes branches. The…
Marco van de Voort wrote 7 lines
In our previous episode, Bernd Mueller said: >> Only 3.0.2 linux for i386 CPU has the problem. 64-bit is OK. > > hmm, I don't get the lineinfo on x86-64 (Ubuntu 16.04/Mate, 64-Bit). > armel and armhf are affected too. Please test with the fixes branches.

I tested yesterdays fixes branch and it worked for me now.

Regards, Bernd.

Reply by email

Marco van de Voort
to Bernd Mueller

In our previous episode, Bernd Mueller said:

> Please test with the fixes branches. I tested yesterdays fixes branch and it worked for me now.

Good. Most mass merging now have been done. Some dots-on-i and a rereading of various threads for unmerged requests still have to be done.

Reply by email