List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:November 17 2009 9:13pm
Subject:Re: bzr commit into mysql-5.0-bugteam branch (staale.smedseng:2817)
Bug#47391
View as plain text  
Hi Staale,

On 10/16/09 8:20 AM, Staale Smedseng wrote:
> #At file:///net/atum21.norway/export/home/tmp/ss156133/z/47391-50/ based on
> revid:frazer@stripped
>
>   2817 Staale Smedseng	2009-10-16
>        Bug #47391 no stack trace printed to error log on
>        solaris after a crash
>
>        This patch adds a Solaris-specific version of
>        print_stacktrace() which uses printstack(2). The symbol
>        names are mangled, so use of c++filt may be required as
>        described in the MySQL documentation.

OK to push. One minor comment below.

>      modified:
>        sql/stacktrace.c
>        sql/stacktrace.h
> === modified file 'sql/stacktrace.c'
> --- a/sql/stacktrace.c	2008-09-16 11:16:41 +0000
> +++ b/sql/stacktrace.c	2009-10-16 11:20:03 +0000
> @@ -226,6 +226,23 @@ end:
>   stack trace is much more helpful in diagnosing the problem, so please do \n\
>   resolve it\n");
>   }
> +
> +#elif defined(__sun)
> +
> +/* Use Solaris' symbolic stack trace routine. */
> +#include<ucontext.h>
> +
> +void  print_stacktrace(gptr stack_bottom __attribute__((unused)),
> +                       ulong thread_stack __attribute__((unused)))
> +{
> +  if (printstack(fileno(stderr)) == -1)
> +    fprintf(stderr, "Error when traversing the stack, stack appears corrupt.\n");
> +  else
> +    fprintf(stderr, "Please read
> http://dev.mysql.com/doc/mysql/en/using-stack-trace.html and follow instructions on how to
> resolve the stack trace. Resolved\n\
> +stack trace is much more helpful in diagnosing the problem, so please do \n\
> +resolve it\n");
> +}
> +

Please break the string:

	fprintf(stderr, "Please read http://dev.mysql.com/doc/mysql/en/"
                         "using-stack-trace.html and follow instructions"
                          ... );

Also, you will have to adjust the patch when merging into 5.1 and up. 
The stacktrace functionality has been moved to the mysys library and a 
thing to keep an eye on is that the backtrace functions (backtrace, 
backtrace_symbols and backtrace_symbols_fd) are available on Linux and 
recent Solaris, so perhaps there should be a way to either use them or 
printstack.

Regards,

--
Davi Arnaut
Thread
bzr commit into mysql-5.0-bugteam branch (staale.smedseng:2817) Bug#47391Staale Smedseng16 Oct
  • Re: bzr commit into mysql-5.0-bugteam branch (staale.smedseng:2817)Bug#47391Konstantin Osipov24 Oct
  • Re: bzr commit into mysql-5.0-bugteam branch (staale.smedseng:2817)Bug#47391Davi Arnaut17 Nov