Skip to content

Memory corruption when using JIT #16856

Closed

Description

@danog

Description

Running the https://github.com/amphp/pipeline unit tests on nightly with function or tracing JIT on nightly produces a memory corruption which is not detected by ASAN, which causes runtime "Event loop terminated without resuming the current suspension" exceptions.

The same memory corruption issue occasionally occurs on a production instance running code unrelated to amphp/pipeline on PHP 8.3 with opcache, without JIT (the cause there is likely different, but affecting the same memory area).

Reproducer: https://github.com/danog/jit_bugs/, bugs/14_pipeline.sh

PHP Version

nightly

Operating System

No response

Activity

  1. danog commented on Nov 19, 2024

    @danog
    ContributorAuthor

    Any pointers on what ASAN settings can be tweaked to make it detect the corruption (apart from the standard USE_ZEND_ALLOC=0 et al)?

  2. ndossche commented on Nov 19, 2024

    @ndossche
    Member

    Are you even sure that it's memory corruption in the first place?
    I would recommend using Valgrind if you can't reproduce it using ASAN.

  3. danog commented on Nov 19, 2024

    @danog
    ContributorAuthor

    Positive, since the issue occurs only with JIT, and it can't be a race condition since it's all single-threaded anyway.

    Will give valgrind a try!

  4. self-assigned this
    on Nov 25, 2024
  5. dstogov commented on Nov 26, 2024

    @dstogov
    Member

    This seems fixed via dstogov@5b955a7
    I can't reproduce this anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions