repos
/
kde.ui
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
filehistory
normal
|
plain
|
shade
|
zebra
Workaround segfault on exit & run test on commit
Annotate for file util/backtrace.cpp
2009-05-26 tobias
1
#include <QDebug>
15:46:14 '
2
'
3
#define BT_EXPORT __attribute__((visibility("default")))
'
4
'
5
extern "C" {
'
6
/** Overwrites backtrace_symbols in execinfo.h and does nothing.
'
7
* Work around segfault in:
'
8
* ~KIconLoader()
'
9
* kRealBacktrace(int)
'
10
* backtrace_symbols
'
11
*
'
12
* ~KIconLoader() is called at exit when an KApplication has been constructed.
'
13
* Somehow a negative number is pased as size to backtrace_symbols:
'
14
* void* trace[256];
'
15
* backtrace_symbols(trace, -1219315128); // => SIGSEGV
'
16
* and segfaults in sysdeps/generic/elf/backtracesyms.c:65
'
17
*/
'
18
BT_EXPORT char**
'
19
backtrace_symbols(void* const* buffer, int size)
'
20
{
'
21
qDebug() << "libcl-smoke-disable-backtrace: backtrace_symbols workaround\n"
'
22
<< "\tbuffer: " << buffer << "size: " << size;
'
23
return NULL;
'
24
}
'
25
'
26
// overwriting backtrace(void** buffer, int size) does not work!?
'
27
}