That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's silly. You can have strlcat() and strlcpy(), yet be compatible
Posted May 20, 2009 17:23 UTC (Wed) by dwheeler (guest, #1216)In reply to: Re: EGLIBC: Not a fork, but a glibc distribution by nevyn
Parent article: EGLIBC: Not a fork, but a glibc distribution
That's silly. Eglibc could _add_ new functions without becoming incompatible with the existing glibc. I know of no technical argument that makes adding strlcat()/strlcpy() impossible for glibc. The only reason they're not in glibc is because Ulrich Drepper doesn't want to support them.
Posted May 20, 2009 17:44 UTC (Wed)
by sbishop (guest, #33061)
[Link] (15 responses)
Posted May 20, 2009 18:14 UTC (Wed)
by smurf (subscriber, #17840)
[Link] (12 responses)
IMHO, including those functions should be no-brainers. Seriously. Anybody care to summarize any technical arguments against them?
Posted May 20, 2009 18:25 UTC (Wed)
by dlang (guest, #313)
[Link]
there are a handful of apps that don't work, but _very_ few.
Posted May 20, 2009 18:38 UTC (Wed)
by elanthis (guest, #6227)
[Link] (10 responses)
Including strlcpy() in eglibc will do Linux application developers no more good than its inclusion into BSD libc. You still won't be able to use it everywhere and you'll still be required to include copies of it. If and when glibc proper supports it (which seems unlikely) then the Linux ecosystem on a larger whole will have it and people can start using it.
It's worth noting that the reasoning against strlcpy() is relatively valid. It isn't actually safe. It protects against buffer overflows, but what you really want to do is check before hand anyway and either error out or allocate a larger buffer, because truncated text in many contexts is just as much of a security issue as a buffer overrun, especially in cases where some kind of validation is done on the string before the copy is made. Even if it's not a security issue, in most cases the user is far better served by an error or warning about the truncated text than he is by just having his data silently cut off. Many people (including Drepper) believe that giving users strlcpy() is going to leave them just as lazy and will just shift software from one problem to another, instead of teaching them to Do It Right(tm) or even better just doing it right in the first place.
It is for that reason that people should consider making use of the glibc asprintf() and the standard strdup() functions instead of the BSD l-style functions.
Posted May 20, 2009 18:56 UTC (Wed)
by dlang (guest, #313)
[Link] (5 responses)
Posted May 20, 2009 22:15 UTC (Wed)
by msbrown (guest, #38262)
[Link] (3 responses)
Posted May 21, 2009 4:27 UTC (Thu)
by JoeBuck (subscriber, #2330)
[Link]
Posted May 21, 2009 11:11 UTC (Thu)
by ncm (guest, #165)
[Link] (1 responses)
Posted May 21, 2009 17:05 UTC (Thu)
by madscientist (subscriber, #16861)
[Link]
Posted May 21, 2009 0:11 UTC (Thu)
by dododge (guest, #2870)
[Link]
Posted May 21, 2009 10:09 UTC (Thu)
by nix (subscriber, #2304)
[Link]
C is a nice low-level language but should never be allowed near user data, IMHO. (Now, back to work for me, writing financial stuff in C which spends all its time getting near user data.)
Posted May 21, 2009 17:16 UTC (Thu)
by spitzak (guest, #4593)
[Link] (2 responses)
You seem to have missed the fact that strlcpy returns the size of the buffer that would be needed. You have a free test to see if the buffer needs to be reallocated. And if not, how about that, the copy is done, and you don't have to do another call!
The arguments againsts strl* are just stupid now. It is pretty obvious that it is what everybody wants.
Posted May 22, 2009 11:29 UTC (Fri)
by liljencrantz (guest, #28458)
[Link] (1 responses)
I don't know if that argument is true, but I did a quick grep of my s?bin-folders (Plain Ubuntu Handy Hardon system), and though there are a few dozen instances of programs that use strlcpy, none of them are running right now on my system, so for me personally, including them _would_ waste memory. Gimp, totem, and sftp uses it, though, and maybe the users of those applications are a majority. I honestly don't know.
Posted May 25, 2009 13:41 UTC (Mon)
by wawjohn (guest, #509)
[Link]
> Plain Ubuntu Handy Hardon system
Got any more 'corrected' names for other Ubuntu releases?
Posted May 21, 2009 10:50 UTC (Thu)
by alex (subscriber, #1355)
[Link] (1 responses)
Posted May 21, 2009 17:10 UTC (Thu)
by jschrod (subscriber, #1646)
[Link]
Posted May 20, 2009 18:01 UTC (Wed)
by xilun (guest, #50638)
[Link] (1 responses)
Posted May 21, 2009 4:30 UTC (Thu)
by JoeBuck (subscriber, #2330)
[Link]
Posted May 20, 2009 18:53 UTC (Wed)
by MisterIO (guest, #36192)
[Link] (18 responses)
Posted May 21, 2009 9:23 UTC (Thu)
by danpb (subscriber, #4831)
[Link] (17 responses)
Posted May 21, 2009 10:12 UTC (Thu)
by nix (subscriber, #2304)
[Link] (16 responses)
One complaint I really can't have about Ulrich is his commitment to a stable ABI. Yes, he's canned stuff in the past that has broken things like the JDK, but those were internal symbols exposed because the linker had no way to hide them at the time. The public interface really has maintained stability, right down to legacies of glibc's embryonic days like strfry()/memfrob() which have probably been used by about one person in the entire history of the world.
Posted May 21, 2009 12:50 UTC (Thu)
by liljencrantz (guest, #28458)
[Link] (15 responses)
Posted May 21, 2009 16:36 UTC (Thu)
by nevyn (guest, #33129)
[Link] (11 responses)
I've written patches for glibc that fixed bugs in functions pretty much every application uses, and have been accepted. I've spoken to people who have contributed even more.
I've yet to speak to _anyone_ who has anything better to say about working with Drepper than "he's actually an ok human being, if you meet him in real life".
To say I've contributed to glibc less because of Drepper, would be a vast understatement. It's been a running joke for a long time, that if you don't need to contribute to glibc don't ... and if you do, open a Red Hat Bugzilla so you just have to deal with Jakub.
The biggest problem I see with eglibc is that due to the compatibility requirements there are a large amount of things that can't be done. They really seem to be trying to stay very close to glibc, so the only thing it changes is that you can now s/Jakub/eglibc/ in the above.
Posted May 22, 2009 11:14 UTC (Fri)
by liljencrantz (guest, #28458)
[Link] (9 responses)
Other then that, I agree with your comment. Drepper is by default terse to the point of approaching continuous rudeness. When people try to waste his time, he will flame them. He even perceives people as wasting his time when they are actually making valid questions sometimes. He is hard to work with. Glibc would be better of if he wasn't.
But much like Theo, Drepper is an exceptional project leader when it comes to technical aspects. The most relevant question is, would glibc be better of without him? Would it be better if an average coder with good people skills was managing the project? My guess would be no, that all the combined lost contributions from other people are smaller in value than his contributions to Glibc. Same thing with Theo. On the other hand, my guess would be that Jörg Shilling and the XFree86-people fall on the other side of that line. But that's just me guessing.
Posted May 23, 2009 9:07 UTC (Sat)
by nix (subscriber, #2304)
[Link] (2 responses)
Did you really not see that?
Posted May 23, 2009 10:04 UTC (Sat)
by liljencrantz (guest, #28458)
[Link] (1 responses)
Posted May 23, 2009 11:37 UTC (Sat)
by nix (subscriber, #2304)
[Link]
I could dig up dozens of examples but it's too depressing and it's a bank
Posted May 23, 2009 9:22 UTC (Sat)
by nix (subscriber, #2304)
[Link] (5 responses)
He drops subsystems that he thinks are rarely used or that
relate to architectures he merely finds unpleasant (e.g. MIPS, ARM)
without listening to anyone pointing out that he might be wrong and
without saying why; more than once he's rejected contributions,
implemented them nearly identically himself some time later and credited
himself alone in NEWS (I suspect anyone working in academe decided never
to go near glibc again when that happened for the first time); he mostly
refuses to give rationales for technical rejections so that people can fix
whatever was wrong with their patches. Whether this is because he's scared
of being convinced otherwise or just arrogant I have no idea... but can
you imagine what would happen to the kernel, say, if it was run that way?
90% of the useful stuff we now have, maybe more, would simply not be
there.
He's such a hard maintainer to deal with that an entire mailing list was
created whose sole reason for existence was that it was somewhere where
people could talk about glibc without Ulrich growling at them every five
minutes for 'abusing' libc-alpha@ by, uh, discussing alpha releases of
glibc on it. I have never seen *that* in any other project.
Developers can be in a project to scratch their own itch: but I think
glibc is proof that large free software project maintainers need other
goals too. First and foremost I think they have to be driven by a desire
to make software that others can hack on easily and that does what users
want, and in both of these areas Ulrich falls down like a lead balloon
(especially when you note that glibc's users are random developers,
and we've seen how he treats them when they dare to ask for help with one
of his glibc-only totally-undocumented public APIs).
Posted May 23, 2009 10:15 UTC (Sat)
by liljencrantz (guest, #28458)
[Link] (3 responses)
As to dropping good patches and then reimplementing them himself while taking full credit, I had not heard such accusations before. Do you have any specific patch set in mind, something to validate this?
Posted May 23, 2009 11:51 UTC (Sat)
by nix (subscriber, #2304)
[Link]
Posted May 24, 2009 10:06 UTC (Sun)
by man_ls (guest, #15091)
[Link] (1 responses)
Posted May 24, 2009 11:45 UTC (Sun)
by nix (subscriber, #2304)
[Link]
Posted May 23, 2009 12:06 UTC (Sat)
by nix (subscriber, #2304)
[Link]
This is in effect the split that has long existed anyway: it's only that
Posted May 25, 2009 14:00 UTC (Mon)
by saffroy (guest, #43999)
[Link]
Posted May 21, 2009 21:19 UTC (Thu)
by nix (subscriber, #2304)
[Link] (2 responses)
It was implemented at the same time as a heap of K&R-related horrors and a
Posted May 22, 2009 10:59 UTC (Fri)
by liljencrantz (guest, #28458)
[Link] (1 responses)
I didn't know it was McGrath that implemented them, but it doesn't change the fact that Drepper is (IMO) well within his right to say that he does not wish to waste his time by partaking in the joke, and when people again and again try to force him to do so, he is well within his right be grumpy.
The guys that keep pushing the patch are like some nerds I know, who keep making jokes about something very nerdish, e.g. phasers or VAX systems, in a group of people completely indifferent to the subject. Nobody gets the joke, nobody laughs, but they keep pushing the joke, trying to explain why it's funny instead of just dropping it.
Posted May 23, 2009 9:04 UTC (Sat)
by nix (subscriber, #2304)
[Link]
Personally I think that's a rather discreditable attitude in a maintainer,
Posted Jun 2, 2009 15:46 UTC (Tue)
by rmh (guest, #58387)
[Link]
That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's a non-problem
That's a non-problem
That's a non-problem
That's a non-problem
That's a non-problem
The OpenBSD strlcat has different behavior than the Solaris strlcat, which makes it a problem to use the function in a portable application.
and what would they standardize?
That's a non-problem
That's a non-problem
ISO/IEC TR 24731-1 adds bounds-checking functions to the Standard C library, but it's still just a draft. The proposed functions use a "_s" suffix with existing function names. The group explicitly rejected the That's a non-problem
strlcpy
name because they want to provide a large consistent suite of these functions in one shot -- not just basic string operations but also things like tmpfile_s
, vfprintf_s
, asctime_s
, wmemcpy_s
, and many others. According to the associated Rationale, strcpy_s
also performs more checks and has more elaborate error handling than strlcpy
.
That's a non-problem
That's a non-problem
That's a non-problem
That's a non-problem
version description:
Isn't that what autoconf is for?
Isn't that what autoconf is for?
That's silly. You can have strlcat() and strlcpy(), yet be compatible
Yes, exactly. A binary that works with eglibc should work with glibc, so eglibc has to be a proper subset. It's supposed to be glibc with the option to strip it down, hence the "e".
That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's silly. You can have strlcat() and strlcpy(), yet be compatible
Chain of events, probably not chronological, but illustrative:
That's silly. You can have strlcat() and strlcpy(), yet be compatible
Yeah...
That's silly. You can have strlcat() and strlcpy(), yet be compatible
> People decide Drepper is a pain to work with because he drops important
> patches and should preferably be kicked out of the open source community.
That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's silly. You can have strlcat() and strlcpy(), yet be compatible
aspects of Ulrich's maintainership that I really don't have any sort of
problem with (hell, I don't care much about strfry() either: if only
glibc's objects were sorted so strfry() wasn't pulled into memory on the
majority of systems... and now with the paging-prefers-executables stuff
it won't even get pushed out again.)
That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's silly. You can have strlcat() and strlcpy(), yet be compatible
someone trying to fix a bug in that exemplifies his behaviour towards
*anyone* trying to contribute *anything*, except if he's known them a long
time (and sometimes not even then).
holiday here and I have two flashy new Nehalems to bring up (die, old
ten-year-outdated PIIIs! ... only thing is I'm not sure 36Gb RAM in the
two combined will be enough ;} )
That's silly. You can have strlcat() and strlcpy(), yet be compatible
Drepper is an exceptional project leader when it comes to technical
aspects
For the record I consider this incorrect. He's an excellent hacker and
virtually everything he implements is a sort of glittering jewel,
perfectly designed (and perfectly undocumented and he has a habit of
ignoring contributions of documentation). He'd make an excellent
contributor. But unfortunately that is not his role in glibc. Maintainers'
roles are higher-level, and there is where Ulrich's bad side comes out.
That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's silly. You can have strlcat() and strlcpy(), yet be compatible
ago: I dithered about including it. It's not the real problem, to me:
maybe he changed his mind and forgot the original contribution had ever
existed, which is fine. The real problem is his attitude to contributions.
I'm sorry, but ARM is not a "rare" architecture. It is #4 for Debian, and would rate #3 if arm and armel were counted together.
Rare architectures
Rare architectures
considerable margin. It's only 'rare' if you ignore the embedded space
completely.
That's silly. You can have strlcat() and strlcpy(), yet be compatible
pretty much ideal: it leaves Ulrich and a few others to do technical
wizardly in the alleged 'upstream' where they don't have to do anything
hard like interact with human beings, and everyone else can go to eglibc,
where all the contributions from everyone else and all the stuff people
need to actually build a glibc for the distributions (other than RH) can
be added on.
the distro stuff was split across dozens of repositories, which made it
very hard for people building their own glibc to do so. Now it's made much
easier, and everyone is in their ideal positions and can be happy :) and
Ulrich doesn't have to talk to anyone he doesn't want to, ever again,
which I suspect will make him happy. Or at least less grumpy. :)
bindresvport is another good case
https://bugzilla.redhat.com/show_bug.cgi?id=103401
That's silly. You can have strlcat() and strlcpy(), yet be compatible
because strfry() and memfrob() were implemented over a decade *before*
NPTL, in the very early days of glibc, not by some random nobody but by
Roland McGrath, the original author of glibc and still its co-maintainer.
fix to strstr(): I suspect Roland was very bored after that and wanted to
do something fun to flush his brain out. Hence the glorious uselessness
that is strfry() and memfrob(). Their negative consequence is principally
that they sort lexicographically next to heavily used functions, and there
is no attempt to sort objects in libc.so according to frequency of use: so
these two functions reside permanently in memory on most Linux systems,
dragged in because the other str*() and mem*() functions are next to them
and in essentially continuous use.
That's silly. You can have strlcat() and strlcpy(), yet be compatible
That's silly. You can have strlcat() and strlcpy(), yet be compatible
be as good as it can be. Having a function that's both a joke *and* broken
would be worse yet. Ulrich is a perfectionist too, but a curiously
selective one: he only cares that the parts of glibc that he uses or that
someone's paying him for are perfect. The rest (unusual ports, locales,
POSIX functions he dislikes) can go hang.
but maybe that's just me.
That's silly. You can have strlcat() and strlcpy(), yet be compatible