Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

OpenMP + lambda capture = icc internal error

durocher__arnaud
Beginner
432 Views

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
Viet_H_Intel
Moderator
432 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
Reply