News for hackers. Stuff that matters.
Re:Debugging Your Operating System: A Lesson in Memory Alloc... by Someone on Friday December 09, 2016 @05:08PM (#13142283)
I am not sure I would call this a bug. Is "call calloc, free, and calloc, without ever touching the memory" really a use case one should optimize for? One could argue that improving performance for this case only is worthwhile if it can be done in a way that barely impacts anything else.

Edit: apologies for being somewhat ambiguous. The "bug" I refer to is the Radar issue the writer of the blog created, not the performance issue with the Python code.

Re:Debugging Your Operating System: A Lesson in Memory Alloc... by CalChris on Friday December 09, 2016 @05:43PM (#13142517)
The author had a bug report in front of him. The behavior was repeatable and certainly unexpected. That is worth tracking down.

I've tracked down corner cases like this myself and been correctly told by developers that they're not worth fixing. But you don't know that a priori.

Re:Debugging Your Operating System: A Lesson in Memory Alloc... by eridius on Friday December 09, 2016 @05:53PM (#13142580)
The bug report wasn't caused by calloc, free, calloc being expensive. It was caused by making a call that did "malloc + memset" when only malloc was needed. The code in question wasn't even invoking calloc at all, it just ended up being an excuse to investigate zeroing memory behavior.

Incidentally, the blog post asks "why was the memory being actively zeroed at all?" but never actually answers it.

Re:Debugging Your Operating System: A Lesson in Memory Alloc... by citrin_ru on Friday December 09, 2016 @05:53PM (#13142585)
Does PyOpenSSL allocate memory and the free without touch? If not, this test case may be not relevant to the bug.
Re:Debugging Your Operating System: A Lesson in Memory Alloc... by loeg on Friday December 09, 2016 @05:42PM (#13142514)
It barely impacts anything else.