Skip to content

Fix TMBad windows bug#935

Merged
kellijohnson-NOAA merged 2 commits into
mainfrom
dev-fix-windows-bug
Jul 28, 2025
Merged

Fix TMBad windows bug#935
kellijohnson-NOAA merged 2 commits into
mainfrom
dev-fix-windows-bug

Conversation

@Andrea-Havron-NOAA

Copy link
Copy Markdown
Collaborator

What is the feature?

  • This PR fixes a bug in the code that was causing rcmdcheck to fail when running TMBad in Windows

How have you implemented the solution?

  • The population derived quantity, unfished_biomass was not being initialized. This was causing an instability that was only picked up by Windows when running TMBad.

Does the PR impact any other area of the project, maybe another repo?

  • No

@github-actions

Copy link
Copy Markdown
Contributor

Instructions for code reviewer

Hello reviewer, thanks for taking the time to review this PR!

  • Please use this checklist during your review, checking off items that you have verified are complete, but feel free to skip over items that are not relevant!
  • See the GitHub documentation for how to comment on a PR to indicate where you have questions or changes are needed before approving the PR.
  • Please use conventions in the guidelines for conventional commit messages for both commit messages and comments.
  • PR reviews are a great way to learn so feel free to share your tips and tricks. However, when suggesting changes to the PR that are optional please include nit: (for nitpicking) as the comment type. For example, nit: I prefer using a data.frame() instead of a matrix because ...
  • Engage with the developer when they respond to comments and check off additional boxes as they become complete so the PR can be merged in when all the tasks are fulfilled. Make it clear when the PR is approved by selecting the approved status, and potentially by commenting on the PR with something like This PR is now ready to be merged, no additional changes are needed.

Checklist

  • The PR is requested to be merged into the appropriate branch (typically dev).
  • The code is well-designed.
  • The functionality is good for the users of the code.
  • Code coverage remains high, indicating the new code is tested.
  • The code is commented and the comments are clear, useful, and mostly explain why instead of what.
  • Code is appropriately documented (doxygen and roxygen).

@Andrea-Havron-NOAA

Copy link
Copy Markdown
Collaborator Author

I'm leaving these two commits as separate to demonstrate adding TMBad fails on Windows but then initializing unfished_biomass resolves the issue. I can squash the commits after the review and before rebasing to dev.

@Andrea-Havron-NOAA Andrea-Havron-NOAA linked an issue Jul 24, 2025 that may be closed by this pull request
@kellijohnson-NOAA

Copy link
Copy Markdown
Contributor

Great find 🔍 @Andrea-Havron-NOAA. I am wondering if you mind adding a comment on how you found the 🐛? Did you use vagrind, gdb, or some other method?

@Andrea-Havron-NOAA

Copy link
Copy Markdown
Collaborator Author

I had to debug on my local Windows machine so Valgrind was not available. I also was not able to set breakpoints with gdb because there are size issues with compiling FIMS with the debugger turned on. In the end, I used the logging system to print out messages to discover where the code failed. I determined the code crashed when accessing unfished_biomass at year 6 but the vector was a size 30, so it wasn't an issue with overstepping the vector. I remember reading that issues can occur when vectors are not initialized so I looked in the Prepare() section and discovered that unfished_biomass was not being initialized.

@kellijohnson-NOAA kellijohnson-NOAA changed the base branch from dev to main July 28, 2025 06:42

@kellijohnson-NOAA kellijohnson-NOAA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Andrea-Havron-NOAA!

@codecov

codecov Bot commented Jul 28, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.19%. Comparing base (720ade6) to head (f88ffb7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #935   +/-   ##
=======================================
  Coverage   75.19%   75.19%           
=======================================
  Files          82       82           
  Lines        8416     8418    +2     
  Branches      460      463    +3     
=======================================
+ Hits         6328     6330    +2     
  Misses       1981     1981           
  Partials      107      107           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kellijohnson-NOAA kellijohnson-NOAA merged commit 2e9ddd4 into main Jul 28, 2025
16 checks passed
@kellijohnson-NOAA kellijohnson-NOAA deleted the dev-fix-windows-bug branch July 28, 2025 10:50
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.

[Bug:] Windows failing after switching to TMBad

2 participants