Seg Fault when run on Linux

Seg Fault when run on Linux

Hi,

I am new to MKL. I am trying to get it installed on my linux system. I can compile and link programs but get a segfault in the cblas functions when I try to run my executable. Details follow.

Thanks in advance,
Brad

My machine:
Processors (2): Intel Xeon CPU 3.06GHz
OS: Red Hat Linux 3.2.3-49
Compiler: gcc/g77 (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-49)

The install seems to go fine and I can compile and link programs, but I get a seg fault when I try to run an executable. This occurs in my own test program and in the tests and examples for blas and cblas (I have not tried any of the other examples or tests).

Here is what I did:
1) untar and install in default directory

2) in /opt/intel/mkl72/tests/cblas (similar results in examples/cblas directory) typed 'make lib32 F=gnu'

(make give an error)
make sblat1.res dblat1.res cblat1.res zblat1.res sblat2.res dblat2.res cblat2.res zblat2.res sblat3.res dblat3.res cblat3.res zblat3.res _IA=32 PLATF=ia32 IE=i D=lib32 MKL_LIB=mkl_ia32
make[1]: Entering directory `/opt/intel/mkl72/tests/cblas'
mkdir -p ./_results/lib32_gnu
g77 -w ../blas/source/sblat1.f source/libcwrap_ia32.a -L/opt/intel/mkl72/lib/32 -lmkl_ia32 -lguide -lpthread -o _results/lib32_gnu/sblat1.exe
export LD_LIBRARY_PATH=/opt/intel/mkl72/lib/32:/usr/local/lib:/opt/hpnpl/lib:/var/opt/enscript/enscript-1.6.1/lib:/afs/radonc/pkg/lapack_3:/afs/isis/pkg/intel_CC-71/lib:/opt/intel/mkl72/lib/32; if [ -e ../blas/in/sblat1.in ];

then _results/lib32_gnu/sblat1.exe <../blas/in/sblat1.in >_results/lib32_gnu/sblat1.res;

else _results/lib32_gnu/sblat1.exe >_results/lib32_gnu/sblat1.res; fi
make[1]: *** [sblat1.res] Error 139
make[1]: Leaving directory `/opt/intel/mkl72/tests/cblas'
make: *** [lib32] Error 2

(when I tried with so32)
[root@prome cblas]# make so32 F=gnu
make sblat1.res dblat1.res cblat1.res zblat1.res sblat2.res dblat2.res cblat2.res zblat2.res sblat3.res dblat3.res cblat3.res zblat3.res _IA=32 PLATF=ia32 IE=i D=so32 MKL_LIB=mkl
make[1]: Entering directory `/opt/intel/mkl72/tests/cblas'
mkdir -p ./_results/so32_gnu
g77 -w ../blas/source/sblat1.f source/libcwrap_ia32.a -L/opt/intel/mkl72/lib/32 -lmkl -lguide -lpthread -o _results/so32_gnu/sblat1.exe
export LD_LIBRARY_PATH=/opt/intel/mkl72/lib/32:/usr/local/lib:/opt/hpnpl/lib:/var/opt/enscript/enscript-1.6.1/lib:/afs/radonc/pkg/lapack_3:/afs/isis/pkg/intel_CC-71/lib:/opt/intel/mkl72/lib/32; if [ -e ../blas/in/sblat1.in ];

then _results/so32_gnu/sblat1.exe <../blas/in/sblat1.in >_results/so32_gnu/sblat1.res;

else _results/so32_gnu/sblat1.exe >_results/so32_gnu/sblat1.res; fi
make[1]: *** [sblat1.res] Error 139
make[1]: Leaving directory `/opt/intel/mkl72/tests/cblas'
make: *** [so32] Error 2

3) When I inspect the contents of _results/lib32_gnu/ I find the two files sblat1.exe and sblat1.res. sblat1.res has size 0.

4) If I try to run sblat1.exe directly from the command line I get a seg fault. (Same result when I compiled and rand example programs)

[root@prome cblas]# _results/lib32_gnu/sblat1.exe
Real BLAS Test Program Results

