romange / helio

A modern framework for backend development based on io_uring Linux interface
Apache License 2.0
435 stars 49 forks source link

fix: disable stack protector that does not work well with gperftools #214

Closed romange closed 7 months ago

romange commented 7 months ago
  1. 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.
  2. Unrelated, I added more logs inside fiber code for a check-fail that sometimes happens in dragonfly unit tests like this one: https://github.com/dragonflydb/dragonfly/actions/runs/7862807475/job/21452699281?pr=2570#step:10:6509