-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR: LeakSanitizer: detected memory leaks for daemon #3839
Comments
For coroutine, we should use
It will cause asan failed to get the stack, see
After fix this issue, it should provide the full stack when crashing:
See google/sanitizers#189 (comment) we should call the asan API correctly. For the main or primordial coroutine, we should detect the stack pointer, like this: #include <sys/resource.h>
int main(int argc, char **argv) {
register void* stack_top asm ("sp");
struct rlimit limit;
if (getrlimit (RLIMIT_STACK, &limit) == 0) {
void* stack_bottom = (char*)stack_top - limit.rlim_cur;
st_set_primordial_stack(stack_top, stack_bottom);
} If not set the stack by |
By setting the env By setting env In order to set the default asan option, we need to provide a function: // This function return the default options for asan, before main() is called,
// see https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags
//
// Disable halt on errors by halt_on_error, only print messages, note that it still quit for fatal errors,
// see https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
//
// Disable the memory leaking detect for daemon by detect_leaks,
// see https://github.com/google/sanitizers/wiki/SanitizerCommonFlags
//
// Also disable alloc_dealloc_mismatch for gdb.
extern "C" const char *__asan_default_options() {
return "halt_on_error=0:detect_leaks=0:alloc_dealloc_mismatch=0";
} Should never set the env in |
Describe the bug
Failed to start SRS v5 on Docker
TRANS_BY_GPT4
The text was updated successfully, but these errors were encountered: