Discussion:
BacktraceStrFunc on linux x86_64?
Add Reply
Nikolai Zhubr
2017-05-01 08:13:39 UTC
Reply
Permalink
Raw Message
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.
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin
Michael Van Canneyt
2017-05-01 08:21:49 UTC
Reply
Permalink
Raw Message
Post by 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
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.
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-
Nikolai Zhubr
2017-05-01 08:40:06 UTC
Reply
Permalink
Raw Message
01.05.2017 11:21, Michael Van Canneyt:
[...]
Post by 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
Post by Michael Van Canneyt
home: >./st
Started...
Exception: $000000000046F571 CHECKINDEX, line 56 of
../objpas/classes/lists.inc
Done.
Michael.
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/ma
Florian Klämpfl
2017-05-01 08:46:50 UTC
Reply
Permalink
Raw Message
Post by Nikolai Zhubr
[...]
Post by 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.
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.

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinf
Nikolai Zhubr
2017-05-01 09:01:24 UTC
Reply
Permalink
Raw Message
01.05.2017 11:46, Florian Klämpfl:
[...]
Post by Florian Klämpfl
Post by Nikolai Zhubr
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
Post by Florian Klämpfl
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freep
Michael Van Canneyt
2017-05-01 09:36:50 UTC
Reply
Permalink
Raw Message
Post by Florian Klämpfl
[...]
Post by Florian Klämpfl
Post by Nikolai Zhubr
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
Post by Florian Klämpfl
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.
Florian Klaempfl
2017-05-01 09:54:40 UTC
Reply
Permalink
Raw Message
Post by Florian Klämpfl
[...]
Post by Florian Klämpfl
Post by Nikolai Zhubr
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
Post by Florian Klämpfl
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.
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 ...

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc
Bernd Mueller
2017-05-01 11:35:09 UTC
Reply
Permalink
Raw Message
Post by Michael Van Canneyt
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.

Regards, Bernd.

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-d
Nikolai Zhubr
2017-05-01 11:54:28 UTC
Reply
Permalink
Raw Message
Post by Bernd Mueller
Post by Michael Van Canneyt
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
Post by Bernd Mueller
Regards, Bernd.
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.fr
Mattias Gaertner
2017-06-17 08:29:14 UTC
Reply
Permalink
Raw Message
On Mon, 1 May 2017 10:46:50 +0200
Post by Florian Klämpfl
[...]
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.
Any news here?

Mattias
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mail

Marco van de Voort
2017-05-01 12:34:35 UTC
Reply
Permalink
Raw Message
Post by Bernd Mueller
Post by Michael Van Canneyt
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
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailma
Florian Klämpfl
2017-05-01 12:38:35 UTC
Reply
Permalink
Raw Message
Post by Marco van de Voort
Post by Bernd Mueller
Post by Michael Van Canneyt
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
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
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mai
Bernd Mueller
2017-05-08 08:35:08 UTC
Reply
Permalink
Raw Message
Post by Marco van de Voort
Post by Bernd Mueller
Post by Michael Van Canneyt
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.
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepa
Marco van de Voort
2017-05-01 13:10:35 UTC
Reply
Permalink
Raw Message
Post by Florian Klämpfl
Post by Marco van de Voort
bugreport has been merged, but there are still backtrace related fixes
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 ;-)
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/f
Marco van de Voort
2017-05-01 13:16:33 UTC
Reply
Permalink
Raw Message
Post by Marco van de Voort
Post by Florian Klämpfl
Post by Marco van de Voort
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.
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-d
Florian Klämpfl
2017-05-01 14:24:57 UTC
Reply
Permalink
Raw Message
Post by Marco van de Voort
Post by Marco van de Voort
Post by Florian Klämpfl
Post by Marco van de Voort
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
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.

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/m
Marco van de Voort
2017-05-01 15:10:06 UTC
Reply
Permalink
Raw Message
Post by Florian Klämpfl
URL
Just relocate the check out?
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


_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-dev
Florian Klämpfl
2017-05-01 15:14:01 UTC
Reply
Permalink
Raw Message
Post by Marco van de Voort
Post by Florian Klämpfl
URL
Just relocate the check out?
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?

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lis
Marco van de Voort
2017-05-08 09:55:59 UTC
Reply
Permalink
Raw Message
Post by Bernd Mueller
Post by Marco van de Voort
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.
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://
Loading...