Test of subprogram number 1 SDOT
Segmentation fault (core dumped)

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You've left a lot unsaid and a lot misleading in your post. I don't know how you
could get a Red Hat OS version number which matches your gcc/g77 version number.
I have no clue what you mean by .res files; presumably you have some configuration
for them in your Makefile.
MKL is compatible with Intel Fortran (and, to a fair extent, with gcc).
Any compatibility with g77 would be a matter of luck,
avoiding run-time library conflicts, and setting compatible options in g77,
which you have not divulged. Run-time error 139 in the Intel Fortran document
is a subscript out of bounds type error.

Thank you for your post. I appologize for being misleading, as I said, I am new to this. I added the correct redhat kernel version number below.

I am only using the tests and examples that were provided with the software. I did not write code or create or alter a makefile. When I ran 'make lib32 F=gnu' in the /opt/intel/mkl72/tests/cblas directory, the executable (.exe) and .res file were generated in the _results/lib32 directory. I had nothing to do with creating the .res file. The Intel make file created it (as the output (perhaps 'res' stands for result?) of the test). If you look in the makefile in the test directory you will see where and when the .res files are created.

This is exactly what I did...

[davisb@prome cblas]# pwd
/opt/intel/mkl72/tests/cblas
[davisb@prome cblas]# ls _results/lib32_gnu/
[davisb@prome cblas]# make lib32 F=gnu
make sblat1.res dblat1.res cblat1.res zblat1.res sblat2.res dblat2.res cblat2.res zblat2.res sblat3.res dblat3.res cblat3.res zblat3.res _IA=32 PLATF=ia32 IE=i D=lib32 MKL_LIB=mkl_ia32
make[1]: Entering directory `/opt/intel/mkl72/tests/cblas'
mkdir -p ./_results/lib32_gnu
g77 -w ../blas/source/sblat1.f source/libcwrap_ia32.a -L/opt/intel/mkl72/lib/32 -lmkl_ia32 -lguide -lpthread -o _results/lib32_gnu/sblat1.exe
export LD_LIBRARY_PATH=/opt/intel/mkl72/lib/32:; if [ -e ../blas/in/sblat1.in ];

then _results/lib32_gnu/sblat1.exe <../blas/in/sblat1.in >_results/lib32_gnu/sblat1.res;

else _results/lib32_gnu/sblat1.exe >_results/lib32_gnu/sblat1.res; fi
make[1]: *** [sblat1.res] Error 139
make[1]: Leaving directory `/opt/intel/mkl72/tests/cblas'
make: *** [lib32] Error 2
[davisb@prome cblas]# ls _results/lib32_gnu/
sblat1.exe sblat1.res
[davisb@prome cblas]#

Here is my redhat and gcc info...

[davisb@prome cblas]# cat /proc/version
Linux version 2.4.21-27.0.2.ELsmp (bhcompile@tweety.build.redhat.com) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47)) #1 SMP Wed Jan 12 23:35:44 EST 2005
[davisb@prome cblas]#

Here are my results using the intel compiler (version 8.0)...

Thanks again for your help.

Brad

[davisb@prome:cblas 30] pwd
/opt/intel/mkl72/tests/cblas
[davisb@prome:cblas 31] make lib32
gmake sblat1.res dblat1.res cblat1.res zblat1.res sblat2.res dblat2.res cblat2.res zblat2.res sblat3.res dblat3.res cblat3.res zblat3.res _IA=32 PLATF=ia32 IE=i D=lib32 MKL_LIB=mkl_ia32
gmake[1]: Entering directory `/opt/intel/mkl72/tests/cblas'
mkdir -p ./_results/lib32_intel
ifc -w ../blas/source/sblat1.f source/libcwrap_ia32.a -L/opt/intel/mkl72/lib/32 -lmkl_ia32 -lguide -lpthread -o _results/lib32_intel/sblat1.exe
ifc: warning: The Intel Fortran driver is now named ifort. You can suppress this message with '-quiet'
export LD_LIBRARY_PATH=/opt/intel/mkl72/lib/32:.:/ur/davisb/bin:/usr/local/lib:/opt/hpnpl/lib:/var/opt/enscript/enscript-1.6.1/lib:/afs/radonc/pkg/lapack_3:/afs/isis/pkg/intel_CC/lib:/afs/isis/pkg/intel_fortran/lib:/opt/intel/mkl72/lib/32; if [ -e ../blas/in/sblat1.in ];

then _results/lib32_intel/sblat1.exe <../blas/in/sblat1.in >_results/lib32_intel/sblat1.res;

else _results/lib32_intel/sblat1.exe >_results/lib32_intel/sblat1.res; fi
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
sblat1.exe 00187F79 Unknown Unknown Unknown
sblat1.exe 706F2F3A Unknown Unknown Unknown

Stack trace terminated abnormally.
gmake[1]: *** [sblat1.res] Error 174
gmake[1]: Leaving directory `/opt/intel/mkl72/tests/cblas'
gmake: *** [lib32] Error 2
[davisb@prome:cblas 32]

