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

[Bug]: Standalone null Return Type for update_span_duration Causes Phan Parsing to Fail for PHP <8.2 #2585

Closed
scott-shields-github opened this issue Mar 20, 2024 · 1 comment · Fixed by #2586
Labels
🐛 bug Something isn't working

Comments

@scott-shields-github
Copy link

Bug report

The standalone null return type for update_span_duration causes Phan parsing to fail with a segfault. This function looks like it can return false|null like close_span; can this be updated to match close_span's return type? This looks like it affects lib versions 0.94.0 - latest.

I'd contribute, but I don't think I can at the moment without signoff.

PHP version

8.1.25

Tracer or profiler version

0.98.1

Installed extensions

No response

Output of phpinfo()

No response

Upgrading from

No response

@scott-shields-github scott-shields-github added the 🐛 bug Something isn't working label Mar 20, 2024
@morrisonlevi
Copy link
Collaborator

Indeed, it looks like it should be false|null, returning false on invalid parameters:

dd-trace-php/ext/ddtrace.c

Lines 2324 to 2329 in 5d2c3cb

PHP_FUNCTION(DDTrace_update_span_duration) {
double finish_time_seconds = 0;
zval *spanzv = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|d", &spanzv, ddtrace_ce_span_data, &finish_time_seconds) != SUCCESS) {
RETURN_FALSE;
}

@bwoebi Should we update false here or take an alternative action?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants