metacall / core

MetaCall: The ultimate polyglot programming experience.
https://metacall.io
Apache License 2.0
1.57k stars 160 forks source link

segmentation fault #448

Closed durgesh077 closed 1 year ago

durgesh077 commented 1 year ago

🐛 Bug Report

whenever we use api https://dashboard.metacall.io/api/package/create

{
runners:[]
jsons:[]
id:testing
type:application/zip
:[{"language_id":"node", "path":".","scripts":["./func2.js"]}]
}

as body (note: empty key name in json) we get segmentation fault and infinite loop and if we use

{
runners:[]
jsons:[]
id:testing
type:application/zip
}

i.e removed empty key name this doesn't have segmentation fault at least

Expected Behavior

it should either throw error or deploy successfully

Current Behavior

deploys infinitely

Possible Solution

Steps to Reproduce

  1. create a zip with some functions in js (say test.zip)
  2. add metacall-node.json
  3. try to deploy with body given above
durgesh077 commented 1 year ago

test.zip.zip

viferga commented 1 year ago

Solved.

https://github.com/metacall/core/commit/90adf3ec7c3bad4f467185bcff85981ae45fa322