Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent allocation error #73

Merged
merged 6 commits into from
Jan 22, 2021
Merged

Prevent allocation error #73

merged 6 commits into from
Jan 22, 2021

Conversation

joshuabenuck
Copy link
Contributor

This PR prevents an allocation error that occurs in the Drupal instrumentation and improves our logging when allocation errors do occur.

Specifically, these changes:

  • Log a stack trace whenever an allocation error occurs. This should make tracking down future allocation errors easier.
  • Logs a message at verbosedebug when the Drupal framework instrumentation problem is detected. This is consistent with the other related log messages.
  • Create a Supportability metric in addition to the log message.

The name of the Supportability metric is either: Supportability/framework/Drupal/NegativeModuleLength or Supportability/framework/Drupal8/NegativeModuleLength. This is modeled after the MiddlewareNotCallable supportability metric the Guzzle 6 instrumentation sends.

The change to config.m4 is done to fix a build error that occurs with the addition of the calls to nr_tracer_common in util_memory.c (undefined reference to dladdr). The reason this problem occurs now is that our test program calls nro_new from util_object.c which in turn calls functions from util_memory.c which now depend on util_signals.c and it has a reference to dladdr. Prior to this change, no symbols from util_signals were needed so the linker never had to resolve the dladdr reference when building the test.

The fix is to ensure that the reference to the dl library occurs after the reference to the axiom library when linking. The problem is that the intuitive places to put the reference to the dl library are all placed before the reference to axiom. By tacking on an -ldl to the first argument of PHP_CHECK_LIBRARY, the library reference is placed in the appropriate place when building the lib axiom test program.

Fahmy-Mohammed
Fahmy-Mohammed previously approved these changes Jan 13, 2021
Joshua Benuck added 3 commits January 13, 2021 14:27
* Log stack traces when an allocation error is encountered
* Send a Supportability metric about the module length problem
* Fix linker error during axiom lib check in agent build
kneitinger
kneitinger previously approved these changes Jan 21, 2021
zsistla
zsistla previously approved these changes Jan 21, 2021
* Remove -ldl in agent autoconf axiom check on BSD

* Move AXIOM_CHECK variable setting to system-dependent section
@kneitinger kneitinger dismissed stale reviews from zsistla and themself via a2a72d3 January 21, 2021 21:33
@kneitinger
Copy link
Contributor

ok jenkins

@newrelic newrelic deleted a comment from joshuabenuck Jan 22, 2021
@kneitinger
Copy link
Contributor

ok jenkins

Copy link
Contributor

@kneitinger kneitinger left a comment

Choose a reason for hiding this comment

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

Re-approval after autoconf fix was merged in. That PR was approved, as well as this PR prior to the merge.

@kneitinger kneitinger merged commit 3a850aa into main Jan 22, 2021
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.

4 participants