Skip to content

[BUG]: Fuzz function FuzzComposeTracestate - Inconsistent composing/parsing #3626

@edznux-dd

Description

@edznux-dd

Tracer Version(s)

HEAD (f92a95e)

Go Version(s)

go version go1.23.5 linux/amd64

Bug Report

Running the already existing fuzz test causes a test failure for FuzzParseTraceparent here.

This specific test failure is cause by a symbol (like ~) character in the value of the provided that is then converted to a _ instead.

Note: I believe these fuzz tests are not run regularly part of CI. But as we will soon start to run these frequently internally, it'd be nice to get this fixed

Reproduction Code

Simply running the fuzzer should reproduce very quickly

cd ddtrace/tracer
go test -fuzz FuzzComposeTracestate -run FuzzComposeTracestate

If the fuzzer can't find find the issue, or if you want to run it as a regression directly, you can add a item in its testCases with the following values:

{priority: 1,
k1: "0", v1: "0",
k2: "0", v2: "=",
k3: "1", v3: "0",
oldState: "0"},

Causes the FuzzComposeTracestate fuzz function to fail.

Error Logs

pre compose: (map["_dd.p.0":"~" "_dd.p.1":"0" "tracestate":"dd=s:1;p:0000000000000000;t.0:_;t.1:0,0"])
is different from
parsed: (map["_dd.p.0":"_" "_dd.p.1":"0" "tracestate":"dd=s:1;p:0000000000000000;t.0:_;t.1:0,0"])
for tracestate of: (dd=s:1;p:0000000000000000;t.0:_;t.1:0,0)

Go Env Output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunintended behavior that has to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions