This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv2] Protect _dl_profile_fixup data-dependency order [BZ #23690]
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot ibm dot com>
- Cc: "Carlos O'Donell" <carlos at redhat dot com>, libc-alpha at sourceware dot org, John David Anglin <dave dot anglin at bell dot net>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Joseph Myers <joseph at codesourcery dot com>, Florian Weimer <fweimer at redhat dot com>
- Date: Mon, 08 Oct 2018 21:28:09 +0200
- Subject: Re: [PATCHv2] Protect _dl_profile_fixup data-dependency order [BZ #23690]
- References: <2009c13b-169f-e476-6380-ffe4ceede9ac@redhat.com> <20181008191502.26499-1-tuliom@linux.ibm.com>
* Tulio Magno Quites Machado Filho:
> I suspect this patch doesn't address all the comments from v1.
> However, I believe some of the open questions/comments may not be
> necessary anymore after the latest changes.
>
> I've decided to not add the new test to xtests, because it executes in
> less than 3s in most of my tests. There is just a single case that
> takes up to 30s.
>
> Changes since v1:
>
> - Fixed the coding style issues.
> - Replaced atomic loads/store with memory fences.
> - Added a test.
I don't think the fences are correct, they still need to be combined
with relaxed MO loads and stores.
Does the issue that Carlos mentioned really show up in cross-builds?
> diff --git a/nptl/tst-audit-threads-mod1.c b/nptl/tst-audit-threads-mod1.c
> new file mode 100644
> index 0000000000..e2d3f78bae
> --- /dev/null
> +++ b/nptl/tst-audit-threads-mod1.c
> +la_version(unsigned int ver)
> +la_objopen(struct link_map *map, Lmid_t lmid, uintptr_t *cookie)
Style: missing space before (.
> diff --git a/nptl/tst-audit-threads.c b/nptl/tst-audit-threads.c
> new file mode 100644
> index 0000000000..93ddebaecb
> --- /dev/null
> +++ b/nptl/tst-audit-threads.c
> + /* Used to synchronize all the threads after calling each retNumN. */
> + pthread_barrier_init (&barrier, NULL, num_threads);
xpthread_barrier_init.
> + threads = (pthread_t *) malloc (num_threads * sizeof(pthread_t));
> + bzero (threads, num_threads * sizeof(pthread_t));
xcalloc or xmalloc. But bzero does not appear to be required.
> + for (i = 0; i < num_threads; i++)
> + pthread_create(threads + i, NULL, thread_main, NULL);
xpthread_create.
> + for (i = 0; i < num_threads; i++)
> + pthread_join(threads[i], NULL);
xpthread_join.
Rest looks okay.
Thanks,
Florian