[Bug 60912] New: Profiling broken for optimized shared library projects

Craig Scott craig.scott at csiro.au
Tue Jul 8 12:42:05 UTC 2003


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=60912     
           Summary: Profiling broken for optimized shared library projects
           Product: kdevelop
           Version: 2.1.3
          Platform: RedHat RPMs
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kdevelop-devel at kdevelop.org
        ReportedBy: craig.scott at csiro.au


Version:           2.1.3 (using KDE KDE 3.1KDE 1.2)
Installed from:    RedHat RPMsRedHat RPMs
Compiler:          gcc 3.2 
OS:          Linux

Not sure if this is a KDevelop, libtool or gcc problem. I'll describe the steps to reproducing the bug and let you decide.

Start by creating a new terminal C++ project with the project wizard. Accept all default options. This will create a project with main.cpp as the only source file.

Add a new file called mylib.cpp in a subdirectory called "MyLibDir" below the main source directory. KDevelop asks for the library type - select shared library and accept defaults.

Add a second new file called wastetime.cpp in a subdirectory called "MyLibDir/WasteTime" and again select shared library with defaults.

Contents of mylib.cpp:

#include <iostream>

void WasteTime();
void RunLibTest()
{
  for (int i = 0; i<1000; ++i)
    WasteTime();
  std::cout << "Lib output" << std::endl;
}


Contents of wastetime.cpp:

void WasteTime()
{
  for (int i = 0; i<1000; ++i) ;
}


Contents of main.cpp:

void WasteTime();
void RunLibTest();
int main(int, char)
{
  for (int i = 0; i<1000; ++i)
    WasteTime();
  for (int i = 0; i<10; ++i)
    RunLibTest();
  return 0;
}



Now compile and run the project. Everything works fine.
Turn on profiling, rebuild and run. Again, the program runs to completion. Now, turn on optimizations, rebuild and run. The program exits with a core dump before anything is written to the terminal.

If this is a KDevelop bug, maybe some paths or libraries are being incorrectly set? My guess is that this is a libtool bug though. It might be good to understand this and see if it also appears in Gideon.




More information about the KDevelop-devel mailing list