The solution (ulimit -s unlimited) given by Ben Bolstad works on Linux machine, but not on Mac OS. ulimit -s won's accept unlimited as a valid parameter, instead you have to specify the size in number such as ulimit -s 20000.
It appears that in Mac OS 10.10 ulimit no longer works, you should instead use launchctl limit stack to set the stack size, but the size can not exceed the system stack hard limit.
So first run a
launchctl limit stack
to check the 2nd number (in my case 67104768). Then
sudo launchctl limit stack 67104768
to set the current stack limit to the hard limit.
Restart your terminal or rstudio, now h5read should work without segment fault.