Neat! Although, I'm curious why the tool doesn't just run addr2line for you?
Are you asking why doesn't it execv(2) addr2line deep within the libc malloc implementation? Because calling execv(2) within libraries is frowned upon.. ;-) The leak report is being generated internally by malloc. It is then logged via utrace(2) when a process is traced through ktrace(1). The kdump utility simply dumps the report, strvis(3) escaping any potentially unsafe characters. As this is untrusted user data, p…
OpenBSD: Malloc leak detection available in -current
21–30 of 61 posts
Re: OpenBSD: Malloc leak detection available in -current
#22This is great news to me, it is the one think I was hoping for. I use OpenBSD to test objects I create and testing there discovered issues that Linux and AIX happily ignored. But I used valgrind on Linux to look for leaks. With this I can now test for all "my issues" on OpenBSD :)
Did you used xlC tooling on Aix? Just curious how they have changed since RS/6000 days.
Re: OpenBSD: Malloc leak detection available in -current
#23Why duplicate the efforts of valgrind and address sanitizer?
In addition to what others said, Valgrind is GPL-licensed. That conflicts with the OpenBSD copyright policy ( https://www.openbsd.org/policy.html ), which says: “The GNU Public License and licenses modeled on it impose the restriction that source code must be distributed or made available for all works that are derivatives of the GNU copyrighted code. While this may superficially look like a noble strategy, it is a c…
This is entirely untrue, though. Linux is GPL and it gets way more use than any of the pushover-licensed BSDs do.
Re: OpenBSD: Malloc leak detection available in -current
#24To quota GNU libc manual: > There is no point in freeing blocks at the end of a program, because all of the program’s space is given back to the system when the process terminates. https://www.gnu.org/software/libc/manual/html_node/Freeing-a... I think many GNU tools just never free any memory. For example, GCC : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66339 -- edit: added GCC as example.
...unless you are trying to find memory leaks in your program. In that case it would be very helpful if the program, and the libraries it uses, were written to actively free all allocated memory.
> I think many GNU tools just never free any memory
It is absolutely true that some GNU software (including libraries like glib) allocate memory that they never intend to free. This causes leak analysis of programs that link with these libraries to be more painful than necessary.
Re: OpenBSD: Malloc leak detection available in -current
#25Earlier quoted context omitted.
Are you asking why doesn't it execv(2) addr2line deep within the libc malloc implementation? Because calling execv(2) within libraries is frowned upon.. ;-) The leak report is being generated internally by malloc. It is then logged via utrace(2) when a process is traced through ktrace(1). The kdump utility simply dumps the report, strvis(3) escaping any potentially unsafe characters. As this is untrusted user data, p…
Just link to the code instead of executing it as a separate binary
It's not that difficult to run addr2line yourself with the information provided, and that's really for the best.
Re: OpenBSD: Malloc leak detection available in -current
#26Earlier quoted context omitted.
In addition to what others said, Valgrind is GPL-licensed. That conflicts with the OpenBSD copyright policy ( https://www.openbsd.org/policy.html ), which says: “The GNU Public License and licenses modeled on it impose the restriction that source code must be distributed or made available for all works that are derivatives of the GNU copyrighted code. While this may superficially look like a noble strategy, it is a c…
> it is a condition that is typically unacceptable for commercial use of software This is entirely untrue, though. Linux is GPL and it gets way more use than any of the pushover-licensed BSDs do.
Re: OpenBSD: Malloc leak detection available in -current
#27Earlier quoted context omitted.
In addition to what others said, Valgrind is GPL-licensed. That conflicts with the OpenBSD copyright policy ( https://www.openbsd.org/policy.html ), which says: “The GNU Public License and licenses modeled on it impose the restriction that source code must be distributed or made available for all works that are derivatives of the GNU copyrighted code. While this may superficially look like a noble strategy, it is a c…
> it is a condition that is typically unacceptable for commercial use of software This is entirely untrue, though. Linux is GPL and it gets way more use than any of the pushover-licensed BSDs do.
Also, why use ‘pushover’? OpenBSD has strong principles that they’re willing to give up things for, so implying they’re weak is derogatory and unfair.
Re: OpenBSD: Malloc leak detection available in -current
#28Earlier quoted context omitted.
> it is a condition that is typically unacceptable for commercial use of software This is entirely untrue, though. Linux is GPL and it gets way more use than any of the pushover-licensed BSDs do.
They're describing libraries. By 'Linux', I'm assuming that you're referring to the OS distributions and not the kernel on it's own. And please drop the pejoratives.
Re: OpenBSD: Malloc leak detection available in -current
#29To quota GNU libc manual: > There is no point in freeing blocks at the end of a program, because all of the program’s space is given back to the system when the process terminates. https://www.gnu.org/software/libc/manual/html_node/Freeing-a... I think many GNU tools just never free any memory. For example, GCC : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66339 -- edit: added GCC as example.
> There is no point in freeing blocks at the end of a program ...unless you are trying to find memory leaks in your program. In that case it would be very helpful if the program, and the libraries it uses, were written to actively free all allocated memory. > I think many GNU tools just never free any memory It is absolutely true that some GNU software (including libraries like glib) allocate memory that they never i…
Re: OpenBSD: Malloc leak detection available in -current
#30Earlier quoted context omitted.
> it is a condition that is typically unacceptable for commercial use of software This is entirely untrue, though. Linux is GPL and it gets way more use than any of the pushover-licensed BSDs do.
IMO, even if they hadn’t included ’typically’ to weaken their claim, one counterexample doesn’t make that _entirely_ untrue. Also, why use ‘pushover’? OpenBSD has strong principles that they’re willing to give up things for, so implying they’re weak is derogatory and unfair.
I use "pushover" because that's what the FSF uses: https://www.gnu.org/licenses/license-compatibility.en.html>
> we call them “pushover licenses” because they can't say “no” when one user tries to deny freedom to others.