Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ttsiod
Beginner
216 Views

internal error: assertion failed at: "shared/edgcpfe/lower_name.c", line 5641

I am using the Intel Compiler for Linux to compile a GPL 3D renderer, which is available here: (project page)

Unfortunately, I am getting...

../src/common/Light.cc(106): internal error: assertion failed at: "shared/edgcpfe/lower_name.c", line 5641

        #pragma omp parallel for private(lines, left, right)
                                                ^
compilation aborted for ../src/common/Light.cc (code 4)
The code is using OpenMP, and the compiler bug is "covered up" if instead of this code...
    void DrawTriangles(int iStartingTriangleIndex, int iOnePastEndingTriangleIndex) const
    {
        unsigned lines[SHADOWMAPSIZE];
        Vector3 left[SHADOWMAPSIZE];
        Vector3 right[SHADOWMAPSIZE];
#if defined(USE_OPENMP)
        #pragma omp parallel for private(lines, left, right)
#endif
        for(int j=iStartingTriangleIndex; j
... I use this code:
    void DrawTriangles(int iStartingTriangleIndex, int iOnePastEndingTriangleIndex) const
    {
        vector lines;
        vector       left;
        vector       right;
#if defined(USE_OPENMP)
        #pragma omp parallel for private(lines, left, right)
#endif
        for(int j=iStartingTriangleIndex; j
The details of my setup:
bash$ /opt/intel/Compiler/11.1/056/bin/ia32/icpc -V
Intel C++ Compiler Professional for applications running on IA-32, Version 11.1    Build 20090827 
Copyright (C) 1985-2009 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

bash$ uname -a
Linux home 2.6.31-ARCH #1 SMP PREEMPT Tue Oct 13 13:36:23 CEST 2009 i686 Intel Atom CPU 330 @ 1.60GHz GenuineIntel GNU/Linux
The machine is an Intel Atom 330 board, the D945GCLF2, in a barebones setup: just a keyboard and a monitor attached to it (working from a bootable USB drive).

The bug is 100% reproducible every time, and once I use "vector"s instead of normal arrays, the code compiles - and is 25% faster than the best results from GCC.

Still, this is obviously a bug - I hope the info above will be enough to unearth it.

P.S. If you want to skip reading the project page, just download the tarball directly from here.

0 Kudos
13 Replies
ttsiod
Beginner
216 Views

Quoting - ttsiod
I am using the Intel Compiler for Linux to compile a GPL 3D renderer, which is available here: (project page)

Unfortunately, I am getting...

../src/common/Light.cc(106): internal error: assertion failed at: "shared/edgcpfe/lower_name.c", line 5641

#pragma omp parallel for private(lines, left, right)
^
compilation aborted for ../src/common/Light.cc (code 4)
The code is using OpenMP, and the compiler bug is "covered up" if instead of this code...
    void DrawTriangles(int iStartingTriangleIndex, int iOnePastEndingTriangleIndex) const
{
unsigned lines[SHADOWMAPSIZE];
Vector3 left[SHADOWMAPSIZE];
Vector3 right[SHADOWMAPSIZE];
#if defined(USE_OPENMP)
#pragma omp parallel for private(lines, left, right)
#endif
for(int j=iStartingTriangleIndex; j ...
... I use this code:
    void DrawTriangles(int iStartingTriangleIndex, int iOnePastEndingTriangleIndex) const
{
vector lines;
vector left;
vector right;
#if defined(USE_OPENMP)
#pragma omp parallel for private(lines, left, right)
#endif
for(int j=iStartingTriangleIndex; j lines.resize(SHADOWMAPSIZE);
left.resize(SHADOWMAPSIZE);
right.resize(SHADOWMAPSIZE);
...
The details of my setup:
bash$ /opt/intel/Compiler/11.1/056/bin/ia32/icpc -V
Intel C++ Compiler Professional for applications running on IA-32, Version 11.1 Build 20090827
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY

bash$ uname -a
Linux home 2.6.31-ARCH #1 SMP PREEMPT Tue Oct 13 13:36:23 CEST 2009 i686 Intel Atom CPU 330 @ 1.60GHz GenuineIntel GNU/Linux
The machine is an Intel Atom 330 board, the D945GCLF2, in a barebones setup: just a keyboard and a monitor attached to it (working from a bootable USB drive).

The bug is 100% reproducible every time, and once I use "vector"s instead of normal arrays, the code compiles - and is 25% faster than the best results from GCC.

Still, this is obviously a bug - I hope the info above will be enough to unearth it.

P.S. If you want to skip reading the project page, just download the tarball directly from here.


I forgot to report the compilation options I am using - they are stored in the tarball's "contrib" directory, in the "build.using.IntelCC.and.OpenMP" script. I am basically using this command line:

icpc -ipo -I ../lib3ds-1.3.0/ -DUSE_LIB3DS -DUSE_OPENMP -D_REENTRANT -I. -I /usr/include/SDL/ -I ../src/common -DNDEBUG -pc32 -xHOST -no-prec-div -O3 -openmp -o renderer.intel.openmp -lSDL -lpthread ../src/renderer/renderer.cc ../src/common/*.cc -L ../lib3ds-1.3.0/lib3ds/.libs/ -l3ds


JenniferJ
Moderator
216 Views

Can you provide more details?

1. what is the shorter version of Vector3?
2. what is inside the loop?

Thanks,
Jennifer
ttsiod
Beginner
216 Views

Can you provide more details?

1. what is the shorter version of Vector3?
2. what is inside the loop?

Thanks,
Jennifer

1. Sure (although the complete code of the project is available at the links I provided, compileable successfully under any Linux variant I tried - Debian/Ubuntu/Arch, and even the BSDs).

[cpp](from src/common/Types.h)
typedef float coord;

struct Vector3
{
coord _x, _y, _z;

Vector3(coord x=0, coord y=0, coord z=0)
:
_x(x), _y(y), _z(z) {}

....
(more code follows)
[/cpp]


So, as you can see, Vector3 is a C++ struct.

2. That's far more complex to describe - you have to look at the code (from the tarball) yourself. It's a linear interpolation algorithm, that basically scan-converts 3-dimensional lines across a shadow buffer (these are terms from graphics theory, and their meaning is not important, at least not in the context of this bug report - what is important, is that the description of this algorithm in C++, triggers an assertion in ICPC, when used with the reported OpenMP/optimization options.

Hope this helps.

JenniferJ
Moderator
216 Views

Thank you!

I'm able to duplicate the issue (saw the exact error). I'll file a bug report to the compiler. If there's any work-around, I'll let you know.

Jennifer

cmd:
$ icpc -O3 -openmp -c t_err.cpp

t_err.cpp(16): internal error: assertion failed at: "shared/edgcpfe/lower_name.c", line 5641

#pragma omp parallel for private(lines, left, right)
^

compilation aborted for t_err.cpp (code 4)


The testcase: t_err.cpp
[cpp]#define SHADOWMAPSIZE 3000

struct Vector3   
{   
	float _x, _y;

	Vector3(float x=0, float y=0):
	_x(x), _y(y){} 
};

void DrawTriangles(float lines[SHADOWMAPSIZE])
{
    Vector3 left[SHADOWMAPSIZE];
    Vector3 right[SHADOWMAPSIZE];
    
#pragma omp parallel for private(lines, left, right)
    for(int j=0; j (less than) SHADOWMAPSIZE; j++) {
        lines = left._x + left._y + right._x + right._y;
    }
}
[/cpp]
ttsiod
Beginner
216 Views

Just to help a little bit more in reproducing the bug on your own Linux machines:

From a Linux machine that has both
- the Intel C++ compiler and
- libSDL installed (http://www.libsdl.org/, available in most Linux distros as libsdl1.2-dev or something similar)

With these two, the following steps deterministically reproduce the error:

bash$ wget http://users.softlab.ntua.gr/~ttsiod/renderer-2.0n.tar.bz2
bash$ tar jxf renderer-2.0n.tar.bz2
bash$ cd renderer-2.0n
bash$ CXX=/path/to/your/icpc ./configure
bash$ make
...
Light.cc(103): internal error: assertion failed at: "shared/edgcpfe/lower_name.c", line 5641
#pragma omp parallel for private(lines, left, right)
make[2]: *** [libcommon_a-Light.o] Error 4
make[2]: Leaving directory `/var/tmp/renderer-2.0n/src/common'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/renderer-2.0n/src/common'
make: *** [all-recursive] Error 1


You will see the build process fail, with the assertion message I originally posted.
I hope this deterministic "recipe" for reproducing the error makes it eligible for a ticket...

Kind regards,
Thanassis Tsiodras, Dr.-Ing.

ttsiod
Beginner
216 Views

Thanks, Jennifer.

Do I need to periodically poll this page, or is there are any other mechanism I can use to learn about any relevant progress? Simple posts to my account's e-mail would be just fine, btw - sorry if this is a FAQ, I am a newbie in terms of bug reporting to Intel...
JenniferJ
Moderator
216 Views

Quoting - ttsiod
Do I need to periodically poll this page, or is there are any other mechanism I can use to learn about any relevant progress?
You can subscribe to this thread.
On top of this thread, there's a drop-down "Thread Tools". Click on it and select "Subscribe to this thread".

Then when there's any posting to this thread, you'll be notified by email.

Jennifer
JenniferJ
Moderator
216 Views


Update to this issue.

One work aroud: Instead of using default parameter values, explicitly define the constructors like below works.
[cpp]struct Vector3
{
        float _x, _y;
#ifdef _GOOD
        Vector3(float x, float y): _x(x), _y(y){}
        Vector3(float x):_x(x), _y(0){}
        Vector3(): _x(0), _y(0){}
#else
        Vector3(float x=0, float y=0): _x(x), _y(y){}
#endif
};
[/cpp]

ttsiod
Beginner
216 Views

Thanks, Jennifer - much appreciated.
Matthieu_Brucher
Beginner
216 Views

Hi,

What is the status of this issue?
I have another issue when I integrated lambda inside my code. I didn't find the time to make a small example, because the original code is too big, but the final error is the following one :

internal error: assertion failed at: "shared/edgcpfe/lower_name.c", line 4265

Is this another issue or can they be related?
speedninja
Beginner
216 Views

Hi,
I am seeing this issue as well. What is the status of this issue? Should we create a new thread?
/usr/local/boost/1.44/include/boost/mpl/aux_/preprocessed/plain/vector.hpp(313): internal error: assertion failed at: "shared/edgcpfe/lower_name.c", line 4265
Intel C++ Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cproc_p_11.1.072
JenniferJ
Moderator
216 Views

Hello,
The original issue is fixed in the 11.1 update 4 and newer, the pkg id for updatne4 is 11.1.064.

The similar error you saw with 11.1.072 is a different error.

Please start a different thread width a test case. Use private response if prefer for the testcase.

thanks,
Jennifer
speedninja
Beginner
216 Views

By the way, I figured it out. The compiler was getting confused on a template which was in an inherited class.

The compiler was getting tripped on the parsing. I used the "template" keyword to give a hint to the compiler so that it wouldn't parse it as a less than sign.

After that, it worked.
Reply