Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: fix scope for -DHAS_BOOST_CHRONO #2163

Merged
merged 7 commits into from
Aug 25, 2023
Merged

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Aug 23, 2023

Fixes the issue of potentially mixing boost and non-boost versions of CpuTimer.

Previously, this could lead to invalid writes and segfaults, because the base library would have a boost version of CpuTimer, and the model extension would have or assume a non-boost version of CpuTimer. I don't know whether or how it is defined which definition would be used. I only found one environment where this would happen (segfaults on gcc/12.2.0, boost/1.82.0 (e.g. valgrind python -c "import SomeModel as m; model = m.getModel(); model.getSolver()"); no problems with gcc/12.3.0 boost/1.74.0).

Turns out the segfaults were caused by a broken boost installation (it seems when building boost-1.8{1,2}.0 with cxxstd=98, at least chrono is broken).

@dweindl dweindl requested a review from a team as a code owner August 23, 2023 18:07
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #2163 (0db688f) into develop (16aad6f) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2163      +/-   ##
===========================================
- Coverage    76.74%   76.66%   -0.08%     
===========================================
  Files           82       82              
  Lines        14943    14940       -3     
===========================================
- Hits         11468    11454      -14     
- Misses        3475     3486      +11     
Flag Coverage Δ
cpp 73.55% <100.00%> (+0.01%) ⬆️
petab 54.26% <ø> (ø)
python 77.29% <ø> (-0.24%) ⬇️
sbmlsuite ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
include/amici/misc.h 64.00% <100.00%> (-2.04%) ⬇️

... and 6 files with indirect coverage changes

@dweindl dweindl mentioned this pull request Aug 24, 2023
3 tasks
@dweindl dweindl marked this pull request as draft August 24, 2023 07:53
@dweindl dweindl marked this pull request as ready for review August 24, 2023 15:45
💩

Previously, this could lead to invalid writes and segfaults, because the base
library would have a boost version of CpuTimer, and the model extension would
have or assume a non-boost version of CpuTimer. I don't know whether or how it
is defined which definition would be used. I only found one environment where
this would happen (segfaults on gcc/12.2.0, boost/1.82.0 (e.g. `valgrind python -c "import SomeModel as m; model = m.getModel(); model.getSolver()"`);
no problems with gcc/12.3.0 boost/1.74.0).
@dweindl dweindl force-pushed the fix_boost_chrono_define branch from b82f510 to 9151f87 Compare August 24, 2023 18:19
@dweindl dweindl merged commit 8ead4b0 into develop Aug 25, 2023
@dweindl dweindl deleted the fix_boost_chrono_define branch August 25, 2023 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants