[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#589755: marked as done (Segfaults/FPEs using -lc_p)



Your message dated Wed, 1 May 2019 13:42:33 +0200
with message-id <20190501114233.GA10305@aurel32.net>
and subject line libc6-prof has been removed in glibc 2.19-12
has caused the Debian Bug report #589755,
regarding Segfaults/FPEs using -lc_p
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
589755: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589755
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6-prof
Version: 2.7-18lenny4

Take the example program (example1) at

http://www.ibm.com/developerworks/library/l-gnuprof.html

(source appended at end for ease of reference).

ed@sagittarius:~/tmp$ gcc example.c -pg -o example -static-libgcc -lc_p
example.c: In function ‘main’:
example.c:27: warning: incompatible implicit declaration of built-in
function ‘exit’
ed@sagittarius:~/tmp$ ./example
Usage ./example <No of Iterations>
ed@sagittarius:~/tmp$ ./example 100
No of iterations = 100
ed@sagittarius:~/tmp$

Now try linking any other library, e.g. zlib (4 places in link order shown):

ed@sagittarius:~/tmp$ gcc example.c -pg -o example -static-libgcc -lc_p -lz
example.c: In function ‘main’:
example.c:27: warning: incompatible implicit declaration of built-in
function ‘exit’
ed@sagittarius:~/tmp$ ./example 100
Floating point exception
ed@sagittarius:~/tmp$

ed@sagittarius:~/tmp$ gcc example.c -pg -o example -lz -static-libgcc -lc_p
example.c: In function ‘main’:
example.c:27: warning: incompatible implicit declaration of built-in
function ‘exit’
ed@sagittarius:~/tmp$ ./example 100
Floating point exception
ed@sagittarius:~/tmp$

ed@sagittarius:~/tmp$ gcc example.c -pg -o example  -static-libgcc -lz -lc_p
example.c: In function ‘main’:
example.c:27: warning: incompatible implicit declaration of built-in
function ‘exit’
ed@sagittarius:~/tmp$ ./example 100
Floating point exception
ed@sagittarius:~/tmp$

ed@sagittarius:~/tmp$ gcc example.c -lz -pg -o example  -static-libgcc -lc_p
example.c: In function ‘main’:
example.c:27: warning: incompatible implicit declaration of built-in
function ‘exit’
ed@sagittarius:~/tmp$ ./example 100
Floating point exception

Now try specifying -static (e.g. there are many libraries in your program)

ed@sagittarius:~/tmp$ gcc example.c -pg -o example -static -static-libgcc -lc_p
example.c: In function ‘main’:
example.c:27: warning: incompatible implicit declaration of built-in
function ‘exit’
ed@sagittarius:~/tmp$ ./example 100
Segmentation fault

ed@sagittarius:~/tmp$ gcc example.c -pg -o example -static-libgcc -lc_p -static
example.c: In function ‘main’:
example.c:27: warning: incompatible implicit declaration of built-in
function ‘exit’
ed@sagittarius:~/tmp$ ./example 100
Segmentation fault

Thus it appears with this version you can only use -lc_p to debug
programs with no external dependencies, because you can't link other
libraries, and if you could, you still couldn't link them statically
to get proper gprof output.

I can't find any other reference to this behaviour; if it's just a
documentation problem, I'm happy to write the documentation if someone
tells me what the actual correct behaviour is (or necessary
limitations are).

Example program:

#include <stdio.h>

int a(void) {
  int i=0,g=0;
  while(i++<100000)
  {
     g+=i;
  }
  return g;
}
int b(void) {
  int i=0,g=0;
  while(i++<400000)
  {
    g+=i;
  }
  return g;
}

int main(int argc, char** argv)
{
   int iterations;

   if(argc != 2)
   {
      printf("Usage %s <No of Iterations>\n", argv[0]);
      exit(-1);
   }
   else
      iterations = atoi(argv[1]);

   printf("No of iterations = %d\n", iterations);

   while(iterations--)
   {
      a();
      b();
   }
}



--- End Message ---
--- Begin Message ---
Version: 2.19-12

libc6-prof has been removed in glibc 2.19-12, closing the corresponding
bugs.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

--- End Message ---

Reply to: