Skip to content

fix: Only call get_all_running_processes_info when needed#4135

Merged
jjerphan merged 1 commit into
mamba-org:mainfrom
mihaitodor:fix-crash
Jan 13, 2026
Merged

fix: Only call get_all_running_processes_info when needed#4135
jjerphan merged 1 commit into
mamba-org:mainfrom
mihaitodor:fix-crash

Conversation

@mihaitodor
Copy link
Copy Markdown
Contributor

@mihaitodor mihaitodor commented Jan 12, 2026

Do not call get_all_running_processes_info() unless the log level requires printing debug logs.

When running micromamba in a specific production environment, we keep getting Segmentation fault (core dumped) and, by adding more logs in the code, I was able to narrow it down to this particular log entry, where it tries to print the currently running processes. I can confirm that the crash doesn't occur in get_all_running_processes_info() and it is something in the MessageLogger implementation, but I have a hard time narrowing it down since I don't have access to run gdb in that environment or collect core dumps. I believe it is something to do with the length of the resulting string, but I've not been able to get it to reproduce reliably in a unit test. However, we don't use debug logs and, in this case, I think the code should skip this log clause completely, which should unblock us.

Description

Type of Change

  • Bugfix
  • Feature / enhancement
  • CI / Documentation
  • Maintenance

Checklist

  • My code follows the general style and conventions of the codebase, ensuring consistency
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run pre-commit run --all locally in the source folder and confirmed that there are no linter errors.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

@github-actions github-actions Bot added the release::bug_fixes For PRs fixing bugs label Jan 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.12%. Comparing base (bc2ff56) to head (78b0212).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
libmamba/src/core/run.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4135   +/-   ##
=======================================
  Coverage   63.11%   63.12%           
=======================================
  Files         316      316           
  Lines       38806    38807    +1     
  Branches     2986     2987    +1     
=======================================
+ Hits        24494    24498    +4     
+ Misses      14241    14238    -3     
  Partials       71       71           

☔ 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.

Copy link
Copy Markdown
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

Thank you, @mihaitodor.

Indeed get_all_running_processes_info only must be called when needed.

@jjerphan jjerphan changed the title Fix crash in micromamba run fix: Only call get_all_running_processes_info when needed Jan 13, 2026
@mihaitodor
Copy link
Copy Markdown
Contributor Author

@jjerphan Thank you for confirming! I fixed the linter error (should've checked again before pushing).

Do not call `get_all_running_processes_info()` unless the log
level requires printing debug logs.

Signed-off-by: Mihai Todor <todor@ebi.ac.uk>
@jjerphan
Copy link
Copy Markdown
Member

I have rebased your PR to have #4137 in.

@jjerphan jjerphan merged commit f3da454 into mamba-org:main Jan 13, 2026
33 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release::bug_fixes For PRs fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants