Code Monkey home page Code Monkey logo

Comments (4)

PROFeNoM avatar PROFeNoM commented on July 2, 2024

Hey @rdizio 👋

I've been trying to reproduce it (on Tinker or web requests), but I haven't been able to exhibit your behavior. Would you be able to provide a reproducer (e.g., a sample docker app) for the erroneous behavior?

image

Thanks!

from dd-trace-php.

rdizio avatar rdizio commented on July 2, 2024

Hi @PROFeNoM,

Yes, it seems like the behavior is not consistent for me. I ran new JsonResponse($user); and I only get the error after the 3er or second attempt. I don't know if this has anything to do with opcache or JIT:

Screenshot 2024-05-21 at 8 19 12 AM

from dd-trace-php.

rdizio avatar rdizio commented on July 2, 2024

@PROFeNoM let me know if you are able to replicate the issue. I'm can also send a docker demo app

from dd-trace-php.

PROFeNoM avatar PROFeNoM commented on July 2, 2024

Hi @rdizio,

Sorry for the delay. These last few days, I have had many things on my plate and didn't have enough time.

As can be seen in the (shortened) output below, even with JiT enabled, it doesn't seem like I can replicate the behavior (in PHP 8.1, 8.2, and 8.3).

If you can provide us with a docker demo app, then that's obviously ideal for us as that would streamline the investigation 😃 Otherwise, it may be interesting to first:

  • Enable the debug logs (I really don't expect anything, but it's always worth a try 🤷)
  • Disable JiT to see if the behavior persists. If this is JiT-related, a sample reproducer is even more essential, as the engine may have a particular loophole.
  • Find out where this str_pad call happens

Thanks for your assistance

> print_r(opcache_get_status());
[...]
    [jit] => Array
        (
            [enabled] => 1
            [on] => 1
            [kind] => 5
            [opt_level] => 5
            [opt_flags] => 6
            [buffer_size] => 536870896
            [buffer_free] => 536069024
        )

)
= true

> use App\Models\User;
> use Illuminate\Http\JsonResponse;
> $user = User::first();
[ddtrace] [debug] Loaded integration DDTrace\Integrations\PDO\PDOIntegration
= App\Models\User {#8577
    id: 1,
    name: "Admin",
    email: "[email protected]",
    #password: "$2y$10$RGjHiTCfFaVsrIr.AJBfOOGIOEn8xQCz7FthWFLzdzKPK7KM4zBf2",
    #remember_token: null,
    created_at: null,
    updated_at: null,
  }
> new JsonResponse($user);
= Illuminate\Http\JsonResponse {#8569
    +headers: Symfony\Component\HttpFoundation\ResponseHeaderBag {#129},
    +original: App\Models\User {#8577
      id: 1,
      name: "Admin",
      email: "[email protected]",
      #password: "$2y$10$RGjHiTCfFaVsrIr.AJBfOOGIOEn8xQCz7FthWFLzdzKPK7KM4zBf2",
      #remember_token: null,
      created_at: null,
      updated_at: null,
    },
    +exception: null,
  }

> new JsonResponse($user);
= Illuminate\Http\JsonResponse {#8939
    +headers: Symfony\Component\HttpFoundation\ResponseHeaderBag {#110},
    +original: App\Models\User {#8577
      id: 1,
      name: "Admin",
      email: "[email protected]",
      #password: "$2y$10$RGjHiTCfFaVsrIr.AJBfOOGIOEn8xQCz7FthWFLzdzKPK7KM4zBf2",
      #remember_token: null,
      created_at: null,
      updated_at: null,
    },
    +exception: null,
  }

[...]

from dd-trace-php.

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.