Skip to content

Commit d1176f1

Browse files
Merge pull request #1038 from newrelic/dev
Release 11.7
2 parents 4bb2f2a + 70fd59c commit d1176f1

File tree

3,106 files changed

+13815
-929279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,106 files changed

+13815
-929279
lines changed

.github/workflows/codeql.yml

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
# ℹ️ Command-line programs to run using the OS shell.
5353
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
5454

55+
- name: Provision agent's build dependencies
56+
if: ${{ matrix.language == 'c-cpp' }}
57+
run: |
58+
sudo apt-get update
59+
sudo apt-get install -y libprotobuf-c-dev protobuf-c-compiler
60+
5561
- name: Build
5662
run: |
5763
make ${{ matrix.language == 'go' && 'daemon' || 'agent' }}

Makefile

+12-21
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ bin/:
227227
#
228228

229229
.PHONY: axiom
230-
axiom: vendor
230+
axiom: protobuf-c
231231
$(MAKE) -C axiom
232232

233233
#
@@ -238,15 +238,15 @@ axiom: vendor
238238
# TESTARGS =
239239

240240
.PHONY: axiom-tests
241-
axiom-tests: vendor
241+
axiom-tests: protobuf-c
242242
$(MAKE) -C axiom tests
243243

244244
.PHONY: axiom-check axiom-run-tests
245-
axiom-check axiom-run-tests: vendor axiom/tests/cross_agent_tests
245+
axiom-check axiom-run-tests: protobuf-c axiom/tests/cross_agent_tests
246246
$(MAKE) -C axiom run_tests
247247

248248
.PHONY: axiom-valgrind
249-
axiom-valgrind: vendor axiom/tests/cross_agent_tests
249+
axiom-valgrind: protobuf-c axiom/tests/cross_agent_tests
250250
$(MAKE) -C axiom valgrind
251251

252252
.PHONY: tests
@@ -279,9 +279,7 @@ axiom-clean:
279279
daemon-protobuf: daemon/internal/newrelic/infinite_tracing/com_newrelic_trace_v1/v1.pb.go
280280

281281
daemon/internal/newrelic/infinite_tracing/com_newrelic_trace_v1/v1.pb.go: protocol/infinite_tracing/v1.proto
282-
$(MAKE) vendor # Only build vendor stuff if v1.proto has changed. Otherwise
283-
# this rule will be triggered every time the daemon is built.
284-
$(VENDOR_PREFIX)/bin/protoc \
282+
protoc \
285283
-I=./protocol/infinite_tracing \
286284
--go_out="paths=source_relative,plugins=grpc:daemon/internal/newrelic/infinite_tracing/com_newrelic_trace_v1" \
287285
protocol/infinite_tracing/v1.proto
@@ -403,7 +401,7 @@ coverage:
403401
#
404402

405403
.PHONY: clean
406-
clean: agent-clean axiom-clean daemon-clean package-clean coverage-clean vendor-clean
404+
clean: agent-clean axiom-clean daemon-clean package-clean coverage-clean
407405
rm -rf releases
408406
rm -f agent/newrelic.map agent/LicenseData/license_errors.txt
409407

@@ -441,21 +439,14 @@ lasp-test-all:
441439
$(MAKE) lasp-test SUITE_LASP=suite-random-3
442440

443441
#
444-
# Vendored libraries
442+
# Check for protobuf-c (HAVE_PROTOBUF_C):
443+
# - axiom build needs protoc-c (protobuf-c-compiler)
444+
# - agent build needs protobuf-c static library (protobuf-c-devel)
445445
#
446-
export GIT
447-
448-
.PHONY: vendor vendor-clean
446+
.PHONY: protobuf-c
447+
protobuf-c:
449448
ifeq (0,$(HAVE_PROTOBUF_C))
450-
vendor:
451-
$(MAKE) -C vendor all
452-
453-
vendor-clean:
454-
$(MAKE) -C vendor clean
455-
else
456-
vendor: ;
457-
458-
vendor-clean: ;
449+
$(error Build dependency 'protobuf-c' not found.)
459450
endif
460451

461452
#

THIRD_PARTY_NOTICES.md

+41
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ by e-mailing [[email protected]](mailto:[email protected]).
2323
* [PCRE](#pcre)
2424
* [PHP](#php)
2525
* [Portable OpenSSH](#portable-openssh)
26+
* [protobuf-c](#protobuf-c)
2627
* [TSRM](#tsrm)
2728
* [Symfony](#symfony)
2829

@@ -895,6 +896,46 @@ under
895896
*/
896897
```
897898

899+
## protobuf-c
900+
901+
This product includes [protobuf-c]https://github.com/protobuf-c/protobuf-c) ([v1.3.3](https://github.com/protobuf-c/protobuf-c/tree/v1.3.3)),
902+
distributed under the [protobuf-c license](https://github.com/protobuf-c/protobuf-c/blob/v1.3.3/LICENSE):
903+
904+
```
905+
Copyright (c) 2008-2016, Dave Benson and the protobuf-c authors.
906+
All rights reserved.
907+
908+
Redistribution and use in source and binary forms, with or without
909+
modification, are permitted provided that the following conditions are
910+
met:
911+
912+
* Redistributions of source code must retain the above copyright
913+
notice, this list of conditions and the following disclaimer.
914+
915+
* Redistributions in binary form must reproduce the above
916+
copyright notice, this list of conditions and the following disclaimer
917+
in the documentation and/or other materials provided with the
918+
distribution.
919+
920+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
921+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
922+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
923+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
924+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
925+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
926+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
927+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
928+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
929+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
930+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
931+
932+
The code generated by the protoc-gen-c code generator and by the
933+
protoc-c compiler is owned by the owner of the input files used when
934+
generating it. This code is not standalone and requires a support
935+
library to be linked with it. This support library is covered by the
936+
above license.
937+
```
938+
898939
## TSRM
899940

900941
This product includes source derived from

agent/fw_drupal.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,7 @@ static void nr_drupal_wrap_hook_within_module_invoke_all(
484484
*/
485485
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
486486
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
487-
zval* curr_hook
488-
= (zval*)nr_stack_get_top(&NRPRG(drupal_invoke_all_hooks));
487+
zval* curr_hook = (zval*)nr_stack_get_top(&NRPRG(drupal_invoke_all_hooks));
489488
if (!nr_php_is_zval_non_empty_string(curr_hook)) {
490489
nrl_verbosedebug(NRL_FRAMEWORK,
491490
"%s: cannot extract hook name from global stack",

agent/fw_drupal8.c

+30-31
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ NR_PHP_WRAPPER(nr_drupal_exception) {
6666

6767
if (NR_SUCCESS
6868
!= nr_php_error_record_exception(NRPRG(txn), exception, priority, true,
69-
NULL,
70-
&NRPRG(exception_filters))) {
69+
NULL, &NRPRG(exception_filters))) {
7170
nrl_verbosedebug(NRL_TXN, "Drupal: unable to record exception");
7271
}
7372

@@ -134,12 +133,12 @@ static void nr_drupal8_add_method_callback(const zend_class_entry* ce,
134133
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
135134
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
136135
static void nr_drupal8_add_method_callback_before_after_clean(
137-
const zend_class_entry* ce,
138-
const char* method,
139-
size_t method_len,
140-
nrspecialfn_t before_callback,
141-
nrspecialfn_t after_callback,
142-
nrspecialfn_t clean_callback) {
136+
const zend_class_entry* ce,
137+
const char* method,
138+
size_t method_len,
139+
nrspecialfn_t before_callback,
140+
nrspecialfn_t after_callback,
141+
nrspecialfn_t clean_callback) {
143142
zend_function* function = NULL;
144143

145144
if (NULL == ce) {
@@ -164,13 +163,13 @@ static void nr_drupal8_add_method_callback_before_after_clean(
164163
nr_php_class_entry_name(ce), NRSAFELEN(method_len), method);
165164

166165
nr_php_wrap_user_function_before_after_clean(
167-
class_method, nr_strlen(class_method),
168-
before_callback, after_callback, clean_callback);
166+
class_method, nr_strlen(class_method), before_callback, after_callback,
167+
clean_callback);
169168

170169
nr_free(class_method);
171170
}
172171
}
173-
#endif // OAPI
172+
#endif // OAPI
174173

175174
/*
176175
* Purpose : Check if the given function or method is in the current call
@@ -501,8 +500,7 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_callback) {
501500

502501
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
503502
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
504-
zval* curr_hook
505-
= (zval*)nr_stack_get_top(&NRPRG(drupal_invoke_all_hooks));
503+
zval* curr_hook = (zval*)nr_stack_get_top(&NRPRG(drupal_invoke_all_hooks));
506504
if (UNEXPECTED(!nr_php_is_zval_non_empty_string(curr_hook))) {
507505
nrl_verbosedebug(NRL_FRAMEWORK,
508506
"%s: cannot extract hook name from global stack",
@@ -515,7 +513,7 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_callback) {
515513
nr_drupal_hook_instrument(Z_STRVAL_P(module), Z_STRLEN_P(module),
516514
NRPRG(drupal_invoke_all_hook),
517515
NRPRG(drupal_invoke_all_hook_len) TSRMLS_CC);
518-
#endif // OAPI
516+
#endif // OAPI
519517

520518
leave:
521519
NR_PHP_WRAPPER_CALL;
@@ -536,7 +534,7 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with) {
536534
|| defined OVERWRITE_ZEND_EXECUTE_DATA
537535
char* prev_hook = NULL;
538536
int prev_hook_len;
539-
#endif // not OAPI
537+
#endif // not OAPI
540538

541539
(void)wraprec;
542540

@@ -547,7 +545,7 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with) {
547545
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
548546
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
549547
nr_php_arg_release(&hook);
550-
#endif // OAPI
548+
#endif // OAPI
551549
goto leave;
552550
}
553551

@@ -561,7 +559,7 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with) {
561559
= nr_strndup(Z_STRVAL_P(hook), Z_STRLEN_P(hook));
562560
NRPRG(drupal_invoke_all_hook_len) = Z_STRLEN_P(hook);
563561
NRPRG(check_cufa) = true;
564-
#endif // OAPI
562+
#endif // OAPI
565563
callback = nr_php_arg_get(2, NR_EXECUTE_ORIG_ARGS TSRMLS_CC);
566564

567565
/* This instrumentation will fail if callback has already been wrapped
@@ -581,14 +579,14 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with) {
581579
if (NULL == NRPRG(drupal_invoke_all_hook)) {
582580
NRPRG(check_cufa) = false;
583581
}
584-
#endif // not OAPI
582+
#endif // not OAPI
585583

586-
leave: ;
584+
leave:;
587585
#if ZEND_MODULE_API_NO < ZEND_8_0_X_API_NO \
588586
|| defined OVERWRITE_ZEND_EXECUTE_DATA
589587
/* for OAPI, the _after callback handles this free */
590588
nr_php_arg_release(&hook);
591-
#endif // not OAPI
589+
#endif // not OAPI
592590
}
593591
NR_PHP_WRAPPER_END
594592

@@ -605,7 +603,7 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_clean) {
605603
nr_drupal_invoke_all_hook_stacks_pop();
606604
}
607605
NR_PHP_WRAPPER_END
608-
#endif // OAPI
606+
#endif // OAPI
609607

610608
/*
611609
* Purpose : Wrap the invoke() method of the module handler instance in use.
@@ -642,10 +640,8 @@ NR_PHP_WRAPPER(nr_drupal8_module_handler) {
642640
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
643641
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
644642
nr_drupal8_add_method_callback_before_after_clean(
645-
ce, NR_PSTR("invokeallwith"),
646-
nr_drupal94_invoke_all_with,
647-
nr_drupal94_invoke_all_with_after,
648-
nr_drupal94_invoke_all_with_clean);
643+
ce, NR_PSTR("invokeallwith"), nr_drupal94_invoke_all_with,
644+
nr_drupal94_invoke_all_with_after, nr_drupal94_invoke_all_with_clean);
649645
#else
650646
nr_drupal8_add_method_callback(ce, NR_PSTR("invokeallwith"),
651647
nr_drupal94_invoke_all_with TSRMLS_CC);
@@ -766,14 +762,16 @@ void nr_drupal8_enable(TSRMLS_D) {
766762
*/
767763
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
768764
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
765+
// clang-format off
769766
nr_php_wrap_user_function_before_after_clean(
770-
NR_PSTR("Symfony\\Component\\HttpKernel\\EventListe"
771-
"ner\\RouterListener::onKernelRequest"),
767+
NR_PSTR("Symfony\\Component\\HttpKernel\\EventListener\\RouterListener::onKernelRequest"),
772768
nr_drupal8_name_the_wt_via_symfony, NULL, NULL);
769+
// clang-format on
773770
#else
774-
nr_php_wrap_user_function(NR_PSTR("Symfony\\Component\\HttpKernel\\EventListe"
775-
"ner\\RouterListener::onKernelRequest"),
771+
// clang-format off
772+
nr_php_wrap_user_function(NR_PSTR("Symfony\\Component\\HttpKernel\\EventListener\\RouterListener::onKernelRequest"),
776773
nr_drupal8_name_the_wt_via_symfony TSRMLS_CC);
774+
// clang-format on
777775
#endif
778776

779777
/*
@@ -783,9 +781,10 @@ void nr_drupal8_enable(TSRMLS_D) {
783781
* above, but kicks in for use cases where the RouterListener is not
784782
* involved.
785783
*/
786-
nr_php_wrap_user_function(NR_PSTR("Drupal\\Core\\Controller\\ControllerResolv"
787-
"er::getControllerFromDefinition"),
784+
// clang-format off
785+
nr_php_wrap_user_function(NR_PSTR("Drupal\\Core\\Controller\\ControllerResolver::getControllerFromDefinition"),
788786
nr_drupal8_name_the_wt TSRMLS_CC);
787+
// clang-format on
789788

790789
/*
791790
* ExceptionSubscribers handle Drupal errors and exceptions before

agent/fw_drupal_common.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ nr_status_t module_invoke_all_parse_module_and_hook_from_strings(
177177
nrl_verbosedebug(NRL_FRAMEWORK,
178178
"%s: module len is %d; ; "
179179
"hook='%.*s'; module_hook='%.*s'",
180-
__func__, (int)module_len, NRSAFELEN(hook_len), NRSAFESTR(hook),
181-
NRSAFELEN(module_hook_len), NRSAFESTR(module_hook));
180+
__func__, (int)module_len, NRSAFELEN(hook_len),
181+
NRSAFESTR(hook), NRSAFELEN(module_hook_len),
182+
NRSAFESTR(module_hook));
182183

183184
return NR_FAILURE;
184185
}

agent/fw_drupal_common.h

+10-8
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,25 @@ nr_status_t module_invoke_all_parse_module_and_hook_from_strings(
147147
*/
148148
void nr_drupal_headers_add(zval* arg, bool is_drupal_7 TSRMLS_DC);
149149

150-
151150
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
152151
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
153152
/*
154-
* Purpose: Before an invoke_all style call, adds the hook to that hook states stacks
153+
* Purpose: Before an invoke_all style call, adds the hook to that hook states
154+
* stacks
155155
*
156-
* Params : 1. A zval holding a copy of the hook invoked, to be managed by the hook
157-
* states stacks and freed by nr_drupal_invoke_all_hook_stacks_pop() after the
158-
* invoke_all call completes
156+
* Params : 1. A zval holding a copy of the hook invoked, to be managed by the
157+
* hook states stacks and freed by
158+
* nr_drupal_invoke_all_hook_stacks_pop() after the invoke_all call
159+
* completes
159160
*/
160161
void nr_drupal_invoke_all_hook_stacks_push(zval* hook_copy);
161162

162163
/*
163-
* Purpose: After an invoke_all style call, pops that states stack and conditionally
164-
* pops the hook stack based on the previously popped state
164+
* Purpose: After an invoke_all style call, pops that states stack and
165+
* conditionally pops the hook stack based on the previously
166+
* popped state
165167
*/
166168
void nr_drupal_invoke_all_hook_stacks_pop();
167-
#endif // OAPI
169+
#endif // OAPI
168170

169171
#endif /* FW_DRUPAL_COMMON_HDR */

0 commit comments

Comments
 (0)