Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/use-updatec…
Browse files Browse the repository at this point in the history
…li-policy-3

* upstream/main:
  updatecli: use shared policy apm-gherkin (#1185)
  Fixed memory leak in exception handling (#1159) (#1174)
  • Loading branch information
v1v committed Jul 5, 2024
2 parents 9967f7f + 2465af7 commit 70a3787
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions agent/native/ext/lifecycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ void elasticApmZendThrowExceptionHookImpl(
resetLastThrown();

#if PHP_MAJOR_VERSION >= 8 /* if PHP version is 8.* and later */
zval thrownAsZval;
zval* thrownAsPzval = &thrownAsZval;
ZVAL_OBJ_COPY( /* dst: */ thrownAsPzval, /* src: */ thrownAsPzobj );
ZVAL_OBJ_COPY(&ELASTICAPM_G( lastException ), thrownAsPzobj );
#else
ZVAL_COPY(&ELASTICAPM_G(lastException), thrownAsPzval );
#endif
ZVAL_COPY( /* pZvalDst: */ &ELASTICAPM_G(lastException), /* pZvalSrc: */ thrownAsPzval );

ELASTIC_APM_LOG_DEBUG_FUNCTION_EXIT();
}
Expand Down Expand Up @@ -577,7 +576,7 @@ void elasticApmRequestShutdown()
ELASTIC_APM_LOG_DEBUG( "opcache.preload request detected on shutdown" );
return;
}

if (ELASTICAPM_G(globals)->periodicTaskExecutor_) {
ELASTIC_APM_LOG_DEBUG("pausing inferred spans thread");
ELASTICAPM_G(globals)->periodicTaskExecutor_->suspendPeriodicTasks();
Expand Down Expand Up @@ -681,4 +680,4 @@ ResultCode elasticApmEnterAgentCode( String dbgCalledFromFile, int dbgCalledFrom

failure:
goto finally;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function buildCommandLine(array $ports): string
{
Assert::assertCount(1, $ports);
return InfraUtilForTests::buildAppCodePhpCmd($this->agentConfigSourceBuilder->getPhpIniFile())
. " -S localhost:" . $ports[0]
. " -S 0.0.0.0:" . $ports[0]
. ' "' . FileUtilForTests::listToPath([__DIR__, self::APP_CODE_HOST_ROUTER_SCRIPT]) . '"';
}

Expand Down

0 comments on commit 70a3787

Please sign in to comment.