Page MenuHomeFreeBSD

bacula1[13]-client: build without sbrk
ClosedPublic

Authored by brooks on Dec 8 2023, 11:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 26 2024, 9:59 PM
Unknown Object (File)
Oct 5 2024, 9:28 AM
Unknown Object (File)
Oct 5 2024, 7:24 AM
Unknown Object (File)
Oct 5 2024, 6:39 AM
Unknown Object (File)
Oct 3 2024, 2:54 PM
Unknown Object (File)
Oct 2 2024, 11:13 AM
Unknown Object (File)
Oct 1 2024, 3:00 AM
Unknown Object (File)
Oct 1 2024, 1:18 AM

Details

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.

I just wanted to add a note that I've been using the patches listed here with bacula15 on aarch64 for ~a month. The patch sysutils/bacula13-server/files/patch-src_lib_bsys.c applies cleanly to bacula15-server as well, and bacula-fd on ARM seems to be doing its job perfectly. I've been running this on a bunch raspberry pi 3 and 4s and both the backup and restore functionality works as intended. Unfortunately, I don't have any risc-v boards to validate that part, so I can only add a "works for me" on aarch64.

Is there something that I could add here to help testing and get this merged? If necessary I can provide (build or application) logs or I could try testing a specific scenario/configuration if you have something specific in mind.

This revision is now accepted and ready to land.Jun 4 2024, 1:08 AM

Thank you for your help. :)