readelf --debug-dump=info ./echo_server | grep "DW_AT_producer" shows that helio is compiled with stack protection flags on my laptop, even in O2 mode. Seems like some distro tweaking of gcc because I have not seen it before. As a result, when CPU profiling is enabled, dragonfly can crash with a message "stack smashing detected" . The stacktrace shows the failure happens inside CpuProfiler::prof_handler which is a signal handler of gperftools. Seems like a bad interaction of signal handling and stack protection code. Therefore, I disabled these stack flags for thirdpary libraries.
readelf --debug-dump=info ./echo_server | grep "DW_AT_producer"
shows that helio is compiled with stack protection flags on my laptop, even in O2 mode. Seems like some distro tweaking of gcc because I have not seen it before. As a result, when CPU profiling is enabled, dragonfly can crash with a message "stack smashing detected" . The stacktrace shows the failure happens insideCpuProfiler::prof_handler
which is a signal handler of gperftools. Seems like a bad interaction of signal handling and stack protection code. Therefore, I disabled these stack flags for thirdpary libraries.