mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] getpwuid() calls getline() which may be redefined
@ 2023-04-17 16:50 Robert Clausecker
  2023-04-17 19:39 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Clausecker @ 2023-04-17 16:50 UTC (permalink / raw)
  To: musl

Greetings,

I'm the maintainer of schilytools [1], a suite of tools including
cdrecord, mkisofs, star, smake, and others.  To produce Linux
binary releases for our users, I investigated building static
binaries with musl and found that the star command experienced
problems [3]: when built with

    smake LINKMODE=static LDOPTX=-static INS_RBASE=/opt/schily SHLIB_BUILD=\#

the program hangs reading from stdin.  With the help of psykose
from your IRC channel, we found that this is due to getpwuid()
calling getline(), a symbol which this program uses for a custom
function with a POSIX-incompatible signature.  This use of the
getline() symbol dates back to UNOS [2], an early UNIX close.

We'll try to work around this issue, likely by renaming our
getline() to something else.  I have filed this bug report with
you so you may decide if you wish to route the getline() call
through an internal symbol alias, proofing your library against
incompatible external redefinitions.

Yours,
Robert Clausecker

[1]: https://codeberg.org/schilytools/schilytools
[2]: https://en.wikipedia.org/wiki/UNOS_(operating_system)
[3]: https://codeberg.org/schilytools/schilytools/issues/31

-- 
()  ascii ribbon campaign - for an 8-bit clean world 
/\  - against html email  - against proprietary attachments

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [musl] getpwuid() calls getline() which may be redefined
  2023-04-17 16:50 [musl] getpwuid() calls getline() which may be redefined Robert Clausecker
@ 2023-04-17 19:39 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2023-04-17 19:39 UTC (permalink / raw)
  To: Robert Clausecker; +Cc: musl

On Mon, Apr 17, 2023 at 06:50:06PM +0200, Robert Clausecker wrote:
> Greetings,
> 
> I'm the maintainer of schilytools [1], a suite of tools including
> cdrecord, mkisofs, star, smake, and others.  To produce Linux
> binary releases for our users, I investigated building static
> binaries with musl and found that the star command experienced
> problems [3]: when built with
> 
>     smake LINKMODE=static LDOPTX=-static INS_RBASE=/opt/schily SHLIB_BUILD=\#
> 
> the program hangs reading from stdin.  With the help of psykose
> from your IRC channel, we found that this is due to getpwuid()
> calling getline(), a symbol which this program uses for a custom
> function with a POSIX-incompatible signature.  This use of the
> getline() symbol dates back to UNOS [2], an early UNIX close.
> 
> We'll try to work around this issue, likely by renaming our
> getline() to something else.  I have filed this bug report with
> you so you may decide if you wish to route the getline() call
> through an internal symbol alias, proofing your library against
> incompatible external redefinitions.

Thanks for the report. getline has been POSIX for 15 years now, and we
don't aim for namespace-conformance to non-latest versions of the
standard. Namespace-guarded symbols are only used where we want to
implement one function in terms of another whose name isn't reserved
under the same standards-profile. Just renaming the function on the
application side to bring it up to modern standards is the right fix
here. (And it's good to hear somebody's still maintaining Schilly's
stuff!)

Rich

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-17 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 16:50 [musl] getpwuid() calls getline() which may be redefined Robert Clausecker
2023-04-17 19:39 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).