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

Internal access violation in compiler

Try this: struct X { int i; X(int i) : i(i) {} ~X() {} // This destructor causes access violation in Intel compiler while compiling. }; vector f() { // Causes access violation in Intel compiler, if // - X has a destructor, and // - explicit cast int to X is called. With implicit cast it works. // return { 1, 2 }; // Ok. return { X(1), X(2) }; // Access violation. } It will result in a compiler error saying "error : access violation". I use this version: Intel(R) C++ Intel(R) 64 Compiler XE for Intel(R) 64, version 14.0.3 Package ID: w_ccompxe_2013_sp1.3.202, the previous version had the same issue. Cheers, Martin

0 Kudos
12 Replies
Highlighted
Beginner
13 Views

Here is a better formatted version: [cpp] struct X { int i; X(int i) : i(i) {} ~X() {} // This destructor causes access violation in Intel compiler while compiling. }; vector<X> f() { // Causes access violation in Intel compiler, if // - X has a destructor, and // - explicit cast int to X is called. With implicit cast it works. // return { 1, 2 }; // Ok. return { X(1), X(2) }; // Access violation. } [/cpp]
0 Kudos
Highlighted
Black Belt
13 Views

 

Looks like internal compiler error.

 

0 Kudos
Highlighted
Black Belt
13 Views

@martin

Do you have Windows or Linux?

0 Kudos
Highlighted
Beginner
13 Views

Yes, this is the output:
1>------ Build started: Project: ng-gtest, Configuration: Release x64 ------
1>  InitializerListTest.cpp
1>General\InitializerListTest.cpp(57): error : access violation
1>    	return { X{1}, X{2} }; // Access violation.
1>    	       ^
1>  
1>  compilation aborted for General\InitializerListTest.cpp (code 4)
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
0 Kudos
Highlighted
Beginner
13 Views

Windows 7, x64.
0 Kudos
Highlighted
Black Belt
13 Views

 

Compiled and ran your test-case and got access violation.

Here is the output:


1>  stdafx.cpp
1>  IDZ_test111.cpp
1>IDZ_test111.cpp(16): error : access violation
1>        return{ X(1), X(2) };
1>        ^
1>  
1>  compilation aborted for IDZ_test1.cpp (code 4)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

0 Kudos
Highlighted
Black Belt
13 Views

Tried to run Visual Studio under windbg , but unfortunately cannot break on access violation exception.

0 Kudos
Highlighted
Black Belt
13 Views

Any response from Intel engineers?

0 Kudos
Highlighted
New Contributor I
13 Views

Hello Martin,

>icl /Qstd=c++0x /c /Od 515182u.cpp
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Ve
rsion 14.0.3.202 Build 20140422
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

515182u.cpp
515182u.cpp(12): error: vector is not a template
  vector<X> f()
  ^

515182u.cpp(24): error: too many initializer values
        return { X(1), X(2) }; // Access violation.
                       ^

compilation aborted for 515182u.cpp (code 2)

What's your visual studio's version? vs2012? and what's your compilation switches? Maybe vs2013 is the minimum VS version which fully support the C++11 initializer ,I will let you know after I upgraded to it.

 

Thank you.
--
QIAOMIN.Q
Intel Developer Support
Please participate in our redesigned community support web site:

User forums:                   http://software.intel.com/en-us/forums/

0 Kudos
Highlighted
Beginner
13 Views

Hi Qiaomin,

I use Visual Studio Premium 2013.

This is the output:

1>------ Build started: Project: ng-gtest, Configuration: Release x64 ------
1>  icl /Qvc12 "/Qlocation,link,D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64" /Zi /W3 /MP /O3 /Oi /Qip /Qftz -D __INTEL_COMPILER=1400 -D WIN32 -D NDEBUG -D _CONSOLE -D NG_EXPORTS -D NG_DLL_ID=1 -D USE_TBB_PARALLEL -D USE_TBB_RWLOCK -D NOMINMAX -D BOOST_FILESYSTEM_NO_DEPRECATED -D _WINDLL -D _SCL_SECURE_NO_WARNINGS -D BOOST_MULTI_INDEX_DISABLE_SERIALIZATION -D NOMINMAX -D _WINDLL -D _VARIADIC_MAX=10 -D _UNICODE -D UNICODE /EHsc /MD /GS /fp:precise /QxSSE3 /Zc:wchar_t /Zc:forScope /Qstd=c++11 /Qrestrict /Fo.\tmp\msvc_x64_ur\ /Fd.\tmp\msvc_x64_ur\vc120.pdb /TP General\InitializerListTest.cpp
1>  
1>  Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.3.202 Build 20140422
1>  Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.
1>  
1>  InitializerListTest.cpp
1>General\InitializerListTest.cpp(57): error : access violation
1>        return { X{1}, X{2} }; // Access violation.
1>               ^
1>  
1>  compilation aborted for General\InitializerListTest.cpp (code 4)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

0 Kudos
Highlighted
Black Belt
13 Views

@Qiaomin

I have VS 2013 and the same error description.

0 Kudos
Highlighted
New Contributor I
13 Views

This has been reproduced and the bug smells like a front-end compatability problem since /Od also caused failure and /E fine,I will reported to some developers to see any workaround for you and will get you posted whenever I got some updates.

 

Thank you.
--
QIAOMIN.Q
Intel Developer Support
Please participate in our redesigned community support web site:

User forums:                   http://software.intel.com/en-us/forums/

0 Kudos