Re:The C standard library function atexit is broken
by Volt on Thursday June 20, 2019 @02:19AM
(#20230389)
Not the parent, but I think dynamic linking with system libraries is the only time it makes good sense. Otherwise you're just asking for trouble.
Re:The C standard library function atexit is broken
by imtringued on Thursday June 20, 2019 @07:46AM
(#20231855)
The GP argues that it should be abolished everywhere, even in the cases where it makes good sense.
Re:The C standard library function atexit is broken
by saagarjha on Thursday June 20, 2019 @04:48AM
(#20231039)
Of course, you need to make sure that your system actually provides up-to-date implementations of these libraries.
Re:The C standard library function atexit is broken
by ajross on Thursday June 20, 2019 @08:17AM
(#20232089)
Still a much better bet than that you will.
Re:The C standard library function atexit is broken
by warmwaffles on Thursday June 20, 2019 @03:31PM
(#20236452)
Do you play any steam games or most other modern games? Yea those static compile almost everything.
Re:The C standard library function atexit is broken
by ajross on Thursday June 20, 2019 @06:02PM
(#20237834)
This example hurts the case, it doesn't help. Windows deployment, especially of C/C++ apps, is indeed a problem. And for decades it was absolutely routine that random windows binaries turn out to be subject to attacks against libraries like zlib or libjpeg which had been long since patched in linux distributions but lived on statically in exploitable blobs.
Things have in fact gotten much better over the past years, though. Largely because developers (even of games) have moved away from this architecture and onto managed runtimes like Java and .NET where the runtime and system provide cleaner separation of dependencies and don't require the "static all the time" nonsense that was the norm since the beginning of PCs.
You mean for your code, deployed on your systems. Yeah, that works fine.
Now ship a binary to a client system with your static TLS implementation, JPEG decoder, LZ decompressor, whatever. And then go hire someone to watch the CVE feeds every day to know when you have to get them to install an upgrade.
Of, if you don't want it to be your fault when they get pwned, you could just link against the system libraries and tell them to stay updated.
"Static only" makes sense for web apps developed and deployed within the same organization, for embedded solutions where the whole update/upgrade process is known to be under the control of the developer, and... basically nowhere else.
This advice is bad, sorry.