Skip to content

Conversation

@Matios102
Copy link
Contributor

This pull request refines the detection and handling of memory limit exceeded (MLE) errors in the test execution and verification pipeline. The main improvements include a more robust and signal-aware approach to classifying MLEs, removal of hardcoded exit code checks, and expanded test coverage to ensure correct behavior for various edge cases and languages.

MLE Detection & Classification Improvements:

  • Replaced the hardcoded exit code check for memory limit exceeded (previously exit code 134) with a new function isLikelyMemoryLimit that considers process signals (SIGKILL, SIGSEGV, SIGABRT, SIGBUS) and whether peak memory usage was near the limit, as well as language-specific error patterns. This makes MLE detection more accurate and less dependent on platform-specific exit codes. [1] [2] [3] [4]
  • Updated the test execution script (run_tests.sh) to simplify the logic for capturing peak memory and exit codes, removing the shell-side MLE detection and delegating it fully to the verifier logic.

Testing Enhancements:

  • Added comprehensive tests to cover various scenarios for memory limit exceeded detection, including signal-based exits with high/low memory, language-specific error patterns, and all relevant signals (SIGKILL, SIGSEGV, SIGABRT, SIGBUS). This ensures the new logic is robust and correct.
  • Updated existing tests to use more realistic peak memory values and memory limits for MLE scenarios. [1] [2]
  • Removed old tests that relied on the hardcoded exit code for MLE, reflecting the new detection logic.

These changes collectively make the memory limit exceeded handling more reliable and portable across different environments and programming languages.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors memory limit exceeded (MLE) detection from a hardcoded exit code approach to a more robust signal-based detection system. The new logic considers process signals (SIGKILL, SIGSEGV, SIGABRT, SIGBUS) combined with peak memory usage thresholds, along with language-specific error patterns, making MLE detection more accurate and portable across platforms.

  • Replaced hardcoded exit code 134 with signal-based detection that checks if memory usage was near the limit (≥90%)
  • Simplified shell script by delegating all MLE classification to the Go verifier
  • Added comprehensive test coverage for various MLE scenarios including signal variants and language-specific patterns

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
pkg/constants/constants.go Removed the ExitCodeMemoryLimitExceeded constant (134) as MLE is no longer detected via a single hardcoded exit code
internal/stages/verifier/verifier.go Added isLikelyMemoryLimit function with signal-aware detection logic and removed the hardcoded exit code case
internal/stages/verifier/verifier_test.go Removed old hardcoded exit code test and added comprehensive tests for signal-based detection, language patterns, and edge cases
internal/stages/executor/run_tests.sh Simplified peak memory capture and removed shell-side MLE detection logic, delegating classification to the verifier

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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