Re: gcc 4.2 profiling breaks argv

From: Simias <simias.n_at_gmail.co>
Date: Sun, 05 Aug 2007 18:12:45 +0200
Niklas Sorensson <nik_at_cs.chalmers.se> writes:

> Hi,
>
> following up on the thread started by Nick Frampton yesterday:
>
> I can repeat the problem, although it looks slightly
> different. Instead of crashing when argv is accessed, both argc and
> argv are zero. This behavior is triggered by both gcc 4.2.0 and 4.2.1:
> [...]

I have an other problem with gprof on CURRENT, this time with c++:

===
$ cat test.cc
#include <iostream>

using namespace std;

int main()
{
  try {
    throw 1;
  } catch (int) {
    cout << "in catch" << endl;
  }
    cout << "after catch" << endl;
}
$ c++ test.cc && ./a.out
in catch
after catch
$ c++ -pg test.cc && ./a.out
Abort trap (core dumped)
$
===

I tried with different programs and it seems that it aborts on any
throw'd exception. If nothing is thrown however, the profiling seems to
work as expected.

$ uname -a
FreeBSD simias.hd.free.fr 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Tue Jul 10
15:39:06 CEST 2007
root_at_simias.hd.free.fr:/usr/obj/usr/src/sys/SIMKERNEL  i386
$ c++ -v
Using built-in specs.
Target: i386-undermydesk-freebsd
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 4.2.0 20070514 [FreeBSD]

-- 
Simias
Received on Sun Aug 05 2007 - 14:23:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:15 UTC