Bug 278859 - archivers/urbackup-server: Fix for Segfault (CRYPTOPP) and Update to latest 2.5.33 version
Summary: archivers/urbackup-server: Fix for Segfault (CRYPTOPP) and Update to latest 2...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Nuno Teixeira
URL: https://www.urbackup.org/server_chang...
Keywords:
Depends on:
Blocks: 266531 278163
  Show dependency treegraph
 
Reported: 2024-05-08 23:32 UTC by ek
Modified: 2024-05-11 08:36 UTC (History)
1 user (show)

See Also:


Attachments
2.5.33 patch (6.61 KB, patch)
2024-05-08 23:32 UTC, ek
no flags Details | Diff
v0: updt to 2.5.33; take maintainership (6.32 KB, patch)
2024-05-10 20:43 UTC, Nuno Teixeira
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ek 2024-05-08 23:32:32 UTC
Created attachment 250537 [details]
2.5.33 patch

Updated to the 2.5.33 version (latest) as well as added -DCRYPTOPP_DISABLE_ASM to CXXFLAGS to fix the startup segfault (instead of building embedded cryptopp.)

Poudriere build log can be found at: https://pkg.purplehat.org/data/fbsd_14-0_x64-HEAD/2024-05-08_16h20m15s/logs/urbackup-server-2.5.33.log

This should also close PR's 266531 and 278163, methinks.
Comment 1 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-09 07:08:01 UTC
Hello!

Nice that amule fix applies to this port as well.

I'm not familiar with this software and I'm actively testing 3 backup programs already on my local machine.

Are you willing to maintain archivers/urbackup-{client,server} ports?
You can count on me for any related PRs since I will start testing this one soon.

Cheers
Comment 2 ek 2024-05-09 16:41:41 UTC
Hi Nuno,

Sure. I'll take archivers/urbackup-{server,client} ports for now. I'm also just trying to test these out but running into issues (I think it's user error or old DB info or something.) I look forward to hearing how well they work for you in future testing.

Regards
Comment 3 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 07:11:48 UTC
(In reply to ek from comment #2)

Hello,

I will commit fix first so I can MFH it to quarterly. This way I can close the other related PRs.

I will do some run tests on current version 2.5.26 to know better this software and after it we can move on updating. We need to know if there is issues with current version before update it.

Cheers
Comment 4 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 07:22:02 UTC
Status:

- server fixed:

pid 38863 (urbackupsrv), jid 0, uid 891: exited on signal 11 (no core dump - bad address)

- web interface working and backup dir OK by setting correct ownership urbackup:urbackup

- client crashes when it get discovered:

pid 56060 (urbackupclientbacke), jid 0, uid 0: exited on signal 11 (core dumped)

I could bet that -client needs to be patched too?
Comment 5 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 07:54:18 UTC
(In reply to Nuno Teixeira from comment #4)
(...)

- client fixed same way. It is auto detected now on web interface.

Resume:

Apply fix to both client and server:

# Fix segmentation fault, PR 266531
# see also 5a19c08: security/cryptopp: Update to 8.7.0
.if ${ARCH} == i386 || ${ARCH} == amd64
CXXFLAGS+=      -DCRYPTOPP_DISABLE_ASM
.endif

Questions/doubts:

Can this patch be a security problem by disabling _ASM?
If it is, this segfault could be fixed by altering options on cryptopp, but let's try to avoid that.
Comment 6 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 08:14:24 UTC
(In reply to Nuno Teixeira from comment #5)
(...)

- client backup:

# urbackupclientctl add-backupdir --path /path/to/dir
# urbackupclientctl start full

- restore:

# urbackupclientctl -b last restore-start

Ok, I moved backup dir to a different name and it restored to <backup_name> "logs"

# urbackupclientctl list-backupdirs
PATH                         NAME FLAGS
---------------------------- ---- ----------------------------------------------
/home/nunotex/Work/Temp/logs logs follow_symlinks,symlinks_optional,share_hashes
Comment 7 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 08:17:44 UTC
(In reply to Nuno Teixeira from comment #6)

(...)

Forget this part:

# urbackupclientctl -b last restore-start

> Ok, I moved backup dir to a different name and it restored to <backup_name>
> "logs"

It restored dir just fine. Ownership was changed from user:user -> root:user

All OK.
Comment 8 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 08:30:47 UTC
(In reply to Nuno Teixeira from comment #7)
(...)

And to finish restore test, I delete one file from the logs dir and it restored missing file respecting ownership.

Done with run test.
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-05-10 15:25:31 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=577ac1f839b1b164bd42af7c94a15be017b5e1d7

commit 577ac1f839b1b164bd42af7c94a15be017b5e1d7
Author:     ek <ek@purplehat.org>
AuthorDate: 2024-05-10 15:19:22 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-05-10 15:24:59 +0000

    archivers/urbackup-{client,server}: Fix segfault (cryptopp)

    - Add -DCRYPTOPP_DISABLE_ASM to CXXFLAGS on i386 and amd64, as
      cryptopp-8.7.0 build with this option by default on i386 and amd64.
     (5a19c08: security/cryptopp: Update to 8.7.0)

    PR:             266531, 278163, 278859
    MFH:            2024Q2

 archivers/urbackup-client/Makefile | 10 +++++++++-
 archivers/urbackup-server/Makefile | 10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)
Comment 10 ek 2024-05-10 18:22:23 UTC
(In reply to Nuno Teixeira from comment #5)
This is good to know. Did you already patch archivers/urbackup-client with the fix and version update and commit? If not, I'll also patch and test the client and then I'll submit a new PR for the client when I get a chance. Thanks, Nuno!
Comment 11 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 18:36:27 UTC
(In reply to ek from comment #10)

Hello,

I've patched client and server and committed.
I will start testing updates soon.

Cheers
Comment 12 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 20:43:40 UTC
Created attachment 250574 [details]
v0: updt to 2.5.33; take maintainership

(Updated diff)

- Submitter becomes maintainer
Comment 13 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-10 20:45:28 UTC
(In reply to ek from comment #10)

Yes, please submit a patch for client and add me to PR CC.
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-05-10 21:20:40 UTC
A commit in branch 2024Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=469adf44f1c6f846ea06e4de2e5bae0e3339c7f3

commit 469adf44f1c6f846ea06e4de2e5bae0e3339c7f3
Author:     ek <ek@purplehat.org>
AuthorDate: 2024-05-10 15:19:22 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-05-10 21:11:30 +0000

    archivers/urbackup-{client,server}: Fix segfault (cryptopp)

    - Add -DCRYPTOPP_DISABLE_ASM to CXXFLAGS on i386 and amd64, as
      cryptopp-8.7.0 build with this option by default on i386 and amd64.
     (5a19c08: security/cryptopp: Update to 8.7.0)

    PR:             266531, 278163, 278859
    MFH:            2024Q2
    (cherry picked from commit 577ac1f839b1b164bd42af7c94a15be017b5e1d7)

 archivers/urbackup-client/Makefile | 10 +++++++++-
 archivers/urbackup-server/Makefile | 10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)
Comment 15 commit-hook freebsd_committer freebsd_triage 2024-05-11 08:35:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c55536823d8c58d60ae874799649c2f27c026574

commit c55536823d8c58d60ae874799649c2f27c026574
Author:     ek <ek@purplehat.org>
AuthorDate: 2024-05-11 08:33:51 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-05-11 08:34:46 +0000

    archivers/urbackup-server: Update to 2.5.33

    - Submitter becomes maintainer

    ChangeLog:      https://www.urbackup.org/server_changelog.html
    PR:             278859

 archivers/urbackup-server/Makefile  |  5 ++--
 archivers/urbackup-server/distinfo  |  6 ++--
 archivers/urbackup-server/pkg-plist | 56 +++++++------------------------------
 3 files changed, 15 insertions(+), 52 deletions(-)
Comment 16 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-11 08:36:49 UTC
Committed, thank you!