Open
Description
I’ve scanned HiGHS with MEMCHECK and it has triggered on HiGHS/src/parallel/HighsCacheAlign.h line 30. I'm not sure whether this is an actual issue, or whether code of HiGHS is too sophisticated for MEMCHECK to understand. Do you guys have any idea?
Project version
HiGHS: master
Operating system
compiler: gcc (Debian 12.2.0-14) 12.2.0
Ubuntu 22.04.4 LTS
Linux 5.15.0-125-generic #135-Ubuntu SMP Fri Sep 27 13:53:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
I did this
Launched /home/HiGHS/build/bin/call_highs_from_c_minimal
I expected the following
No problem reported by MEMCHECK
I got the following
/home/HiGHS/build/bin/call_highs_from_c_minimal
==51803== Memcheck, a memory error detector
==51803== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==51803== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==51803== Command: /home/HiGHS/build/bin/call_highs_from_c_minimal
==51803==
==51803==
==51803== HEAP SUMMARY:
==51803== in use at exit: 8,398,792 bytes in 40 blocks
==51803== total heap usage: 25,638 allocs, 25,598 frees, 12,002,855 bytes allocated
...
==51803== 8,393,728 bytes in 16 blocks are possibly lost in loss record 10 of 10
==51803== at 0x4840F2F: operator new(unsigned long) (coregrind/m_replacemalloc/vg_replace_malloc.c:422)
==51803== by 0x494A51F: highs::cache_aligned::alloc(unsigned long) (home/HiGHS/src/parallel/HighsCacheAlign.h:30)
==51803== by 0x496500E: std::unique_ptr<HighsSplitDeque, highs::cache_aligned::Deleter<HighsSplitDeque> > highs::cache_aligned::make_unique<HighsSplitDeque, std::shared_ptr<HighsSplitDeque::WorkerBunk>&,
std::unique_ptr<HighsSplitDeque, highs::cache_aligned::Deleter<HighsSplitDeque> >*, int&, int&>(std::shared_ptr<HighsSplitDeque::WorkerBunk>&, std::unique_ptr<HighsSplitDeque, highs::cache_aligned::Deleter<HighsSplitDeque> >*&&,
int&, int&) (home/HiGHS/src/parallel/HighsCacheAlign.h:76)
==51803== by 0x48B8EF2: HighsTaskExecutor::HighsTaskExecutor(int) (home/HiGHS/src/parallel/HighsTaskExecutor.h:122)
==51803== by 0x494CB9F: HighsTaskExecutor::initialize(int) (home/HiGHS/src/parallel/HighsTaskExecutor.h:170)
==51803== by 0x494CC42: highs::parallel::initialize_scheduler(int) (home/HiGHS/src/parallel/HighsParallel.h:33)
==51803== by 0x49520A0: Highs::solve() (home/HiGHS/src/lp_data/Highs.cpp:952)
==51803== by 0x4951D8A: Highs::run() (home/HiGHS/src/lp_data/Highs.cpp:909)
==51803== by 0x48EE0BE: Highs_lpCall (home/HiGHS/src/interfaces/highs_c_api.cpp:30)
==51803== by 0x10A617: minimal_api (home/HiGHS/examples/call_highs_from_c_minimal.c:101)
==51803== by 0x10C99C: main (home/HiGHS/examples/call_highs_from_c_minimal.c:655)
==51803==
==51803== LEAK SUMMARY:
==51803== definitely lost: 0 bytes in 0 blocks
==51803== indirectly lost: 0 bytes in 0 blocks
==51803== possibly lost: 8,398,728 bytes in 38 blocks
==51803== still reachable: 64 bytes in 2 blocks
==51803== suppressed: 0 bytes in 0 blocks
==51803== Reachable blocks (those to which a pointer was found) are not shown.
==51803== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==51803==
==51803== For lists of detected and suppressed errors, rerun with: -s
==51803== ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 0 from 0)