clBuildProgram crashes

99 err = clBuildProgram(clProgram[0], 0, NULL, NULL, NULL, NULL);
(gdb)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000028
0x0000000111af5bac in clhFenceEnqueue ()

This kernel causes the above message:


for( ... )
{
  // Do work
}

This kernel does not


for(...)
{
  // Do work
  break;
}

Why would a break statement (lack of) cause the build to segfault?

Good 'ol “make a backup copy and start deleting” debugging…

It looks like I have an issue with:


for (...)
{
  if ( ... )
  {
    break;
  }

  if ( ... )
  {
    break;
  }
}

but not


for (...)
{
  if ( ... )
  {
    break;
  }

  if ( ... )
  {
   
  }
}

Does this look like a parsing bug in Apple’s implementation or am I abusing nested breaks illegally?

If you are running into this problem on Mac OS X 10.6, can you file a bug with appropriate test case that shows this problem.