Skip to content
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

SIGSEGV handle may wrong #1005

Closed
goodnewday opened this issue Dec 21, 2021 · 1 comment · Fixed by #1048
Closed

SIGSEGV handle may wrong #1005

goodnewday opened this issue Dec 21, 2021 · 1 comment · Fixed by #1048
Labels
bug Something isn't working

Comments

@goodnewday
Copy link

goodnewday commented Dec 21, 2021

Hello:
In src/sighand.c have this code, it handle SIGSEGV, but it may let the process not exit , I find that for (left = 0; left < 10; left++) should be replace by for (left = 0; left < ret; left++)

static void
print_trace (void)
{
  void *array[10];
  int ret = 0, left;
  char *message = "SIGSEGV occurred!\n";
  char **strings;

  /*It used log_get_fd() in log.h to know where to log the backtrace.*/
  ret = backtrace (array, 10);
  strings = backtrace_symbols (array, ret);
  g_warning ("%s", message);

  **for (left = 0; left < 10; left++)**
    g_warning ("%s\n", strings[left]);

  g_free (strings);
}

@goodnewday goodnewday added the bug Something isn't working label Dec 21, 2021
@jjnicola
Copy link
Member

Hi @goodnewday !
Thanks for reporting! #1048 will fix this issue.
Best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants