Live data from Hacker News

OpenBSD: Malloc leak detection available in -current

undeadly.org

41–50 of 61 posts

Re: OpenBSD: Malloc leak detection available in -current

#41
post #39

Earlier quoted context omitted.

I feel like Linux is so incredibly popular that it does make it untrue, similar to the punchline of https://what-if.xkcd.com/49/ >. 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.

The point that Theo de Raadt is making is that this line of thinking is wrong*. Most of the FSF/GPL advocates never seem to look at the why's around people disliking their approach. See https://lkml.org/lkml/2007/9/1/102 as an example. OpenBSD helped the Linux project dual license the ath5k driver. They were thanked by GPL advocates illegally trying to strip the BSD license after the fact. Leaves a bad taste, and one…

Theo de Raadt is the one who's wrong. When code goes closed source, you're locked out and can't have it at all anymore. When it goes GPL, you can still have it just by going GPL yourself.

Re: OpenBSD: Malloc leak detection available in -current

#42

Earlier 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

Why would openbsd want to taint kdump with GPL code?

Re: OpenBSD: Malloc leak detection available in -current

#43
post #39

Earlier quoted context omitted.

The point that Theo de Raadt is making is that this line of thinking is wrong*. Most of the FSF/GPL advocates never seem to look at the why's around people disliking their approach. See https://lkml.org/lkml/2007/9/1/102 as an example. OpenBSD helped the Linux project dual license the ath5k driver. They were thanked by GPL advocates illegally trying to strip the BSD license after the fact. Leaves a bad taste, and one…

Theo de Raadt is the one who's wrong. When code goes closed source, you're locked out and can't have it at all anymore. When it goes GPL, you can still have it just by going GPL yourself.

> "When it goes GPL, you can still have it just by going GPL yourself."

Which in some people's opinion, is no better. Just a different set of handcuffs.

Re: OpenBSD: Malloc leak detection available in -current

#44

Earlier quoted context omitted.

Just link to the code instead of executing it as a separate binary

Why would openbsd want to taint kdump with GPL code?

Then find or write an alternative. Asking people to run a command to see the file and line number is a joke.

Re: OpenBSD: Malloc leak detection available in -current

#45

Earlier quoted context omitted.

They maintained apache 1.x in base for a long time. For a small number of releases they switched to nginx and then i think they wrote their own.

Parent is referring to the Apache 2 license, not version 2 of the Apache HTTPD server.

It's not coincidental. It was early in the Apache 2.0 lifecycle that the Apache License 2.0 came about (google says 2.0.49). OpenBSD's continued maintenance of a 1.x fork from 2004-2011 or so was mainly about licensing.

Re: OpenBSD: Malloc leak detection available in -current

#46

Earlier quoted context omitted.

> 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…

To work around leaks, just don’t run your GNU programs for very long (:

Maybe this is the intended use case of timeout(1).

Re: OpenBSD: Malloc leak detection available in -current

#47

Earlier quoted context omitted.

I'm pretty sure parsing ELF binaries is out of scope for kdump(1), sorry, but I don't think that's going to happen. It's not that difficult to run addr2line yourself with the information provided, and that's really for the best.

You are arguing for a worse UX because of an arbitrary reason. Just link against the code in addr2line. Providing a good UX should always be in scope for a project.

How does one "just link against the code in addr2line" ?

Re: OpenBSD: Malloc leak detection available in -current

#48

Earlier quoted context omitted.

You are arguing for a worse UX because of an arbitrary reason. Just link against the code in addr2line. Providing a good UX should always be in scope for a project.

How does one "just link against the code in addr2line" ?

You rename them main symbol to something else then you just call it like any other library.

Re: OpenBSD: Malloc leak detection available in -current

#49
post #14
post #10

To 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.

The last time I used a leak finder, a memory allocation which still has a ptr to it is not a leak. You are conflating unfreed memory with unreferencable memory.

Reachability is one strategy for detecting leaks but it's not the only one. Checking for unfreed memory is easier to implement.

Re: OpenBSD: Malloc leak detection available in -current

#50

Earlier quoted context omitted.

Just link to the code instead of executing it as a separate binary

Why would openbsd want to taint kdump with GPL code?

LLVM provides llvm-addr2line and llvm-symbolizer. Of course I understand not wanting to link with LLVM code, even when the licence is ok. :)
Post reply on HN