wasmCloud / wasmCloud

wasmCloud is an open source Cloud Native Computing Foundation (CNCF) project that enables teams to build, manage, and scale polyglot apps across any cloud, K8s, or edge.
https://wasmcloud.com
Apache License 2.0
1.45k stars 140 forks source link

[BUG] wasmcloud logs don't report MemoryOutOfBounds error #3050

Open cdmurph32 opened 1 week ago

cdmurph32 commented 1 week ago

Affected project(s)

Describe the bug

Nothing is logged If a component hits a MemoryOutOfBounds error.

Steps to reproduce

  1. Remove -z stack-size=2097152 from https://github.com/cdmurph32/pdf-text-example/blob/main/Makefile#L15
  2. make and run pdf-text-example
  3. Remove call to print_pdf_text https://github.com/cdmurph32/pdf-text-example/blob/main/pdf_text.c#L230, this doesn't work for different reasons.
  4. Post a PDF to the service curl -X POST --data-binary "@pdfio/testfiles/testpdfio.pdf" localhost:8080 to hit a MemoryOutOfBounds error

Expected behavior

I expect the an error to be in the wasmcloud logs.

Environment

Screenshots / Logs / Additional context

No response

rvolosatovs commented 1 week ago

We just found out that component export handling failures were never logged and fixed that in https://github.com/wasmCloud/wasmCloud/pull/3060

@cdmurph32 could you test if there's now an error reported if you use wasmCloud from latest main?

cdmurph32 commented 1 week ago

There is now this message in the logs.

WARN wasmcloud_host::wasmbus: failed to serve invocation err=failed to serve `wrpc:http/incoming-handler@0.1.0.handle` invocation

commit ad8aecddaf097ae678518e5b3be681e1cb8b5132

cdmurph32 commented 1 week ago

It would be nice if the log could give the same output as wasmtime. These types of errors could be completely dependent on the payload, in this case the size of the payload. It would help debugging production issues.

rvolosatovs commented 22 minutes ago

Since https://github.com/wasmCloud/wasmCloud/pull/3117 is merged, we should be logging the Wasmtime error as well, could you confirm that all the output you expect is now available in latest main? You should now see up to two log statements on errors here (https://github.com/wasmCloud/wasmCloud/pull/3117/commits/6ab5521e69d235b15b79b66aea8035f260114478)