Skip to content

Conversation

@mihaitodor
Copy link

@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

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.11%. Comparing base (4a5f083) to head (e42c364).

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.11%   -0.01%     
==========================================
  Files         316      316              
  Lines       38806    38807       +1     
  Branches     2986     2987       +1     
==========================================
- Hits        24494    24493       -1     
- Misses      14241    14243       +2     
  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.

mihaitodor and others added 2 commits January 13, 2026 10:28
Do not call `get_all_running_processes_info()` unless the log
level requires printing debug logs.

Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Julien Jerphanion <[email protected]>
Copy link
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
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.

2 participants