Skip to content

Conversation

zsistla
Copy link
Contributor

@zsistla zsistla commented Jun 5, 2025

nr_execute_handle_autoload wasn't accounting for the possibility of txn being null which would lead to unpredictable behavior when accessing it here, and we would cause corruption when we set this value.

txn can be null in cases where nr_php_txn_end has been called.
such as: https://github.com/newrelic/newrelic-php-agent/blob/dev/agent/fw_laravel_queue.c#L355-L356

nr_execute_handle_autoload wasn't accounting for the possibility of txn being null.
@newrelic-php-agent-bot
Copy link

newrelic-php-agent-bot commented Jun 5, 2025

Test Suite Status Result
Multiverse 3/8 passing
SOAK 81/85 passing

@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.27%. Comparing base (ae34b4f) to head (2684d6d).

Files with missing lines Patch % Lines
agent/php_execute.c 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1086      +/-   ##
==========================================
- Coverage   77.27%   77.27%   -0.01%     
==========================================
  Files         199      199              
  Lines       28327    28329       +2     
==========================================
+ Hits        21890    21891       +1     
- Misses       6437     6438       +1     
Flag Coverage Δ
agent-for-php-7.2 77.47% <50.00%> (-0.01%) ⬇️
agent-for-php-7.3 77.49% <50.00%> (-0.01%) ⬇️
agent-for-php-7.4 77.36% <50.00%> (-0.01%) ⬇️
agent-for-php-8.0 76.56% <50.00%> (-0.01%) ⬇️
agent-for-php-8.1 76.88% <50.00%> (-0.01%) ⬇️
agent-for-php-8.2 76.50% <50.00%> (-0.01%) ⬇️
agent-for-php-8.3 76.50% <50.00%> (-0.01%) ⬇️
agent-for-php-8.4 76.52% <50.00%> (-0.01%) ⬇️

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

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

@zsistla zsistla added this to the next-release milestone Jun 5, 2025
@zsistla zsistla merged commit ca08b5a into dev Jun 5, 2025
178 of 181 checks passed
@zsistla zsistla deleted the composer_null_check branch June 5, 2025 17:16
@zsistla zsistla modified the milestones: 11.9 Release, next-release Jun 17, 2025
hahuja2 pushed a commit that referenced this pull request Jul 9, 2025
`nr_execute_handle_autoload` wasn't accounting for the possibility of
txn being null which would lead to unpredictable behavior when accessing
it
[here](https://github.com/newrelic/newrelic-php-agent/blob/dev/agent/php_execute.c#L894),
and we would cause corruption when we [set this
value](https://github.com/newrelic/newrelic-php-agent/blob/dev/agent/php_execute.c#L907).

txn can be null in cases where nr_php_txn_end has been called.
such as:
https://github.com/newrelic/newrelic-php-agent/blob/dev/agent/fw_laravel_queue.c#L355-L356
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants