Re: RTLD_DEEPBIND question

2025-05-16 Thread Konstantin Belousov
On Fri, May 16, 2025 at 10:11:12AM -0400, Mark Johnston wrote: > On Fri, May 16, 2025 at 03:22:52PM +0300, Andriy Gapon wrote: > > On 27/04/2025 17:26, Mark Johnston wrote: > > > On Thu, Apr 24, 2025 at 08:56:44AM +0300, Andriy Gapon wrote: > > > > On 23/04/2025 21:56, Andriy Gapon wrote: > > > > >

Re: RTLD_DEEPBIND question

2025-05-16 Thread Mark Johnston
On Fri, May 16, 2025 at 03:22:52PM +0300, Andriy Gapon wrote: > On 27/04/2025 17:26, Mark Johnston wrote: > > On Thu, Apr 24, 2025 at 08:56:44AM +0300, Andriy Gapon wrote: > > > On 23/04/2025 21:56, Andriy Gapon wrote: > > > > BTW, I've been wondering how illumos avoids the problem even though they

Re: RTLD_DEEPBIND question

2025-05-16 Thread Andriy Gapon
On 27/04/2025 17:26, Mark Johnston wrote: On Thu, Apr 24, 2025 at 08:56:44AM +0300, Andriy Gapon wrote: On 23/04/2025 21:56, Andriy Gapon wrote: BTW, I've been wondering how illumos avoids the problem even though they do not use any special dlopen flags. It turns out that they link almost all s

Re: RTLD_DEEPBIND question

2025-04-27 Thread Mark Johnston
On Thu, Apr 24, 2025 at 08:56:44AM +0300, Andriy Gapon wrote: > On 23/04/2025 21:56, Andriy Gapon wrote: > > BTW, I've been wondering how illumos avoids the problem even though they > > do not use any special dlopen flags. > > It turns out that they link almost all system shared libraries with > >

Re: RTLD_DEEPBIND question

2025-04-23 Thread Andriy Gapon
On 23/04/2025 21:56, Andriy Gapon wrote: BTW, I've been wondering how illumos avoids the problem even though they do not use any special dlopen flags. It turns out that they link almost all system shared libraries with -Bdirect option (which is Solaris/illumos specific). It's somewhat similar t

Re: RTLD_DEEPBIND question

2025-04-23 Thread Konstantin Belousov
On Wed, Apr 23, 2025 at 09:09:56PM +0300, Andriy Gapon wrote: > On 19/04/2025 13:29, Konstantin Belousov wrote: > > On Sat, Apr 19, 2025 at 01:25:28PM +0300, Andriy Gapon wrote: > > > On 19/04/2025 12:39, Andriy Gapon wrote: > > > > From a quick look at the code, should we try to resolve the symb

Re: RTLD_DEEPBIND question

2025-04-23 Thread Andriy Gapon
On 19/04/2025 13:38, Konstantin Belousov wrote: And there is the version with the recursive marking by deepbind: I think that this patch would help with my case (haven't tested yet). But I am not sure if it would be "correct". First, as you have rightfully asked, it's not clear that deepbind s

Re: RTLD_DEEPBIND question

2025-04-23 Thread Andriy Gapon
On 19/04/2025 13:29, Konstantin Belousov wrote: On Sat, Apr 19, 2025 at 01:25:28PM +0300, Andriy Gapon wrote: On 19/04/2025 12:39, Andriy Gapon wrote: From a quick look at the code, should we try to resolve the symbol in refobj itself when it's marked with deepbind? Oh, and it looks like obj

Re: RTLD_DEEPBIND question

2025-04-19 Thread Konstantin Belousov
On Sat, Apr 19, 2025 at 01:29:15PM +0300, Konstantin Belousov wrote: > On Sat, Apr 19, 2025 at 01:25:28PM +0300, Andriy Gapon wrote: > > On 19/04/2025 12:39, Andriy Gapon wrote: > > > On 19/04/2025 12:25, Andriy Gapon wrote: > > > > On 19/04/2025 02:41, Konstantin Belousov wrote: > > > > > RTLD_DEE

Re: RTLD_DEEPBIND question

2025-04-19 Thread Konstantin Belousov
On Sat, Apr 19, 2025 at 01:25:28PM +0300, Andriy Gapon wrote: > On 19/04/2025 12:39, Andriy Gapon wrote: > > On 19/04/2025 12:25, Andriy Gapon wrote: > > > On 19/04/2025 02:41, Konstantin Belousov wrote: > > > > RTLD_DEEPBIND works by first iterating over all (recursive) DT_NEEEDED > > > > object f

Re: RTLD_DEEPBIND question

2025-04-19 Thread Andriy Gapon
On 19/04/2025 12:39, Andriy Gapon wrote: On 19/04/2025 12:25, Andriy Gapon wrote: On 19/04/2025 02:41, Konstantin Belousov wrote: RTLD_DEEPBIND works by first iterating over all (recursive) DT_NEEEDED object for the object where the symbol is resolved, then by looking at the global list of load

Re: RTLD_DEEPBIND question

2025-04-19 Thread Andriy Gapon
On 19/04/2025 12:25, Andriy Gapon wrote: On 19/04/2025 02:41, Konstantin Belousov wrote: Could it be that the module is linked to the main binary? It does not appear to be so. The binary: $ ldd /usr/local/bin/mdb /usr/local/bin/mdb:     libncursesw.so.9 => /lib/libncursesw.so.9 (0xbf191c9

Re: RTLD_DEEPBIND question

2025-04-19 Thread Andriy Gapon
On 19/04/2025 02:41, Konstantin Belousov wrote: Could it be that the module is linked to the main binary? It does not appear to be so. The binary: $ ldd /usr/local/bin/mdb /usr/local/bin/mdb: libncursesw.so.9 => /lib/libncursesw.so.9 (0xbf191c93000) libtinfow.so.9 => /lib/libtin

Re: RTLD_DEEPBIND question

2025-04-18 Thread Konstantin Belousov
On Sat, Apr 19, 2025 at 01:03:15AM +0300, Andriy Gapon wrote: > > I am trying to understand if RTLD_DEEPBIND should help in the following > scenario or if I misunderstand its purpose. > > There is a program that has a parser based on lex/yacc, so there is function > yyparse in the code and global