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

Segfault in icc when building HDF4

Ben3
Beginner
623 Views

Hi,

I'm building the HDF4 library (version 4.2.10) and am encountering a segfault in icc 15.0.0.090 while compiling one file in particular:

/bin/sh ../../libtool --tag=CC   --mode=compile icc -DHAVE_CONFIG_H -I.   -DBIG_LONGS -DSWAP   -O3 -ip -xHost -fPIC -O -MT dfconv.lo -MD -MP -MF .deps/dfconv.Tpo -c -o dfconv.lo dfconv.c
libtool: compile:  icc -DHAVE_CONFIG_H -I. -DBIG_LONGS -DSWAP -O3 -ip -xHost -fPIC -O -MT dfconv.lo -MD -MP -MF .deps/dfconv.Tpo -c dfconv.c  -fPIC -DPIC -o .libs/dfconv.o
": internal error: ** segmentation violation signal raised **
Access violation or stack overflow. Please contact Support.

compilation aborted for dfconv.c (code 4)

I can work around it by either turning off optimisation for that file using -O0 or using an earlier version of the compiler (14.3.174). Since I can workaround it, I didn't feel like digging through the source to find what was causing it, but since it's an ICE if you want to investigate it it's <basedir>/hdf/src/dfconv.c.

This is the version of icc that has the problem:

13:36 bjm900@raijin5 ~ > icc -V       
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.090 Build 20140723
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

And this is the version that doesn't:

13:37 bjm900@raijin5 ~ > icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.3.174 Build 20140422
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

Cheers,
Ben

0 Kudos
1 Solution
Shenghong_G_Intel
622 Views

@Ben,

FYI. This issue is fixed in our mainline already. I have verified with the nightly build.

Thanks,

Shenghong

View solution in original post

0 Kudos
6 Replies
Shenghong_G_Intel
622 Views

Hi Ben,

Thank you for reporting your issue here, I can reproduce your issue. The issue occurs when ICC is trying to optimize the routine DFKNTsize. I wil track the issue and ask dev team to fix in future versions.

Thanks,

Shenghong

0 Kudos
Bernard
Valued Contributor I
622 Views

As a side note it seems that ICC is handling its ICE without relying on OS to collect dump file.

0 Kudos
Shenghong_G_Intel
622 Views

Take a look at the source code, the function is really easy, it just contains some "switch/case" for a int parameter and return some constant values.

At the beginning, I thought the error is caused by too many switch/case statements, but after some testing, that is not the root cause, it looks like to be related to some of these "values". See below issue report:

/*
ICC Version: Version 15.0.0.090 Build 20140723
Reproduce: icc foo.c -c -O1
Works with: icc foo.c -c -O0
*/
int foo(int v)
{    
    switch (v)
      {	   
		// If I remove one of below case statement, it works.
		// If I change one of the value from 0x00001000 to another one, example 0x00001100, it works
		// If I change one of the return statement to "break", it works.
          case (0x00001000 | 1):
              return (1);
          case (0x00001000 | 2):
              return (1);
          case (0x00001000 | 3):
              return (1);
          case (0x00001000 | 4):
              return (1);
          case (0x00001000 | 5):
              return (1);

		// If I remove one of below case statement, it works.
          case 1:
              break;
          case 2:
              break;
          case 3:
		break;
          case 4:
              break;
          case 5:
              break;
          case 6:
		break;
          case 7:
              break;
          case 8:
		break;
          case 9:
              break;
          default:
              break;
      }          
    return (-1);
}

As it is a internal crash error inside ICC, I will leave more investigation work for developer and update you if there is a fix.

Thanks,

Shenghong

0 Kudos
Shenghong_G_Intel
623 Views

@Ben,

FYI. This issue is fixed in our mainline already. I have verified with the nightly build.

Thanks,

Shenghong

0 Kudos
Ben3
Beginner
622 Views

shenghong-geng (Intel) wrote:

FYI. This issue is fixed in our mainline already. I have verified with the nightly build.

Thanks,

Thanks for investigating it Shenghong.

Cheers,
Ben

0 Kudos
Shenghong_G_Intel
622 Views

FYI. This issue is fixed in 2015 update 1 release.

# icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.1.133 Build 20141023
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

#

Thanks,

Shenghong

0 Kudos
Reply