Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpreter crashed with InvokeError TrapCode MemoryOutOfBounds #141

Closed
folex opened this issue Sep 21, 2021 · 1 comment
Closed

Interpreter crashed with InvokeError TrapCode MemoryOutOfBounds #141

folex opened this issue Sep 21, 2021 · 1 comment
Assignees
Labels
A-memory area: related to improving memory hadling C-bug category: bug

Comments

@folex
Copy link
Member

folex commented Sep 21, 2021

The Interpreter on one of the Krasnodar nodes started to crash on every particle, even with a very small script.

Here's the error

[/usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-runtime-core-fl-0.17.1/src/instance.rs:610] &error = InvokeError(
    TrapCode {
        code: MemoryOutOfBounds,
        srcloc: 579697,
    },
)

All scripts triggered the problem, even this small:

(seq
    (call "12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf" ("op" "noop") [])
    (null)
)
Full error from node logs (click to open):
[2021-09-21T08:42:47.966793Z INFO  particle_node::network_api] 12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf Will execute particle 04257f25-c28a-4f58-92fd-026b6dda083b
[2021-09-21T08:42:47.967347Z INFO  aquamarine::particle_executor] Executing particle 04257f25-c28a-4f58-92fd-026b6dda083b
[/usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-runtime-core-fl-0.17.1/src/instance.rs:610] &error = InvokeError(
    TrapCode {
        code: MemoryOutOfBounds,
        srcloc: 579697,
    },
)
[2021-09-21T08:42:47.970987Z WARN  aquamarine::particle_executor] Error executing particle Particle {
        id: "04257f25-c28a-4f58-92fd-026b6dda083b",
        init_peer_id: PeerId(
            "12D3KooWRA76ycP8RjPCGLzBXofANaLGvbB79KrCaKvKGmRaaHxL",
        ),
        timestamp: 1632213767858,
        ttl: 60000,
        script: "\n(seq\n    (call %init_peer_id% (\"load\" \"load_relay\") [] init_relay)\n    \n    (xor\n        \n(seq\n    (call %init_peer_id% (\"load\" \"load_variable\") [\"myPeerId\"] myPeerId)\n    \n(seq\n    (call %init_peer_id% (\"load\" \"load_variable\") [\"__relay\"] __relay)\n    \n        (seq \n            (call __relay (\"dist\" \"list_modules\") [] result)\n            (call myPeerId (\"_callback\" \"getModules\") [result])\n        )\n    \n)\n)\n        (xor\n            (match init_relay \"\"\n                (call %init_peer_id% (\"__magic\" \"handle_xor\") [%last_error%])\n            )\n            (seq \n                (call init_relay (\"op\" \"identity\") [])\n                (call %init_peer_id% (\"__magic\" \"handle_xor\") [%last_error%])\n            )\n        )\n    )\n)",
        signature: [],
        data: eyJ0cmFjZSI6W3siY2FsbCI6eyJleGVjdXRlZCI6eyJzY2FsYXIiOiIxMkQzS29vV0hMeFZoVVF5QXVaZTZBSE1CMjlQN3drdlROTW43ZURNY3NxaW1KWUxLUkVmIn19fSx7ImNhbGwiOnsiZXhlY3V0ZWQiOnsic2NhbGFyIjoiMTJEM0tvb1dSQTc2eWNQOFJqUENHTHpCWG9mQU5hTEd2YkI3OUtyQ2FLdktHbVJhYUh4TCJ9fX0seyJjYWxsIjp7ImV4ZWN1dGVkIjp7InNjYWxhciI6IjEyRDNLb29XSEx4VmhVUXlBdVplNkFITUIyOVA3d2t2VE5NbjdlRE1jc3FpbUpZTEtSRWYifX19LHsiY2FsbCI6eyJzZW50X2J5IjoiMTJEM0tvb1dSQTc2eWNQOFJqUENHTHpCWG9mQU5hTEd2YkI3OUtyQ2FLdktHbVJhYUh4TCJ9fV0sInN0cmVhbXMiOnt9LCJ2ZXJzaW9uIjoiMC4yLjAifQ==,
    }: engine error: Execution error: `call-core 7` failed while calling the local or import function `invoke`
