Adding -pg to generate GNU Profiler gprof profiling data cause access violation
Original Reporter info from Mantis: zamronypj @zamronypj
-
Reporter name: Zamrony P. Juhara
Original Reporter info from Mantis: zamronypj @zamronypj
- Reporter name: Zamrony P. Juhara
Description:
Compiling simple program with -pg option cause access violation and profiling data not generated properly.
Steps to reproduce:
- Create simple application, for example
program hello;
begin
writeln('hello');
end.
- Compile with -pg option
$ fpc -pg hello.pas
Free Pascal Compiler version 3.0.4 [2017/10/03] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling hello.pas
Linking hello
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
4 lines compiled, 0.1 sec
- Run application
$ ./hello
hello
Runtime error 216 at $00007F9D7D07BEE9
$00007F9D7D07BEE9
$00007F9D7D07C58A
- Execute GNU Profiler output nothing
$ gprof hello
Additional information:
$ gprof -v
GNU gprof (GNU Binutils for Ubuntu) 2.26.1
Based on BSD gprof, copyright 1983 Regents of the University of California.
This program is free software. This program has absolutely no warranty.
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
$ uname -r
4.4.0-171-generic
Mantis conversion info:
- Mantis ID: 36591
- OS: Ubuntu
- OS Build: 16.04 LTS 64-bit
- Build: [2017/10/03] for x86_64
- Platform: Linux
- Version: 3.0.4
- Fixed in version: 3.2.0