Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d2ed905c
Kaydet (Commit)
d2ed905c
authored
Mar 28, 2012
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
when run under memcheck allow SIGUSR2 to dump current memory allocations
üst
f3876e3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
3 deletions
+43
-3
soffice.sh
desktop/scripts/soffice.sh
+1
-0
signal.c
sal/osl/unx/signal.c
+42
-3
No files found.
desktop/scripts/soffice.sh
Dosyayı görüntüle @
d2ed905c
...
@@ -109,6 +109,7 @@ for arg in $@ $VALGRINDOPT ; do
...
@@ -109,6 +109,7 @@ for arg in $@ $VALGRINDOPT ; do
fi
fi
# finally set the valgrind check
# finally set the valgrind check
VALGRINDCHECK
=
"valgrind --tool=
$VALGRIND
--trace-children=yes
$valgrind_skip
--num-callers=50 --error-limit=no --error-exitcode=101"
VALGRINDCHECK
=
"valgrind --tool=
$VALGRIND
--trace-children=yes
$valgrind_skip
--num-callers=50 --error-limit=no --error-exitcode=101"
echo
"use kill -SIGUSR2 pid to dump traces of active allocations"
checks
=
"c
$checks
"
checks
=
"c
$checks
"
if
[
"
$VALGRIND
"
=
"memcheck"
]
;
then
if
[
"
$VALGRIND
"
=
"memcheck"
]
;
then
export
G_SLICE
=
always-malloc
export
G_SLICE
=
always-malloc
...
...
sal/osl/unx/signal.c
Dosyayı görüntüle @
d2ed905c
...
@@ -87,6 +87,10 @@
...
@@ -87,6 +87,10 @@
#define MAX_PATH_LEN 2048
#define MAX_PATH_LEN 2048
#if defined(HAVE_MEMCHECK_H)
#include <memcheck.h>
#endif
typedef
struct
_oslSignalHandlerImpl
typedef
struct
_oslSignalHandlerImpl
{
{
oslSignalHandlerFunction
Handler
;
oslSignalHandlerFunction
Handler
;
...
@@ -260,8 +264,13 @@ static sal_Bool InitSignal()
...
@@ -260,8 +264,13 @@ static sal_Bool InitSignal()
sigfillset
(
&
(
act
.
sa_mask
));
sigfillset
(
&
(
act
.
sa_mask
));
/* Initialize the rest of the signals */
/* Initialize the rest of the signals */
for
(
i
=
0
;
i
<
NoSignals
;
i
++
)
for
(
i
=
0
;
i
<
NoSignals
;
++
i
)
{
{
#if defined(HAVE_MEMCHECK_H)
if
(
Signals
[
i
].
Signal
==
SIGUSR2
&&
RUNNING_ON_VALGRIND
)
Signals
[
i
].
Action
=
ACT_IGNORE
;
#endif
/* hack: stomcatd is attaching JavaVM wich dont work with an sigaction(SEGV) */
/* hack: stomcatd is attaching JavaVM wich dont work with an sigaction(SEGV) */
if
((
bSetSEGVHandler
||
Signals
[
i
].
Signal
!=
SIGSEGV
)
if
((
bSetSEGVHandler
||
Signals
[
i
].
Signal
!=
SIGSEGV
)
&&
(
bSetWINCHHandler
||
Signals
[
i
].
Signal
!=
SIGWINCH
)
&&
(
bSetWINCHHandler
||
Signals
[
i
].
Signal
!=
SIGWINCH
)
...
@@ -283,10 +292,12 @@ static sal_Bool InitSignal()
...
@@ -283,10 +292,12 @@ static sal_Bool InitSignal()
Signals
[
i
].
Handler
=
SIG_DFL
;
Signals
[
i
].
Handler
=
SIG_DFL
;
}
}
else
else
{
if
(
sigaction
(
Signals
[
i
].
Signal
,
&
act
,
&
oact
)
==
0
)
if
(
sigaction
(
Signals
[
i
].
Signal
,
&
act
,
&
oact
)
==
0
)
Signals
[
i
].
Handler
=
oact
.
sa_handler
;
Signals
[
i
].
Handler
=
oact
.
sa_handler
;
else
else
Signals
[
i
].
Handler
=
SIG_DFL
;
Signals
[
i
].
Handler
=
SIG_DFL
;
}
}
}
}
}
}
}
...
@@ -908,6 +919,26 @@ void CallSystemHandler(int Signal)
...
@@ -908,6 +919,26 @@ void CallSystemHandler(int Signal)
}
}
}
}
#if defined(HAVE_MEMCHECK_H)
static
void
DUMPCURRENTALLOCS
()
{
fprintf
(
stderr
,
"hello world
\n
"
);
VALGRIND_PRINTF
(
"=== start memcheck dump of active allocations ===
\n
"
);
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
VALGRIND_DO_LEAK_CHECK
;
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
# pragma GCC diagnostic pop
#endif
VALGRIND_PRINTF
(
"=== end memcheck dump of active allocations ===
\n
"
);
}
#endif
/*****************************************************************************/
/*****************************************************************************/
/* SignalHandlerFunction */
/* SignalHandlerFunction */
...
@@ -942,11 +973,19 @@ void SignalHandlerFunction(int Signal)
...
@@ -942,11 +973,19 @@ void SignalHandlerFunction(int Signal)
case
SIGINT
:
case
SIGINT
:
case
SIGTERM
:
case
SIGTERM
:
case
SIGQUIT
:
case
SIGQUIT
:
case
SIGHUP
:
case
SIGHUP
:
Info
.
Signal
=
osl_Signal_Terminate
;
Info
.
Signal
=
osl_Signal_Terminate
;
break
;
break
;
#if defined(HAVE_MEMCHECK_H)
case
SIGUSR2
:
if
(
RUNNING_ON_VALGRIND
)
DUMPCURRENTALLOCS
();
Info
.
Signal
=
osl_Signal_System
;
break
;
#endif
default:
default:
Info
.
Signal
=
osl_Signal_System
;
Info
.
Signal
=
osl_Signal_System
;
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment