public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Baojun Wang <wangbj@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-help@sourceware.org
Subject: Re: dlmopen in LD_PRELOAD
Date: Fri, 21 Jun 2019 14:11:00 -0000	[thread overview]
Message-ID: <CAC+a-TYb_7EF1fZsBx-SNkTk4UEuLutbvG29dZcooxrp4rge6w@mail.gmail.com> (raw)
In-Reply-To: <87a7ebxihi.fsf@oldenburg2.str.redhat.com>

I believe so, was using glibc-2.27 from ubuntu 18.04 LTS.
Would you try with commit df58c5f3f328110c3e64ebbe667764185909d180 (or git
pull)? I made some mistake in some early commit.

Thanks
Baojun

On Fri, Jun 21, 2019 at 7:53 AM Florian Weimer <fweimer@redhat.com> wrote:

> * Baojun Wang:
>
> > Hi Florian,
> >
> > (re-send because previous email failed to send due to attachment)
> >
> > I made a tiny project this issue, it didn't show the same failure,
> however it did segfaults inside the library being `dlmopen`-ed.
> >
> > link: `git clone https://github.com/wangbj/dlns-test.git`
> <https://github.com/wangbj/dlns-test.git>
> > (sorry attachment seems to cause failure to send message)
> >
> > run.c: an launcher to inject DSOs.
> > preload.c: a mini loader using LD_PRELOAD -> dlmopen
> > dlns.c: DSO being `dlmopen`-ed
> > app.c: app being injected with DSOs.
> >
> > running `make test` should reproduce the issue. (need to run `ulimit
> > -c unlimited` to get core dump).
>
> Sorry, for me, it does not.
>
> This is the output I get:
>
> ./run libpreload.so libdlns.so ./app
> open /tmp/dlns-test/libdlns.so
> dlns_init
> [link_map] dso: /tmp/dlns-test/libdlns.so, loaded at: 0x7f0ca0d53000,
> _DYNAMIC: 0x7f0ca0d56de8
> [link_map] dso: /lib64/libdl.so.2, loaded at: 0x7f0ca0d4d000, _DYNAMIC:
> 0x7f0ca0d51d70
> [link_map] dso: /lib64/libpthread.so.0, loaded at: 0x7f0ca0b12000,
> _DYNAMIC: 0x7f0ca0b2dd60
> [link_map] dso: /lib64/libc.so.6, loaded at: 0x7f0ca094c000, _DYNAMIC:
> 0x7f0ca0b0bb60
> [link_map] dso: /lib64/ld-linux-x86-64.so.2, loaded at: (nil), _DYNAMIC:
> (nil)
> #1 local_getpid addr = 0x401610
> #0 local_getpid addr = 0x401610
> #2 local_getpid addr = 0x401610
> #3 local_getpid addr = 0x401610
> #1 local_getpid: 0
> #1 local_getpid: 0
> #1 my own tls: 1234
> #2 local_getpid: 0
> #2 local_getpid: 0
> #3 local_getpid: 0
> #3 local_getpid: 0
> #3 my own tls: 1234
> #2 my own tls: 1234
> #0 local_getpid: 0
> #0 local_getpid: 0
> #0 my own tls: 1234
>
> Has your glibc been built with --enable-bind-now?
>
> Thanks,
> Florian
>

  reply	other threads:[~2019-06-21 14:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 18:06 Baojun Wang
2019-06-17 18:40 ` Florian Weimer
2019-06-17 18:55   ` Baojun Wang
2019-06-17 18:58     ` Baojun Wang
2019-06-17 19:02     ` Florian Weimer
2019-06-18  4:15       ` Baojun Wang
2019-06-21 11:53         ` Florian Weimer
2019-06-21 14:11           ` Baojun Wang [this message]
2019-06-21 16:11             ` Florian Weimer
2019-06-21 20:23               ` Baojun Wang
2019-07-04 13:22                 ` Florian Weimer
2019-07-05 18:21         ` Florian Weimer
2019-07-05 18:26           ` Baojun Wang

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=CAC+a-TYb_7EF1fZsBx-SNkTk4UEuLutbvG29dZcooxrp4rge6w@mail.gmail.com \
    --to=wangbj@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    /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).