Deliberately not calling API functions that you’re supposed to.
To gain speed at application exit.
I’m just dumbfounded by this. What the actual frick?
This all is fine and dandy if your library is guaranteed to link to libc malloc that gets released at app exit. But this is assuming quite a bit about how shared libraries work. Not every platform has linkage like this in both ways. Ours doesn’t and as a result XZ utilities leak memory on every invocation. It would be fine if the API would be used correctly, but the XZ utilities themselves opt out from calling the lzma_end() function “to be faster” at application exit. You’d think the authors would realize that this is not very speed critical, esp since you’ve just spent millions cycles more compressing or decompressing.
#dailywtf #development #programming
Here’s the more constructive part of the (I still think warranted - but likely a bit tone deaf) rant: https://github.com/tukaani-project/xz/pull/181