Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28474 Discussions

Is fstack-protector-all supported on MIC?

Mark_M_4
Beginner
571 Views

I'm debugging a crash in my Fortran code, and would like to try stack protection.

Is fstack-protector-all supported on the MIC platform?  When I build with -mic -fstack-protector-all the executable crashes because it can't find the libssp.so.0 library.  Is a MIC version of that library supposed to be included with my compiler?  I'm using ifort 14.0.2.  

Thank you for your help.

0 Kudos
1 Solution
TimP
Honored Contributor III
571 Views

I suppose you may require -mmic -g -fstack-protector-all.

On my installation, 'locate libssp | grep k1om'  shows me /opt/mpss/3.2.3/sysroots/k1om-mpss-linux/usr/lib64/.debug/libssp.so on host but it is not mounted nor copied by default to coprocessor.  I stopped trying to update mpss due to the age of my system.

It's normal to require boosting the stack limit e.g. 'ulimit -s unlimited' on the coprocessor when running a normal (large) number of threads, unless it is possible to reduce the individual thread stack limit from the default 4M.  I suspect that the optimization of number of threads per MPI process vs. number of ranks may be limited by this (e.g. 6 ranks of 30 threads each with OMP_STACK_SIZE=9m will still require "unlimited" stack).

I don't know whether the stack-protector option has been used successfully on MIC.  Without it, stack overflow may break an application without throwing a segfault as you would expect on host.

View solution in original post

0 Kudos
5 Replies
pbkenned1
Employee
571 Views

Let me investigate and I'll get back to you.

Patrick

0 Kudos
TimP
Honored Contributor III
572 Views

I suppose you may require -mmic -g -fstack-protector-all.

On my installation, 'locate libssp | grep k1om'  shows me /opt/mpss/3.2.3/sysroots/k1om-mpss-linux/usr/lib64/.debug/libssp.so on host but it is not mounted nor copied by default to coprocessor.  I stopped trying to update mpss due to the age of my system.

It's normal to require boosting the stack limit e.g. 'ulimit -s unlimited' on the coprocessor when running a normal (large) number of threads, unless it is possible to reduce the individual thread stack limit from the default 4M.  I suspect that the optimization of number of threads per MPI process vs. number of ranks may be limited by this (e.g. 6 ranks of 30 threads each with OMP_STACK_SIZE=9m will still require "unlimited" stack).

I don't know whether the stack-protector option has been used successfully on MIC.  Without it, stack overflow may break an application without throwing a segfault as you would expect on host.

0 Kudos
pbkenned1
Employee
571 Views

I believe -fstack-protector-all should be supported for MIC, but I can't produce a dependency on libssp.so with my own example:

[U539581]$ ifort -g -fstack-protector-all -mmic getTypeBoundPtKB.f90 -o getTypeBoundPtKB.f90-mic.x
[U539581]$

[mic0 pbkenned]# ./getTypeBoundPtKB.f90-mic.x
 subArray =          99          99          99          99
[mic0 pbkenned]#
 

Can you please:

1) Attach a test case

2) Indicate your exact compile command line

3) Repeat 2), but add -dryrun, capture the output, and attach.

4) Indicate what version of MPSS you are using

Thanks,

Patrick

 

0 Kudos
Mark_M_4
Beginner
571 Views

Thank you, I used locate to find the k10m version of libssp.  The MIC executable ran successfully.

0 Kudos
pbkenned1
Employee
571 Views

If you're satisfied with copying libssp to the card, then we'll consider this case closed.

Patrick

0 Kudos
Reply