Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4975 Discussions

Invalid sigaltstack boundary check in the VTune XE 2011 Update 10 (build 240480) is crashing it

Dmitry_Chichkov
Beginner
637 Views
Hello,

It looks like the following (valid) code is crashing VTune with:
   Error: Stack size provided to sigaltstack is too small. Please increase the stack size to 64K minimum.

Apparently on Ubuntu 11.10, x64 minimum allowed ss_size could be smaller than 64K (and in fact the default SIGSTKSZ is 8k).
It'd be great, if somebody could forward that report to devs....


Here is the code that reproduces the problem [on Ubuntu 11.10, x64, server. With amplxe-cl -collect hotspots] :

#include
#include
#include

int main(int argc, char ** argv)
{
    stack_t stk;

    if ((stk.ss_sp = malloc(SIGSTKSZ)) == NULL)
        perror("malloc");

    stk.ss_size = SIGSTKSZ;
    stk.ss_flags = 0;

    if (sigaltstack(&stk,(stack_t *)0) < 0)
        perror("sigaltstack");

    perror("done");
    return 0;

}
~                  

With Regards,
Dmitry

0 Kudos
1 Solution
Peter_W_Intel
Employee
637 Views
After investigating, it seems that the tool uses alternate signal stack to handle profiling signal, but the user also uses alternate signal stack and we require the stack to be at least 64K in size.

There are two options to solve this problem:
1. Increase alt stack size in the program to 64K
2. Use CLI and pass special option which will tel the collector not to use alt stack and use app stack instead

# amplxe-cl -collect hotspots -run-pass-thru=--no-altstack  -- ./test
done: Success
Using result path `/home/peter/tmp/r004hs'
Executing actions 75 % Generating a report                                    
Summary
-------

Elapsed Time:  0.0001859
CPU Time:      0
Executing actions 100 % done             

View solution in original post

0 Kudos
5 Replies
Peter_W_Intel
Employee
637 Views
This is a valuable report, with good test case. I can reproduce this on my side, even on other x32_64 system.

# amplxe-cl -collect hotspots -- ./test
done: Success
Error: Stack size provided to sigaltstack is too small. Please increase the stack size to 64K minimum.
Using result path `/home/peter/tmp/r003hs'
Executing actions 16 % Loading data files                                     
Warning: Cannot load data file `/home/peter/tmp/r003hs/data.0/24861-24868.0.log' ().
Executing actions 75 % Generating a report                                    
Summary
-------

Elapsed Time:  0.0001536
CPU Time:      0
Executing actions 100 % done             

I have escalated this problem to engineering, will post any update soon

0 Kudos
Peter_W_Intel
Employee
638 Views
After investigating, it seems that the tool uses alternate signal stack to handle profiling signal, but the user also uses alternate signal stack and we require the stack to be at least 64K in size.

There are two options to solve this problem:
1. Increase alt stack size in the program to 64K
2. Use CLI and pass special option which will tel the collector not to use alt stack and use app stack instead

# amplxe-cl -collect hotspots -run-pass-thru=--no-altstack  -- ./test
done: Success
Using result path `/home/peter/tmp/r004hs'
Executing actions 75 % Generating a report                                    
Summary
-------

Elapsed Time:  0.0001859
CPU Time:      0
Executing actions 100 % done             

0 Kudos
Dmitry_Chichkov
Beginner
637 Views
Hi Peter,

Thank you!  Confirming that amplxe-cl with "-run-pass-thru=--no-altstack" fixes that issue for me.

Alto as a note to you [and others who might be facing this in the future] - I've originaly encountered that problem in the code generated by recent stable version of ocaml compiler from INRIA [see. http://caml.inria.fr/download.en.html ].  And it looks like any program built by ocamlopt would have that problem.

To reproduce, you could install ocaml (available in any modern linux distro - sudo apt-get install ocaml). And execute with amplxe a trivial program:   let _ = Printf.printf "hello\n"  created by "ocamlopt test.ml".

Suggested amplxe-cl "-run-pass-thru=--no-altstack" option fixes it.

Best,
Dmitry
0 Kudos
lmcewan
Beginner
637 Views
Hi Peter Is there any way to fix this from the VTune gui? (We're not wittingly using the alt stack and suspect this down to a 3rd party lib, so changing the alt stack size may be out of our control.) Thank you, Lindsay
0 Kudos
Peter_W_Intel
Employee
637 Views
I haven't seen this option in GUI.
0 Kudos
Reply