Re: librt symbol versioning breakage (was Re: Build failure, undefined reference to __mq_oshandle)

2015-12-04 Thread Konstantin Belousov
On Thu, Dec 03, 2015 at 10:34:10PM -0500, Daniel Eischen wrote:
> On Mon, 30 Nov 2015, Konstantin Belousov wrote:
> 
> > On Sun, Nov 29, 2015 at 12:27:40PM -0500, Daniel Eischen wrote:
> >> On Sun, 29 Nov 2015, Konstantin Belousov wrote:
> >>
> >>> On Sun, Nov 29, 2015 at 01:23:04AM -0500, Daniel Eischen wrote:
> 
>  So I found out that sometime in the last year or so, symbol versioning
>  for librt was broken and leaking symbols that shouldn't have been
>  leaked.  I've just committed a fix for this.
> 
>  Do a 'readelf -sw /usr/lib/librt.so.1 | grep GLOBAL | grep -v UND'
>  and see the non FBSD_foo symbols that shouldn't be there.
> >>>
> >>> I did the following on the librt from the HEAD of about month ago:
> >>>
> >>> pooma% ls -l netboot/sandy/usr/lib/librt.so.1
> >>> -r--r--r--  1 root  wheel  23704 Oct 24 23:35 
> >>> netboot/sandy/usr/lib/librt.so.1
> >>>
> >>> pooma% readelf -sw netboot/sandy/usr/lib/librt.so.1 | grep GLOBAL | grep 
> >>> -v UND | grep -v FBSDpriv | grep FBSD
> >>>97:  0 OBJECT  GLOBAL DEFAULT  ABS FBSD_1.0
> >>>
> >>> But I think that your commit is the good change.
> >>
> >>
> >> Can you check librt.so.1 in your buildworld temporary build
> >> environment?
> >>
> >>$ readelf -sW /usr/obj/usr/FreeBSD/svn/src/tmp/usr/lib/librt.so.1 \
> >>   grep -v UND | grep GLOBAL
> >>
> >> There has to be a reason that tests/sys/mqueue/mqtest[3-4].c build
> >> without error when they reference __mq_oshandle.  That symbol is
> >> not exported from librt.
> >>
> >> Hmm, looks like libc and libthr are also the same (leaky) in the
> >> temporary build environment (TBE).  So something broke when building
> >> the TBE libraries.
> >>
> >> For r277320 on my system Jan 19, 2015, the TBE libraries must have
> >> been built correctly because mqtests[3-4] failed with unresolved
> >> references to __mq_oshandle.
> >
> > In fact, my command was wrong.  I see that there are indeed a lot of symbols
> > exported which are not versioned (this is where my command was wrong, the
> > grep FBSD part), even for the installed librt.
> 
> Arrgh, this bug also seems to have slipped into 10-stable.
> 
> $ uname -a
> FreeBSD  10.1-RELEASE-p9 FreeBSD 10.1-RELEASE-p9 #0: Tue Apr  7 
> 01:09:46 UTC 2015 
> r...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
> $ readelf -sW /usr/lib/librt.so.1 | grep -v UND | grep GLOBAL \
>| grep -v FBSD
>  71: 3ac0   432 FUNCGLOBAL DEFAULT   12 __sigev_alloc
>  ...
> $ readelf -sW /usr/lib/librt.so.1 | grep -v UND | grep GLOBAL \
>| grep -v FBSD | wc -l
>22

Yes, I did my check on stable/10 FWIW.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: librt symbol versioning breakage (was Re: Build failure, undefined reference to __mq_oshandle)

2015-12-03 Thread Daniel Eischen

On Mon, 30 Nov 2015, Konstantin Belousov wrote:


On Sun, Nov 29, 2015 at 12:27:40PM -0500, Daniel Eischen wrote:

On Sun, 29 Nov 2015, Konstantin Belousov wrote:


On Sun, Nov 29, 2015 at 01:23:04AM -0500, Daniel Eischen wrote:


So I found out that sometime in the last year or so, symbol versioning
for librt was broken and leaking symbols that shouldn't have been
leaked.  I've just committed a fix for this.

Do a 'readelf -sw /usr/lib/librt.so.1 | grep GLOBAL | grep -v UND'
and see the non FBSD_foo symbols that shouldn't be there.


I did the following on the librt from the HEAD of about month ago:

pooma% ls -l netboot/sandy/usr/lib/librt.so.1
-r--r--r--  1 root  wheel  23704 Oct 24 23:35 netboot/sandy/usr/lib/librt.so.1

pooma% readelf -sw netboot/sandy/usr/lib/librt.so.1 | grep GLOBAL | grep -v UND 
| grep -v FBSDpriv | grep FBSD
   97:  0 OBJECT  GLOBAL DEFAULT  ABS FBSD_1.0

But I think that your commit is the good change.



Can you check librt.so.1 in your buildworld temporary build
environment?

   $ readelf -sW /usr/obj/usr/FreeBSD/svn/src/tmp/usr/lib/librt.so.1 \
  grep -v UND | grep GLOBAL

There has to be a reason that tests/sys/mqueue/mqtest[3-4].c build
without error when they reference __mq_oshandle.  That symbol is
not exported from librt.

Hmm, looks like libc and libthr are also the same (leaky) in the
temporary build environment (TBE).  So something broke when building
the TBE libraries.

For r277320 on my system Jan 19, 2015, the TBE libraries must have
been built correctly because mqtests[3-4] failed with unresolved
references to __mq_oshandle.


In fact, my command was wrong.  I see that there are indeed a lot of symbols
exported which are not versioned (this is where my command was wrong, the
grep FBSD part), even for the installed librt.


Arrgh, this bug also seems to have slipped into 10-stable.

$ uname -a
FreeBSD  10.1-RELEASE-p9 FreeBSD 10.1-RELEASE-p9 #0: Tue Apr  7 
01:09:46 UTC 2015 
r...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

$ readelf -sW /usr/lib/librt.so.1 | grep -v UND | grep GLOBAL \
  | grep -v FBSD
71: 3ac0   432 FUNCGLOBAL DEFAULT   12 __sigev_alloc
...
$ readelf -sW /usr/lib/librt.so.1 | grep -v UND | grep GLOBAL \
  | grep -v FBSD | wc -l
  22

--
DE
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: librt symbol versioning breakage (was Re: Build failure, undefined reference to __mq_oshandle)