same result when I add 'F=intel80' to the make line (since I am using version 8.0)...

[davisb@prome:cblas 14] make lib32 F=intel80
gmake sblat1.res dblat1.res cblat1.res zblat1.res sblat2.res dblat2.res cblat2.res zblat2.res sblat3.res dblat3.res cblat3.res zblat3.res _IA=32 PLATF=ia32 IE=i D=lib32 MKL_LIB=mkl_ia32
gmake[1]: Entering directory `/opt/intel/mkl72/tests/cblas'
mkdir -p ./_results/lib32_intel80
ifc -w ../blas/source/sblat1.f source/libcwrap_ia32.a -L/opt/intel/mkl72/lib/32 -lmkl_ia32 -lguide -lpthread -o _results/lib32_intel80/sblat1.exe
ifc: warning: The Intel Fortran driver is now named ifort. You can suppress this message with '-quiet'
export LD_LIBRARY_PATH=/opt/intel/mkl72/lib/32:.:/ur/davisb/bin:/usr/local/lib:/opt/hpnpl/lib:/var/opt/enscript/enscript-1.6.1/lib:/afs/radonc/pkg/lapack_3:/afs/isis/pkg/intel_CC/lib:/afs/isis/pkg/intel_fortran/lib:/opt/intel/mkl72/lib/32; if [ -e ../blas/in/sblat1.in ];

then _results/lib32_intel80/sblat1.exe <../blas/in/sblat1.in >_results/lib32_intel80/sblat1.res;

else _results/lib32_intel80/sblat1.exe >_results/lib32_intel80/sblat1.res; fi
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
sblat1.exe 00187F79 Unknown Unknown Unknown
sblat1.exe 706F2F3A Unknown Unknown Unknown

Stack trace terminated abnormally.
gmake[1]: *** [sblat1.res] Error 174
gmake[1]: Leaving directory `/opt/intel/mkl72/tests/cblas'
gmake: *** [lib32] Error 2
[davisb@prome:cblas 15]

I tried installing on a new machine and got the same results. I must be doing something horribly wrong.

Thanks for you help,
Brad

Machine info
============
Intel Pentium 4 CPU 2.80GHz (single processor)
Linux version 2.4.21-27.0.2.EL (bhcompile@tweety.build.redhat.com) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47)) #1 Wed Jan 12 23:46:37 EST 2005
ifort v 8.0

I get the same results...
=========================

[davisb@pan:cblas 27] pwd
/opt/intel/mkl72/tests/cblas
[davisb@pan:cblas 28] make lib32 F=intel80
gmake sblat1.res dblat1.res cblat1.res zblat1.res sblat2.res dblat2.res cblat2.res zblat2.res sblat3.res dblat3.res cblat3.res zblat3.res _IA=32 PLATF=ia32 IE=i D=lib32 MKL_LIB=mkl_ia32
gmake[1]: Entering directory `/opt/intel/mkl72/tests/cblas'
mkdir -p ./_results/lib32_intel80
ifc -w ../blas/source/sblat1.f source/libcwrap_ia32.a -L/opt/intel/mkl72/lib/32 -lmkl_ia32 -lguide -lpthread -o _results/lib32_intel80/sblat1.exe
ifc: warning: The Intel Fortran driver is now named ifort. You can suppress this message with '-quiet'
export LD_LIBRARY_PATH=/opt/intel/mkl72/lib/32:.:/ur/davisb/bin:/usr/local/lib:/opt/hpnpl/lib:/var/opt/enscript/enscript-1.6.1/lib:/afs/radonc/pkg/lapack_3:/afs/isis/pkg/intel_CC/lib:/afs/isis/pkg/intel_fortran/lib:/opt/intel/mkl72/lib/32; if [ -e ../blas/in/sblat1.in ];

then _results/lib32_intel80/sblat1.exe <../blas/in/sblat1.in >_results/lib32_intel80/sblat1.res;

else _results/lib32_intel80/sblat1.exe >_results/lib32_intel80/sblat1.res; fi
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
sblat1.exe 00187F79 Unknown Unknown Unknown
sblat1.exe 706F2F3A Unknown Unknown Unknown

Stack trace terminated abnormally.
gmake[1]: *** [sblat1.res] Error 174
gmake[1]: Leaving directory `/opt/intel/mkl72/tests/cblas'
gmake: *** [lib32] Error 2
[davisb@pan:cblas 29]

in case it helps, here is the output from gdb when running sblat1.exe.

Brad

[davisb@pan:lib32_intel80 33] gdb
GNU gdb Red Hat Linux (6.1post-1.20040607.52rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu".
(gdb) file sblat1.exe
Reading symbols from /opt/intel/mkl72/tests/cblas/_results/lib32_intel80/sblat1.exe...(no debugging symbols found)...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) run
Starting program: /opt/intel/mkl72/tests/cblas/_results/lib32_intel80/sblat1.exe
(no debugging symbols found)...(no debugging symbols found)...[Thread debugging using libthread_db enabled]
[New Thread -1218557792 (LWP 23337)]
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... Real BLAS Test Program Results

Test of subprogram number 1 SDOT

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1218557792 (LWP 23337)]
0x00bc1f79 in strcat () from /lib/tls/libc.so.6
(gdb) where
#0 0x00bc1f79 in strcat () from /lib/tls/libc.so.6
#1 0x0804c4c5 in searchpath ()
#2 0x706f2f3a in ?? ()
#3 0x4b472f74 in ?? ()
#4 0x65707369 in ?? ()
#5 0x622f6c6c in ?? ()
#6 0x2f3a6e69 in ?? ()
#7 0x2f74706f in ?? ()
#8 0x574e5553 in ?? ()
#9 0x76746d73 in ?? ()
#10 0x6f68532f in ?? ()
#11 0x54654d77 in ?? ()
#12 0x69622f56 in ?? ()
#13 0x6f2f3a6e in ?? ()
#14 0x732f7470 in ?? ()
#15 0x622f7766 in ?? ()
#16 0x2f3a6e69 in ?? ()
#17 0x74616e61 in ?? ()
#18 0x31796d6f in ?? ()
#19 0x7665642f in ?? ()
#20 0x7376632f in ?? ()
#21 0x746f6f72 in ?? ()
#22 0x66612f3a in ?? ()
---Type to continue, or q to quit---
#23 0x73692f73 in ?? ()
#24 0x702f7369 in ?? ()
#25 0x692f676b in ?? ()
#26 0x6c65746e in ?? ()
#27 0x2f43435f in ?? ()
#28 0x3a6e6962 in ?? ()
#29 0x7366612f in ?? ()
#30 0x6973692f in ?? ()
#31 0x6b702f73 in ?? ()
#32 0x6e692f67 in ?? ()
#33 0x5f6c6574 in ?? ()
#34 0x74726f66 in ?? ()
#35 0x2f6e6172 in ?? ()
#36 0x3a6e6962 in ?? ()
#37 0x696c432f in ?? ()
#38 0x2f63696e in ?? ()
#39 0x4e554c50 in ?? ()
#40 0x414d2f43 in ?? ()
#41 0x52455453 in ?? ()
#42 0x6e69622f in ?? ()
#43 0x3836692f in ?? ()
#44 0x752f3a36 in ?? ()
#45 0x612f7273 in ?? ()
---Type to continue, or q to quit---
#46 0x73777366 in ?? ()
#47 0x6e69622f in ?? ()
#48 0x3a2f2e3a in ?? ()
#49 0x00000000 in ?? ()
(gdb)

Brad,

The makefile is supposed to make this fairly easy to build an example.

If you enter "make help" you get back this line:
make {lib32/so32/lib64/so64/libem64t/soem64t} [function=name] [F=compiler]
The acceptable names for "name" are listed in cblas.lst. Essentially those are the prefix "cblas_" followed by a BLAS name, such as "cblas_ddot".

It appears you did most of this. For instance, you entered "make lib32 F=gnu"

I just went through this process and here is what I did and the results I got.

make lib32 function=cblas_ddot F=gnu

In the directory _results/lib32_gnu are two files. The one is the executable and the other is the result, in my case cblas_ddotx.res.

Bruce

Leave a Comment

Please sign in to add a comment. Not a member? Join today