Page MenuHomeFreeBSD

bacula1[13]-client: build without sbrk
Needs ReviewPublic

Authored by brooks on Dec 8 2023, 11:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 3, 8:19 AM
Unknown Object (File)
Jan 18 2024, 1:23 PM
Unknown Object (File)
Dec 28 2023, 7:48 PM
Unknown Object (File)
Dec 25 2023, 8:14 PM
Unknown Object (File)
Dec 17 2023, 2:02 PM
Subscribers
None

Details

Reviewers
dvl
Summary

Avoid the deprecated sbrk interface and simply report no heap usage.
Heap usage as reported by sbrk() is often inaccurate and this
allows the code to build for targets without sbrk support.

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 54874
Build 51763: arc lint + arc unit

Event Timeline

brooks created this revision.

Compiled, but untested on an amd64 system without sbrk.

Upstream might want to take a different tact here, but this was easy.

I've not patched bacula9 because I understand it's going away and this code is duplicated rather than in a library there.

Compiled, but untested on an amd64 system without sbrk.

How can I tell if I have sbrk?

[16:12 r730-01 dvl ~] % grep -i sbrk /var/run/dmesg.boot 
[16:17 r730-01 dvl ~] %

Upstream might want to take a different tact here, but this was easy.

I will suggest this to them, but I suspect it would only be applied to version 15, about to be released. re https://git.langille.org/dvl/ports/src/branch/master/sysutils

I've not patched bacula9 because I understand it's going away and this code is duplicated rather than in a library there.

I plan to deprecated bacula9 and bacula11 with a 3 month expiration date shortly after we get bacula15 into the tree. I figure we should deprecate bacula13 about three months after that.

In D42979#980092, @dvl wrote:

Compiled, but untested on an amd64 system without sbrk.

How can I tell if I have sbrk?

[16:12 r730-01 dvl ~] % grep -i sbrk /var/run/dmesg.boot 
[16:17 r730-01 dvl ~] %

You do unless you're on aarch64 and riscv. It's part of libc since forever (and also considered deprecated since the 90's). I'm trying to remove it which means I'm cleaning up ports that are broken by its absence.

Upstream might want to take a different tact here, but this was easy.

I will suggest this to them, but I suspect it would only be applied to version 15, about to be released. re https://git.langille.org/dvl/ports/src/branch/master/sysutils

Feel free to CC me. I'm happy to engage here and discuss options. This patch it mostly aimed to be good enough to let us build bacula for aarch64 and riscv.

I've not patched bacula9 because I understand it's going away and this code is duplicated rather than in a library there.

I plan to deprecated bacula9 and bacula11 with a 3 month expiration date shortly after we get bacula15 into the tree. I figure we should deprecate bacula13 about three months after that.

Sounds good to me.

In D42979#980092, @dvl wrote:

Compiled, but untested on an amd64 system without sbrk.

How can I tell if I have sbrk?

[16:12 r730-01 dvl ~] % grep -i sbrk /var/run/dmesg.boot 
[16:17 r730-01 dvl ~] %

You do unless you're on aarch64 and riscv. It's part of libc since forever (and also considered deprecated since the 90's). I'm trying to remove it which means I'm cleaning up ports that are broken by its absence.

FWIW, D42862 is a review to remove sbrk support.