]> sourceware.org Git - systemtap.git/commitdiff
stapdyn: fix the context->data_index
authorJosh Stone <jistone@redhat.com>
Tue, 12 Mar 2013 02:01:27 +0000 (19:01 -0700)
committerJosh Stone <jistone@redhat.com>
Tue, 12 Mar 2013 02:01:27 +0000 (19:01 -0700)
This regressed in commit c08bf9de, which lost the initialization of that
field.  Thus there was a data race in pmaps, stats, etc. in writing to
data_index 0, rather than the true index of the currently-owned context.

runtime/dyninst/runtime_context.h

index 60e61f7b9044122c12336670a2de8073debf2c1e..ebbcec0b1006772575978a3dc90e2c24087dc566 100644 (file)
@@ -45,6 +45,7 @@ static int _stp_runtime_contexts_alloc(void)
     for (i = 0; i < _stp_runtime_num_contexts; i++) {
        int rc;
        struct context *c = stp_session_context(i);
+       c->data_index = i;
        rc = stp_pthread_mutex_init_shared(&c->lock);
        if (rc != 0) {
            _stp_error("context mutex initialization failed");
This page took 0.028034 seconds and 5 git commands to generate.