public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: "Vivek Das Mohapatra" <vivek@collabora.com>, libc-help@sourceware.org
Cc: nd@arm.com
Subject: Re: A possible libc/dlmopen/pthreads bug
Date: Wed, 24 Jan 2018 16:52:00 -0000	[thread overview]
Message-ID: <41b64265-397f-1ead-dd79-50052b2d19af@arm.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1801241345460.22921@noise.cbg.collabora.co.uk>

On 24/01/18 13:59, Vivek Das Mohapatra wrote:
> Apologies for the exegesis: It seems to me that the copy of libc in the
> private namespace has somehow managed to scribble on the linked list
> pointed to by __stack_user, overwriting a key address.
> 
> Is my analysis correct? Is there something I could or should have done to
> avoid this?
> 
> A while ago (https://sourceware.org/ml/libc-help/2018-01/msg00002.html)
> I suggested a dlmopen flag RTLD_UNIQUE or similar which would cause the
> existing mapping of the target library in the main namespace/link-map to be
> re-used instead of creating a new one: I believe this would prevent this
> problem (and others detailed in that message) from occurring - any thoughts?

i don't know what you are doing, but it's hard to imagine
that two libcs (or libpthreads) would work in the same
process: if they can run code on the same thread they
cannot both control the tcb (and will clobber each other's
global state through that).

same for signal handlers (for internal signals) or
brk syscall, or stdio buffering, etc. the libc has to
deal with process global/thread local state that must
be controlled by the same code consistently otherwise
bad things happen.

  reply	other threads:[~2018-01-24 16:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 13:59 Vivek Das Mohapatra
2018-01-24 16:52 ` Szabolcs Nagy [this message]
2018-01-24 17:16   ` Vivek Das Mohapatra
2018-01-24 17:25   ` Adhemerval Zanella
2018-01-24 17:47     ` Vivek Das Mohapatra
2018-01-24 18:27       ` Adhemerval Zanella
2018-01-24 19:48         ` Carlos O'Donell
2018-01-24 21:49         ` Vivek Das Mohapatra
2018-01-24 20:08       ` Carlos O'Donell
2018-01-24 19:34     ` Szabolcs Nagy
2018-01-24 20:05       ` Adhemerval Zanella
2018-01-24 20:06       ` Carlos O'Donell
2018-01-24 20:31         ` Vivek Das Mohapatra
2018-01-24 17:08 ` Adhemerval Zanella
2018-01-24 17:19   ` Vivek Das Mohapatra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41b64265-397f-1ead-dd79-50052b2d19af@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=libc-help@sourceware.org \
    --cc=nd@arm.com \
    --cc=vivek@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).