projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: statedump: invalid read during iter_end
[lttng-ust.git]
/
src
/
lib
/
lttng-ust
/
lttng-ust-statedump.c
diff --git
a/src/lib/lttng-ust/lttng-ust-statedump.c
b/src/lib/lttng-ust/lttng-ust-statedump.c
index 31626f8c5fc4d614f7255f6f47b6159844e964b7..309a98fa2201243913dbf09fcc16c8e2ae134338 100644
(file)
--- a/
src/lib/lttng-ust/lttng-ust-statedump.c
+++ b/
src/lib/lttng-ust/lttng-ust-statedump.c
@@
-24,11
+24,14
@@
#include "common/getenv.h"
#include "lib/lttng-ust/events.h"
#include "common/getenv.h"
#include "lib/lttng-ust/events.h"
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_HIDDEN_DEFINITION
+#define LTTNG_UST_TRACEPOINT_PROVIDER_HIDDEN_DEFINITION
+
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_lib.h" /* Only define. */
#include "ust_lib.h" /* Only define. */
-#define TRACEPOINT_CREATE_PROBES
-#define TP_SESSION_CHECK
+#define
LTTNG_UST_
TRACEPOINT_CREATE_PROBES
+#define
LTTNG_UST_
TP_SESSION_CHECK
#include "lttng-ust-statedump-provider.h" /* Define and create probes. */
struct dl_iterate_data {
#include "lttng-ust-statedump-provider.h" /* Define and create probes. */
struct dl_iterate_data {
@@
-60,7
+63,7
@@
struct lttng_ust_dl_node {
#define UST_DL_STATE_HASH_BITS 8
#define UST_DL_STATE_TABLE_SIZE (1 << UST_DL_STATE_HASH_BITS)
#define UST_DL_STATE_HASH_BITS 8
#define UST_DL_STATE_TABLE_SIZE (1 << UST_DL_STATE_HASH_BITS)
-struct cds_hlist_head dl_state_table[UST_DL_STATE_TABLE_SIZE];
+st
atic st
ruct cds_hlist_head dl_state_table[UST_DL_STATE_TABLE_SIZE];
typedef void (*tracepoint_cb)(struct lttng_ust_session *session, void *priv);
typedef void (*tracepoint_cb)(struct lttng_ust_session *session, void *priv);
@@
-420,10
+423,10
@@
void iter_end(struct dl_iterate_data *data, void *ip)
*/
for (i = 0; i < UST_DL_STATE_TABLE_SIZE; i++) {
struct cds_hlist_head *head;
*/
for (i = 0; i < UST_DL_STATE_TABLE_SIZE; i++) {
struct cds_hlist_head *head;
- struct lttng_ust_dl_node *e;
+ struct lttng_ust_dl_node *e
, *tmp
;
head = &dl_state_table[i];
head = &dl_state_table[i];
- cds_hlist_for_each_entry_
2(e
, head, node) {
+ cds_hlist_for_each_entry_
safe_2(e, tmp
, head, node) {
if (e->marked) {
if (!e->traced) {
trace_lib_load(&e->bin_data, ip);
if (e->marked) {
if (!e->traced) {
trace_lib_load(&e->bin_data, ip);
@@
-551,10
+554,10
@@
void lttng_ust_dl_update(void *ip)
return;
/*
return;
/*
- * F
ixup lttng-ust TLS when called from dlopen/dlclose
- * instrumentation.
+ * F
orce the allocation of lttng-ust TLS variables when called from
+ *
dlopen/dlclose
instrumentation.
*/
*/
- lttng_ust_
fixup
_tls();
+ lttng_ust_
alloc
_tls();
data.exec_found = 0;
data.first = true;
data.exec_found = 0;
data.first = true;
@@
-630,7
+633,7
@@
void lttng_ust_statedump_init(void)
{
lttng_ust__tracepoints__init();
lttng_ust__tracepoints__ptrs_init();
{
lttng_ust__tracepoints__init();
lttng_ust__tracepoints__ptrs_init();
-
__lttng_ust
_events_init__lttng_ust_statedump();
+
lttng_ust_
_events_init__lttng_ust_statedump();
lttng_ust_dl_update(LTTNG_UST_CALLER_IP());
}
lttng_ust_dl_update(LTTNG_UST_CALLER_IP());
}
@@
-652,7
+655,7
@@
void ust_dl_state_destroy(void)
void lttng_ust_statedump_destroy(void)
{
void lttng_ust_statedump_destroy(void)
{
-
__lttng_ust
_events_exit__lttng_ust_statedump();
+
lttng_ust_
_events_exit__lttng_ust_statedump();
lttng_ust__tracepoints__ptrs_destroy();
lttng_ust__tracepoints__destroy();
ust_dl_state_destroy();
lttng_ust__tracepoints__ptrs_destroy();
lttng_ust__tracepoints__destroy();
ust_dl_state_destroy();
This page took
0.025811 seconds
and
4
git commands to generate.