Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
27 Views

OpenMP + lambda capture = icc internal error

C++ compiler 18.0.2 is crashing when using OpenMP and C++11 lambda capture.

Here is a minimial crashing example:

template < typename Function >
void call_1( const Function& f )
{
  f();
}

template < typename Function >
void call_2( const Function& f )
{
  f();
}

int main(int argc, char **argv)
{
    double count = 0;
    call_1([&count](){
        #pragma omp parallel
        call_2([&count](){});
      });
}

And here is the output:

$ icc --version
icc (ICC) 18.0.2 20180210
Copyright (C) 1985-2018 Intel Corporation.  All rights reserved.
$ icc -qopenmp main.cpp
": internal error: ** The compiler has encountered an unexpected problem.
** Segmentation violation signal raised. **
Access violation or stack overflow. Please contact Intel Support for assistance.

icc: error #10105: /opt/intel/compilers_and_libraries_2018.2.199/linux/bin/intel64/mcpcom: core dumped
icc: warning #10102: unknown signal(36194064)
icc: error #10106: Fatal error in /opt/intel/compilers_and_libraries_2018.2.199/linux/bin/intel64/mcpcom, terminated by unknown
compilation aborted for main.cpp (code 1)

Is this a known issue? Should i avoid using lambda capture with OpenMP?

0 Kudos
1 Reply
Moderator
27 Views

 

Thanks for report this problem. This seems to be a bug in compiler. I've reported it to our developer. The tracker number is: CMPLRS-50140.

Regards,

Viet

0 Kudos