On 3/3/2010 5:26 AM, David Jacobs wrote:
When I add the -pg option to both compiler and linker I get the
following errors while executing my program:
(compilation and linking is fine)
--------------------
264 [main] TempLnrTransform 3568 _cygtls::handle_exceptions:
Exception: STATUS_ACCESS_VIOLATION
6953 [main] TempLnrTransform 3568 open_stackdumpfile: Dumping stack
trace to TempLnrTransform.exe.stackdump
947884 [main] TempLnrTransform 3568 _cygtls::handle_exceptions:
Exception: STATUS_ACCESS_VIOLATION
981347 [main] TempLnrTransform 3568 _cygtls::handle_exceptions: Error
while dumping state (probably corrupted stack)/
--------------------
/It seems the added functions of mcount are causing some problems?
The program runs fine without the -pg option.
You're getting well outside the area which is taken care of by gcc.
Threading and profiling libraries aren't part of gcc. Threading is flaky
enough in cygwin that there's a good chance the mcount isn't thread safe
or some other problem comes up which hasn't been tested. While the
situation may have improved, in the past I've submitted bugzillas about
how profiling cases in the gcc testsuite were set up with specific
options for various targets, giving the wrong options for cygwin, so
that the test could not give a useful result, and been told that
testsuite would not be corrected for this. I don't think there are
tests there which combine -pg and threads, in case that is what you are
doing. If it were possible to interest someone in this, you would need
to submit a small reproducer on a cygwin specific list.