Skip to content

fix(profiling): crash due to AAS getenv#3746

Merged
morrisonlevi merged 1 commit intomasterfrom
levi/azure-getenv
Mar 27, 2026
Merged

fix(profiling): crash due to AAS getenv#3746
morrisonlevi merged 1 commit intomasterfrom
levi/azure-getenv

Conversation

@morrisonlevi
Copy link
Copy Markdown
Collaborator

Description

When the profiler uploads its payload, it looks at various environment variables related to Azure App Services (see ProfilesExporter::new in libdatadog, which calls libdd_common::azure_app_services::AAS_METADATA). The problem is that this is being done on a background thread, so if the main PHP thread changes the environment, such as a php-fpm env, then it can crash.

The fix in this case is simple: just force the lock during minit before we have any threads.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@morrisonlevi morrisonlevi merged commit f1af9ca into master Mar 27, 2026
2098 of 2102 checks passed
@morrisonlevi morrisonlevi deleted the levi/azure-getenv branch March 27, 2026 14:30
@github-actions github-actions Bot added this to the 1.18.0 milestone Mar 27, 2026
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.

2 participants