2015-11-30 Thread Konstantin Belousov
On Sun, Nov 29, 2015 at 12:27:40PM -0500, Daniel Eischen wrote:
> On Sun, 29 Nov 2015, Konstantin Belousov wrote:
> 
> > On Sun, Nov 29, 2015 at 01:23:04AM -0500, Daniel Eischen wrote:
> >> On Fri, 27 Nov 2015, Daniel Eischen wrote:
> >>
> >>> Damn, please use deisc...@freebsd.org for replies.
> >>>
> >>> On Fri, 27 Nov 2015, Daniel Eischen wrote:
> >>>
>  On Fri, 27 Nov 2015, Daniel Eischen wrote:
> 
> > $ uname -a
> > FreeBSD vega 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r277320: Mon Jan 19
> > 09:02:50 EST 2015
> > deischen@vega:/usr/FreeBSD/svn/obj/usr/FreeBSD/svn/src/sys/vega  amd64
> >
> > Upgrading to today's current, 'rm -rf /usr/obj/*; make -j8 buildworld'
> > fails here:
> >
> > ===> lib/libc/tests/gen/execve (buildconfig)
> > --- all_subdir_tests ---
> > --- all_subdir_mqueue ---
> > mqtest3.o: In function `main':
> > /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x139): undefined
> > reference to `__mq_oshandle'
> > /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x14c): undefined
> > reference to `__mq_oshandle'
> > /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x16c): undefined
> > reference to `__mq_oshandle'
> > /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x3e6): undefined
> > reference to `__mq_oshandle'
> > /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x3f9): undefined
> > reference to `__mq_oshandle'
> > mqtest3.o:/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x40f):
> > more undefined references to `__mq_oshandle' follow
> > cc: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> >
> > Going to try make [-j1], next, but anyone come across this?
> 
>  Still fails.
> 
>  Why do the tests in tests/sys/mqueue/ try to use non-public APIs?
> >>
> >> So I found out that sometime in the last year or so, symbol versioning
> >> for librt was broken and leaking symbols that shouldn't have been
> >> leaked.  I've just committed a fix for this.
> >>
> >> Do a 'readelf -sw /usr/lib/librt.so.1 | grep GLOBAL | grep -v UND'
> >> and see the non FBSD_foo symbols that shouldn't be there.
> >
> > I did the following on the librt from the HEAD of about month ago:
> >
> > pooma% ls -l netboot/sandy/usr/lib/librt.so.1
> > -r--r--r--  1 root  wheel  23704 Oct 24 23:35 
> > netboot/sandy/usr/lib/librt.so.1
> >
> > pooma% readelf -sw netboot/sandy/usr/lib/librt.so.1 | grep GLOBAL | grep -v 
> > UND | grep -v FBSDpriv | grep FBSD
> >97:  0 OBJECT  GLOBAL DEFAULT  ABS FBSD_1.0
> >
> > But I think that your commit is the good change.
> 
> 
> Can you check librt.so.1 in your buildworld temporary build
> environment?
> 
>$ readelf -sW /usr/obj/usr/FreeBSD/svn/src/tmp/usr/lib/librt.so.1 \
>   grep -v UND | grep GLOBAL
> 
> There has to be a reason that tests/sys/mqueue/mqtest[3-4].c build
> without error when they reference __mq_oshandle.  That symbol is
> not exported from librt.
> 
> Hmm, looks like libc and libthr are also the same (leaky) in the
> temporary build environment (TBE).  So something broke when building
> the TBE libraries.
> 
> For r277320 on my system Jan 19, 2015, the TBE libraries must have
> been built correctly because mqtests[3-4] failed with unresolved
> references to __mq_oshandle.

In fact, my command was wrong.  I see that there are indeed a lot of symbols
exported which are not versioned (this is where my command was wrong, the
grep FBSD part), even for the installed librt.

Your patch fixed the issue.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: librt symbol versioning breakage (was Re: Build failure, undefined reference to __mq_oshandle)

2015-11-29 Thread Konstantin Belousov
On Sun, Nov 29, 2015 at 01:23:04AM -0500, Daniel Eischen wrote:
> On Fri, 27 Nov 2015, Daniel Eischen wrote:
> 
> > Damn, please use deisc...@freebsd.org for replies.
> >
> > On Fri, 27 Nov 2015, Daniel Eischen wrote:
> >
> >> On Fri, 27 Nov 2015, Daniel Eischen wrote:
> >> 
> >>> $ uname -a
> >>> FreeBSD vega 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r277320: Mon Jan 19 
> >>> 09:02:50 EST 2015 
> >>> deischen@vega:/usr/FreeBSD/svn/obj/usr/FreeBSD/svn/src/sys/vega  amd64
> >>> 
> >>> Upgrading to today's current, 'rm -rf /usr/obj/*; make -j8 buildworld'
> >>> fails here:
> >>> 
> >>> ===> lib/libc/tests/gen/execve (buildconfig)
> >>> --- all_subdir_tests ---
> >>> --- all_subdir_mqueue ---
> >>> mqtest3.o: In function `main':
> >>> /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x139): undefined 
> >>> reference to `__mq_oshandle'
> >>> /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x14c): undefined 
> >>> reference to `__mq_oshandle'
> >>> /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x16c): undefined 
> >>> reference to `__mq_oshandle'
> >>> /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x3e6): undefined 
> >>> reference to `__mq_oshandle'
> >>> /usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x3f9): undefined 
> >>> reference to `__mq_oshandle'
> >>> mqtest3.o:/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x40f): 
> >>> more undefined references to `__mq_oshandle' follow
> >>> cc: error: linker command failed with exit code 1 (use -v to see 
> >>> invocation)
> >>> 
> >>> Going to try make [-j1], next, but anyone come across this?
> >> 
> >> Still fails.
> >> 
> >> Why do the tests in tests/sys/mqueue/ try to use non-public APIs?
> 
> So I found out that sometime in the last year or so, symbol versioning
> for librt was broken and leaking symbols that shouldn't have been
> leaked.  I've just committed a fix for this.
> 
> Do a 'readelf -sw /usr/lib/librt.so.1 | grep GLOBAL | grep -v UND'
> and see the non FBSD_foo symbols that shouldn't be there.

I did the following on the librt from the HEAD of about month ago:

 pooma% ls -l netboot/sandy/usr/lib/librt.so.1
-r--r--r--  1 root  wheel  23704 Oct 24 23:35 netboot/sandy/usr/lib/librt.so.1

pooma% readelf -sw netboot/sandy/usr/lib/librt.so.1 | grep GLOBAL | grep -v UND 
| grep -v FBSDpriv | grep FBSD 
97:  0 OBJECT  GLOBAL DEFAULT  ABS FBSD_1.0

But I think that your commit is the good change.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: librt symbol versioning breakage (was Re: Build failure, undefined reference to __mq_oshandle)

2015-11-29 Thread Daniel Eischen

On Sun, 29 Nov 2015, Konstantin Belousov wrote:


On Sun, Nov 29, 2015 at 01:23:04AM -0500, Daniel Eischen wrote:

On Fri, 27 Nov 2015, Daniel Eischen wrote:


Damn, please use deisc...@freebsd.org for replies.

On Fri, 27 Nov 2015, Daniel Eischen wrote:


On Fri, 27 Nov 2015, Daniel Eischen wrote:


$ uname -a
FreeBSD vega 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r277320: Mon Jan 19
09:02:50 EST 2015
deischen@vega:/usr/FreeBSD/svn/obj/usr/FreeBSD/svn/src/sys/vega  amd64

Upgrading to today's current, 'rm -rf /usr/obj/*; make -j8 buildworld'
fails here:

===> lib/libc/tests/gen/execve (buildconfig)
--- all_subdir_tests ---
--- all_subdir_mqueue ---
mqtest3.o: In function `main':
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x139): undefined
reference to `__mq_oshandle'
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x14c): undefined
reference to `__mq_oshandle'
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x16c): undefined
reference to `__mq_oshandle'
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x3e6): undefined
reference to `__mq_oshandle'
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x3f9): undefined
reference to `__mq_oshandle'
mqtest3.o:/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x40f):
more undefined references to `__mq_oshandle' follow
cc: error: linker command failed with exit code 1 (use -v to see
invocation)

Going to try make [-j1], next, but anyone come across this?


Still fails.

Why do the tests in tests/sys/mqueue/ try to use non-public APIs?


So I found out that sometime in the last year or so, symbol versioning
for librt was broken and leaking symbols that shouldn't have been
leaked.  I've just committed a fix for this.

Do a 'readelf -sw /usr/lib/librt.so.1 | grep GLOBAL | grep -v UND'
and see the non FBSD_foo symbols that shouldn't be there.


I did the following on the librt from the HEAD of about month ago:

pooma% ls -l netboot/sandy/usr/lib/librt.so.1
-r--r--r--  1 root  wheel  23704 Oct 24 23:35 netboot/sandy/usr/lib/librt.so.1

pooma% readelf -sw netboot/sandy/usr/lib/librt.so.1 | grep GLOBAL | grep -v UND 
| grep -v FBSDpriv | grep FBSD
   97:  0 OBJECT  GLOBAL DEFAULT  ABS FBSD_1.0

But I think that your commit is the good change.



Can you check librt.so.1 in your buildworld temporary build
environment?

  $ readelf -sW /usr/obj/usr/FreeBSD/svn/src/tmp/usr/lib/librt.so.1 \
 grep -v UND | grep GLOBAL

There has to be a reason that tests/sys/mqueue/mqtest[3-4].c build
without error when they reference __mq_oshandle.  That symbol is
not exported from librt.

Hmm, looks like libc and libthr are also the same (leaky) in the
temporary build environment (TBE).  So something broke when building
the TBE libraries.

For r277320 on my system Jan 19, 2015, the TBE libraries must have
been built correctly because mqtests[3-4] failed with unresolved
references to __mq_oshandle.

--
DE
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


librt symbol versioning breakage (was Re: Build failure, undefined reference to __mq_oshandle)

2015-11-28 Thread Daniel Eischen

On Fri, 27 Nov 2015, Daniel Eischen wrote:


Damn, please use deisc...@freebsd.org for replies.

On Fri, 27 Nov 2015, Daniel Eischen wrote:


On Fri, 27 Nov 2015, Daniel Eischen wrote:


$ uname -a
FreeBSD vega 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r277320: Mon Jan 19 
09:02:50 EST 2015 
deischen@vega:/usr/FreeBSD/svn/obj/usr/FreeBSD/svn/src/sys/vega  amd64


Upgrading to today's current, 'rm -rf /usr/obj/*; make -j8 buildworld'
fails here:

===> lib/libc/tests/gen/execve (buildconfig)
--- all_subdir_tests ---
--- all_subdir_mqueue ---
mqtest3.o: In function `main':
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x139): undefined 
reference to `__mq_oshandle'
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x14c): undefined 
reference to `__mq_oshandle'
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x16c): undefined 
reference to `__mq_oshandle'
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x3e6): undefined 
reference to `__mq_oshandle'
/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x3f9): undefined 
reference to `__mq_oshandle'
mqtest3.o:/usr/FreeBSD/svn/src/tests/sys/mqueue/mqtest3.c:(.text+0x40f): 
more undefined references to `__mq_oshandle' follow
cc: error: linker command failed with exit code 1 (use -v to see 
invocation)


Going to try make [-j1], next, but anyone come across this?


Still fails.

Why do the tests in tests/sys/mqueue/ try to use non-public APIs?


So I found out that sometime in the last year or so, symbol versioning
for librt was broken and leaking symbols that shouldn't have been
leaked.  I've just committed a fix for this.

Do a 'readelf -sw /usr/lib/librt.so.1 | grep GLOBAL | grep -v UND'
and see the non FBSD_foo symbols that shouldn't be there.

--
DE
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"