roadrunner-server / roadrunner-plugins

📦 Home for the roadrunner plugins
MIT License
25 stars 9 forks source link

[BUG] [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xd7d84e] #155

Closed brzuchal closed 2 years ago

brzuchal commented 2 years ago

Not much to say, it happens on reloading workers.

The version of RR used: version: 2.6.3, buildtime: 2021-12-03T11:37:00+0000

My .rr.yaml configuration is:

server:
    command: "php bin/console baldinof:roadrunner:worker"
    env:
        - APP_RUNTIME: Baldinof\RoadRunnerBundle\Runtime\Runtime
http:
    address: 0.0.0.0:3000
    uploads:
        forbid: [ ".php", ".exe", ".bat" ]
    headers:
        cors:
            allowed_origin: "*"
            allowed_headers: "*"
            allowed_methods: "GET,POST,PUT,DELETE"
            allow_credentials: false
            exposed_headers: "Cache-Control,Content-Type"
logs:
    mode: development
    channels:
        http:
            level: info
        server:
            level: info
            mode: raw
reload:
    enabled: true
    interval: 1s
    patterns: [".php", ".yaml"]
    services:
        http:
            dirs: ["."]
            recursive: true
status:
    address: localhost:3001
rpc:
    listen: tcp://127.0.0.1:6001

Errortrace, Backtrace or Panictrace

app_1  | 2021-12-07T08:38:20.105Z       DEBUG   reload          file was updated        {"path": "/app/var/cache/prod/App_KernelProdDebugContainer.php.lock", "name": "App_KernelProdDebugContainer.php.lock", "size": 0}
app_1  | 2021-12-07T08:38:21.106Z       INFO    http            HTTP plugin got restart request. Restarting...
app_1  | panic: runtime error: invalid memory address or nil pointer dereference
app_1  | [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xd7d84e]
app_1  | 
app_1  | goroutine 65 [running]:
app_1  | github.com/spiral/roadrunner-plugins/v2/http.(*Plugin).Reset(0xc00012ed10)
app_1  |        github.com/spiral/roadrunner-plugins/v2@v2.6.3/http/plugin.go:358 +0xee
app_1  | github.com/spiral/roadrunner-plugins/v2/resetter.(*Plugin).Reset(0xc000ae0e30, {0xc000221bf0, 0x4})
app_1  |        github.com/spiral/roadrunner-plugins/v2@v2.6.3/resetter/plugin.go:27 +0x142
app_1  | github.com/spiral/roadrunner-plugins/v2/reload.(*Plugin).Serve.func2()
app_1  |        github.com/spiral/roadrunner-plugins/v2@v2.6.3/reload/plugin.go:129 +0x2ee
app_1  | created by github.com/spiral/roadrunner-plugins/v2/reload.(*Plugin).Serve
app_1  |        github.com/spiral/roadrunner-plugins/v2@v2.6.3/reload/plugin.go:113 +0x27d

rustatian commented 2 years ago

Hey @brzuchal. Does it happen on every reload?

brzuchal commented 2 years ago

@rustatian no, it is really hard to spot the right preconditions. Tried replacing dependency version using composer, tried, warming up Symfony cache, tried with some Symfony config file changes to trigger the reload and no success in reproducing it. I fear that the above-mentioned segfault will be hard to spot.

rustatian commented 2 years ago

Did you restart RR between tries?

brzuchal commented 2 years ago

It's containerized so no. Unless you're asking to restart workers but I guess it has nothing to do.

rustatian commented 2 years ago

Got u, I'll try to reproduce, thanks.

rustatian commented 2 years ago

@brzuchal So, the RR fails on the first file change, am I right? I mean, it's not like for example working for an hour and then on random Reset fails.

brzuchal commented 2 years ago

Yes it was the only one file reload after lunch preceding line was actually RR version log entry

rustatian commented 2 years ago

Last week I found a bug in our container, but I haven't released a version. I'll try to reproduce this issue on the 2.6.3 and release the new one.

rustatian commented 2 years ago

@brzuchal Just curious, do you use reload plugin for the local development or in the production?

brzuchal commented 2 years ago

@rustatian no worries, development only, you just see the prod in container name cause I have default prod environment in Symfony app

rustatian commented 2 years ago

@brzuchal try the new version please: https://github.com/spiral/roadrunner-binary/releases/tag/v2.6.4 (wait few minutes till GitHub generates binaries and docker image)

rustatian commented 2 years ago

Hey @brzuchal, have you been faced this issue after RR updated to v2.6.4?

brzuchal commented 2 years ago

@rustatian no, but TBH didn't manage to test it well on local since had to switch projects. BTW in the meantime, the fixed version works with production settings on our staging environment for 6h with no issues (ofc without reloader, but 🤷 ) This is all I can say.

rustatian commented 2 years ago

It's ok, thanks for the feedback, let's wait more time to be sure 🧑‍🏭

rustatian commented 2 years ago

Hey @brzuchal , any updates on this? 😃

rustatian commented 2 years ago

Friendly ping @brzuchal, any updates on this?

brzuchal commented 2 years ago

Sorry, @rustatian but am on another project for the next 3w, this version runs on production settings without the watcher for 2w now. That's the max I can give you.

rustatian commented 2 years ago

Ok, np. I'll close this issue since we haven't seen it on our envs as well. Feel free to reopen it if it still exists. Thanks.