Bug 66689

Summary: OpenCL crashes when compiled with -fomit-frame-pointer
Product: [Retired] Red Hat Linux Reporter: Jack Lloyd <lloyd>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-02 20:59:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jack Lloyd 2002-06-13 17:56:37 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc1) Gecko/20020417

Description of problem:
OpenCL 0.8.3 (not shipped with RH; see http://opencl.sourceforge.net) will crash
if compiled with GCC 2.96 as shipped with either RedHat 7.2 or 7.3. It does work
with the 2.96 installed in Mandrake 8.0, which implies something probably broke
between whenever Mandrake forked off you guys (I'm guessing around 7.1) and 7.2.
All applications using OpenCL will also crash with SIGSEGV or a bad exception throw.

It will only crash if compiled with -fomit-frame-pointer (which is the default).
Removing this flag and recompiling results in a good build.

I have observed this on 7.3, and users have seen it on 7.2 as well.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Download/unpack OpenCL.
2. Compile and run the validation tests with:
     ./configure.pl gcc-linux-i686
     make check


Actual Results:  After the build, the check application will crash either with a
SIGSEGV or (what looks like) a bad exception if you run either the validation
suite or the benchmarks.

Expected Results:  It should run through, as it does when compiled without
-fomit-frame-pointer.

Additional info:

I have not seen this with gcc 3.0.4 or gcc 3.1

This also did not happen with OpenCL 0.8.2. Sadly, the changes between 0.8.2 and
0.8.3 are substantial, so that may not be particularly helpful. Of course,
-fomit-frame-pointer implies that you can't debug very well, so this is going to
be a real pain to track down, I suspect.

This program (sent to me by a user) is a simpler example than the check program.
When linked against a libopencl that was compiled with -fomit-frame-pointer, it
won't work (crashes):

#include <opencl/opencl.h>
#include <opencl/randpool.h>

int main() {
  try {
     OpenCL::LibraryInitializer opencl_init;
     OpenCL::Randpool rndPool;
  } catch(OpenCL::Exception& e) {
     std::cerr << "Caught exception from OpenCL" << std::endl;
  }
  return 0;
}

Comment 1 Richard Henderson 2004-10-02 20:59:51 UTC
If it's known to work with 3.0.4 and 3.1, it likely works with 
current releases.