Coder Social home page Coder Social logo

Padding is nonzero about go-diameter HOT 11 CLOSED

fiorix avatar fiorix commented on June 14, 2024
Padding is nonzero

from go-diameter.

Comments (11)

jaroszan avatar jaroszan commented on June 14, 2024

Can you please specify AVP type for which it is happening?

from go-diameter.

taseppa avatar taseppa commented on June 14, 2024

I noticed the problem with Session-Id (UTF8String) and Origin-Host (DiameterIdentity) at least.

from go-diameter.

jaroszan avatar jaroszan commented on June 14, 2024

I can see it as well, however for nested AVPs UTF8String is padded correctly in my case.

from go-diameter.

jaroszan avatar jaroszan commented on June 14, 2024

Curiously when I run examples scripts (client/server) all AVPs are padded correctly.

from go-diameter.

jaroszan avatar jaroszan commented on June 14, 2024

It seems that issue is reproducible when client's bench option is set to true in examples/client/client.go. AVPs in ACR/ACA are padded incorrectly.

from go-diameter.

jaroszan avatar jaroszan commented on June 14, 2024

It looks that it is somehow dependent on the order in which AVPs are added to a message.

from go-diameter.

fiorix avatar fiorix commented on June 14, 2024

This is not a fix for it, still trying to reproduce. I believe this bug was recently introduced by one of the changes in the encoder.

from go-diameter.

fiorix avatar fiorix commented on June 14, 2024

Can someone send me a pcap with the error? Can't reproduce using -bench=true, ACR/ACA looks ok here.

from go-diameter.

fiorix avatar fiorix commented on June 14, 2024

Never mind, I can reproduce it.

from go-diameter.

fiorix avatar fiorix commented on June 14, 2024

To get to the bottom of this one I instrumented the message and avp encoders with hex.Dump and noticed both were actually correct. However, when encoding messages we (re)use buffers from a sync.Pool, and those buffers were eventually dirty from previous usage. So the change is quite simple: reset padding bytes after serializing the avp. Ended up updating the serialization logic to be more straightforward, should be good now.

from go-diameter.

fiorix avatar fiorix commented on June 14, 2024

Let me know if there's any more trouble.

from go-diameter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.