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)
Sat, Jun 29, 4:20 PM
Unknown Object (File)
Tue, Jun 4, 6:06 AM
Unknown Object (File)
Tue, Jun 4, 1:08 AM
Unknown Object (File)
Mon, Jun 3, 11:34 PM
Unknown Object (File)
May 18 2024, 5:37 PM
Unknown Object (File)
May 8 2024, 5:12 PM
Unknown Object (File)
May 8 2024, 1:14 PM
Unknown Object (File)
May 4 2024, 7:17 PM

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.Tue, Jun 4, 1:08 AM

Thank you for your help. :)