[2021-09-21T08:42:47.971512Z WARN  aquamarine::aqua_runtime] Error executing particle Particle {
        id: "04257f25-c28a-4f58-92fd-026b6dda083b",
        init_peer_id: PeerId(
            "12D3KooWRA76ycP8RjPCGLzBXofANaLGvbB79KrCaKvKGmRaaHxL",
        ),
        timestamp: 1632213767858,
        ttl: 60000,
        script: "\n(seq\n    (call %init_peer_id% (\"load\" \"load_relay\") [] init_relay)\n    \n    (xor\n        \n(seq\n    (call %init_peer_id% (\"load\" \"load_variable\") [\"myPeerId\"] myPeerId)\n    \n(seq\n    (call %init_peer_id% (\"load\" \"load_variable\") [\"__relay\"] __relay)\n    \n        (seq \n            (call __relay (\"dist\" \"list_modules\") [] result)\n            (call myPeerId (\"_callback\" \"getModules\") [result])\n        )\n    \n)\n)\n        (xor\n            (match init_relay \"\"\n                (call %init_peer_id% (\"__magic\" \"handle_xor\") [%last_error%])\n            )\n            (seq \n                (call init_relay (\"op\" \"identity\") [])\n                (call %init_peer_id% (\"__magic\" \"handle_xor\") [%last_error%])\n            )\n        )\n    )\n)",
        signature: [],
        data: eyJ0cmFjZSI6W3siY2FsbCI6eyJleGVjdXRlZCI6eyJzY2FsYXIiOiIxMkQzS29vV0hMeFZoVVF5QXVaZTZBSE1CMjlQN3drdlROTW43ZURNY3NxaW1KWUxLUkVmIn19fSx7ImNhbGwiOnsiZXhlY3V0ZWQiOnsic2NhbGFyIjoiMTJEM0tvb1dSQTc2eWNQOFJqUENHTHpCWG9mQU5hTEd2YkI3OUtyQ2FLdktHbVJhYUh4TCJ9fX0seyJjYWxsIjp7ImV4ZWN1dGVkIjp7InNjYWxhciI6IjEyRDNLb29XSEx4VmhVUXlBdVplNkFITUIyOVA3d2t2VE5NbjdlRE1jc3FpbUpZTEtSRWYifX19LHsiY2FsbCI6eyJzZW50X2J5IjoiMTJEM0tvb1dSQTc2eWNQOFJqUENHTHpCWG9mQU5hTEd2YkI3OUtyQ2FLdktHbVJhYUh4TCJ9fV0sInN0cmVhbXMiOnt9LCJ2ZXJzaW9uIjoiMC4yLjAifQ==,
    }: engine error: Execution error: `call-core 7` failed while calling the local or import function `invoke`

I have dumped the memory with gcore:

# gcore 955834
[New LWP 955847]
[New LWP 955849]
[New LWP 955850]
[New LWP 955851]
[New LWP 955852]
[New LWP 955855]
[New LWP 955856]
[New LWP 955875]
[New LWP 955876]
[New LWP 955877]
[New LWP 955911]
warning: Expected absolute pathname for libpthread in the inferior, but got target:/lib/x86_64-linux-gnu/libpthread.so.0.
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable.  Connect to gdbserver inside the container.
warning: Expected absolute pathname for libpthread in the inferior, but got target:/lib/x86_64-linux-gnu/libpthread.so.0.
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
0x00007fb6ad8cead3 in pthread_cond_wait@@GLIBC_2.3.2 () from target:/lib/x86_64-linux-gnu/libpthread.so.0
warning: target file /proc/955834/cmdline contained unexpected null characters
warning: Memory read failed for corefile section, 4096 bytes at 0xffffffffff600000.
Saved corefile core.955834
[Inferior 1 (process 955834) detached]

core.955834.gz

@folex folex added the C-bug category: bug label Sep 21, 2021
@mikevoronov mikevoronov added the A-memory area: related to improving memory hadling label Nov 25, 2021
@mikevoronov
Copy link
Member

Introducing unwind panic handler in #144 resolved this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-memory area: related to improving memory hadling C-bug category: bug
Projects
None yet
Development

No branches or pull requests

2 participants