Skip to content

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

Closed

Description

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

Activity

  1. ghost added
    🐛 bugSomething isn't working
    on Mar 20, 2024
  2. morrisonlevi commented on Mar 20, 2024

    @morrisonlevi
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions