Bug 292088 - devel/onetbb: Improve port and fix failing tests
Summary: devel/onetbb: Improve port and fix failing tests
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: Ganael LAPLANCHE
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-01 04:53 UTC by Daniel Engberg
Modified: 2026-03-22 16:37 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (martymac)


Attachments
Patch for onetbb (1.27 KB, patch)
2026-01-01 04:53 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2026-01-01 04:53:54 UTC
Created attachment 266718 [details]
Patch for onetbb

* Sync variables with Porters Handbook GitHub Section
* Remove USES= tar:tgz (incorrect)
* Replace USES= localbase with localbase:ldflags (cosmetic but fits better with CMake)
* Use a separate section for USE_GITHUB (similar to what Porters Handbook suggests)
* Only build unit tests when requested instead of all the time which makes overall build a lot slower
* Adjust port Makefile to more closely follow Porters Handbook

Compile and runtime tested on FreeBSD 14.3-RELEASE (amd64) (make, make check-plist, make test)

Poudriere testport OK 13.5-RELEASE (amd64)
Poudriere testport OK 13.5-RELEASE (i386)
Poudriere testport OK 14.3-RELEASE (amd64)
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2026-01-01 04:55:23 UTC
I should also add that multiple unit tests fails on 14.3-RELEASE (amd64) unrelated to this patch
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-01-09 11:46:52 UTC
A commit in branch main references this bug:

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

commit 21ced109339993e4ca894fa5cc0f92a3f252cfb6
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2026-01-09 11:42:06 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2026-01-09 11:45:02 +0000

    devel/onetbb: Improve port

    - Only build unit tests when requested to make overall build faster
    - Adjust port Makefile to more closely follow Porters Handbook
    - Remove USES= tar:tgz (incorrect)
    - Replace USES= localbase with localbase:ldflags
    - Use a separate section for USE_GITHUB

    PR:     292088

 devel/onetbb/Makefile | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
Comment 3 Ganael LAPLANCHE freebsd_committer freebsd_triage 2026-01-09 11:53:29 UTC
Hello Daniel,

Committed, thanks!

Regarding failing tests, it seems several ones are failing due to /proc entry not well parsed ("Invalid /proc/self/status format"). A few others are just failing. I'll see if I can do something.

I'll close that PR in the meantinme, feel free to re-open it if necessary.

Best regards,

Ganael.
Comment 4 Ganael LAPLANCHE freebsd_committer freebsd_triage 2026-01-09 12:11:43 UTC
> it seems several ones are failing due to /proc entry not well parsed
> ("Invalid /proc/self/status format")

Well, probably not the root cause as this is just an assertion :/

Cheers,

Ganael.
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2026-01-10 10:15:55 UTC
Hi,

Sounds great,

I'm seeing this on a amd64 14.3-RELEASE box

The following tests FAILED:
         17 - test_parallel_invoke (Subprocess aborted)
         23 - test_task_group (Subprocess aborted)
         29 - test_resumable_tasks (SEGFAULT)
         63 - test_hw_concurrency (ILLEGAL)
         66 - test_global_control (Subprocess aborted)
         67 - test_task (SEGFAULT)
         71 - test_arena_constraints (Subprocess aborted)
         74 - test_tbb_header (Failed)
        105 - conformance_resumable_tasks (SEGFAULT)
        129 - test_malloc_regression (Subprocess aborted)
        131 - test_malloc_compliance (Subprocess aborted)
        132 - test_malloc_used_by_lib (Subprocess aborted)
        133 - test_malloc_lib_unload (Subprocess aborted)
        135 - test_malloc_whitebox (Subprocess aborted)

Perhaps we could try to at least document these upstream in worst case as I suspect that not only FreeBSD is affected?
Comment 6 Ganael LAPLANCHE freebsd_committer freebsd_triage 2026-01-11 18:05:44 UTC
Hello Daniel,

I am preparing a patch that leads me to the following errors remaining :

--
95% tests passed, 7 tests failed out of 139

Total Test time (real) =  92.66 sec

The following tests FAILED:
         29 - test_resumable_tasks (SEGFAULT)
         63 - test_hw_concurrency (ILLEGAL)
         66 - test_global_control (Subprocess aborted)
         67 - test_task (SEGFAULT)
         74 - test_tbb_header (Failed)
        105 - conformance_resumable_tasks (SEGFAULT)
        131 - test_malloc_compliance (Subprocess aborted)
--

I still have to improve it, stay tuned.

Next, I plan to report those remaining errors upstream to see if someone can help.

Best regards,

Ganael.
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2026-01-11 20:35:13 UTC
Looks great, thanks for working on this! 

Sound like a good idea reporting upstream so they're at least aware and possible have more people looking at the remaining issues.
Comment 8 commit-hook freebsd_committer freebsd_triage 2026-01-12 11:28:04 UTC
A commit in branch main references this bug:

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

commit a1399edaf1110054ac66575198d5a6e2a69d206d
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2026-01-12 11:15:17 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2026-01-12 11:27:48 +0000

    devel/onetbb: Fix procfs-related failing tests

    'make test' failed with the following errors:

             17 - test_parallel_invoke (Subprocess aborted)
             23 - test_task_group (Subprocess aborted)
             29 - test_resumable_tasks (SEGFAULT)
             63 - test_hw_concurrency (ILLEGAL)
             66 - test_global_control (Subprocess aborted)
             67 - test_task (SEGFAULT)
             71 - test_arena_constraints (Subprocess aborted)
             74 - test_tbb_header (Failed)
            105 - conformance_resumable_tasks (SEGFAULT)
            129 - test_malloc_regression (Subprocess aborted)
            131 - test_malloc_compliance (Subprocess aborted)
            132 - test_malloc_used_by_lib (Subprocess aborted)
            133 - test_malloc_lib_unload (Subprocess aborted)
            135 - test_malloc_whitebox (Subprocess aborted)

    Fix tests 17,23,71,129,132,133,135 by using kinfo_getproc(3) instead
    of /proc/self/status, whose format differs from Linux.

    The following tests are still failing:

             29 - test_resumable_tasks (SEGFAULT)
             63 - test_hw_concurrency (ILLEGAL)
             66 - test_global_control (Subprocess aborted)
             67 - test_task (SEGFAULT)
             74 - test_tbb_header (Failed)
            105 - conformance_resumable_tasks (SEGFAULT)
            131 - test_malloc_compliance (Subprocess aborted)

    and will be investigated.

    PR:     292088
    Reported by:    diizzy

 devel/onetbb/Makefile                              |  1 +
 devel/onetbb/files/patch-test_CMakeLists.txt (new) | 24 +++++++++++++++
 .../files/patch-test_common_memory_usage.h (new)   | 34 ++++++++++++++++++++++
 3 files changed, 59 insertions(+)
Comment 9 Ganael LAPLANCHE freebsd_committer freebsd_triage 2026-01-12 11:29:38 UTC
Hello Daniel,

First (local, but I will send it upstream) patch committed. I'll try to see if I can fix other errors.

Cheers,

Ganael.
Comment 10 Ganael LAPLANCHE freebsd_committer freebsd_triage 2026-01-15 16:17:42 UTC
FYI: https://github.com/uxlfoundation/oneTBB/pull/1945
Comment 11 Ganael LAPLANCHE freebsd_committer freebsd_triage 2026-01-20 11:15:17 UTC
See also: https://github.com/uxlfoundation/oneTBB/issues/1949
regarding other failing tests.
Comment 12 Daniel Engberg freebsd_committer freebsd_triage 2026-01-20 17:35:29 UTC
(In reply to Ganael LAPLANCHE from comment #11)
Great! Thanks for looking into these issues! :)
Comment 13 commit-hook freebsd_committer freebsd_triage 2026-01-22 16:32:54 UTC
A commit in branch main references this bug:

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

commit 387cd38cf64f73a605a30bb578759416ceb8b2ee
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2026-01-22 16:24:37 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2026-01-22 16:24:37 +0000

    devel/onetbb: Fix more tests

    Fix/improve the following tests (see patches for details):

     29 - test_resumable_tasks (SEGFAULT)
     63 - test_hw_concurrency (ILLEGAL)
     66 - test_global_control (Subprocess aborted)
     67 - test_task (SEGFAULT)
     74 - test_tbb_header (Failed)
    105 - conformance_resumable_tasks (SEGFAULT)
    131 - test_malloc_compliance (Subprocess aborted)

    This leads to a single test still failing:

     63 - test_hw_concurrency (Subprocess aborted)

    because get_cpuset_indices() is not working on FreeBSD.

    PR:     292088
    Reported by:    diizzy

 devel/onetbb/Makefile                              |  2 +-
 ...ch-include_oneapi_tbb_detail__exception.h (new) | 26 ++++++++++++++++++++++
 .../onetbb/files/patch-src_tbb_co_context.h (new)  | 23 +++++++++++++++++++
 ...tch-test_common_utils_concurrency_limit.h (new) | 24 ++++++++++++++++++++
 ...test_tbbmalloc_test_malloc_compliance.cpp (new) | 17 ++++++++++++++
 5 files changed, 91 insertions(+), 1 deletion(-)
Comment 14 commit-hook freebsd_committer freebsd_triage 2026-01-24 16:26:55 UTC
A commit in branch main references this bug:

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

commit c8af973fb559ebd09ebfede81d7ad6f2e7ddd456
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2026-01-24 16:23:26 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2026-01-24 16:23:26 +0000

    devel/onetbb: Fix the last failing test

    Fix the following test:

     63 - test_hw_concurrency (ILLEGAL)

    by using sched_getaffinity().

    PR:     292088
    Reported by:    diizzy

 devel/onetbb/Makefile                              |  2 +-
 ...common_utils_concurrency_limit.h-affinity (new) | 57 ++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)
Comment 15 Ganael LAPLANCHE freebsd_committer freebsd_triage 2026-01-24 16:29:02 UTC
Hi Daniel,

Every test seem to pass right now :)

I've reported the last patch upstream here:

https://github.com/uxlfoundation/oneTBB/pull/1950

I'll close that PR for now, thanks again for having reported those issues!

Ganael.
Comment 16 Ganael LAPLANCHE freebsd_committer freebsd_triage 2026-02-19 22:05:59 UTC
A test is still failing on i386, see:

https://github.com/uxlfoundation/oneTBB/issues/1967

I would be glad to get comments on this, as it seems to be related to a FreeBSD-only patch, that may be not needed anymore.

Thanks,

Ganael.
Comment 17 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2026-03-22 16:36:56 UTC
I am closing this as the port improvements submitted by diizzy@ have been committed by maintainer martymac@FreeBSD.org across multiple commits. All tests pass on amd64. The remaining i386 test failure is tracked upstream as GitHub issue #1967 and is not a ports issue.
Comment 18 Daniel Engberg freebsd_committer freebsd_triage 2026-03-22 16:37:48 UTC
(In reply to Ganael LAPLANCHE from comment #15)
Awesome, thanks for looking into this!