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
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
链接已复制
# 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
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
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
