Coder Social home page Coder Social logo

Comments (16)

wenyongh avatar wenyongh commented on May 29, 2024

Yes, how about increasing it to 2048 for linux platform?

BTW, the size of argv_buf in wasm_runtime_invoke_native seems too large and unnecessary since normally the parameter count of wasm function and host function won't be very large:

uint64 argv_buf[32] = { 0 }, *argv1 = argv_buf, *ints, *stacks, size,
arg_i64;

How about we also decreasing it, e.g. uint64 argv_buf[12]?

from wasm-micro-runtime.

yamt avatar yamt commented on May 29, 2024

Yes, how about increasing it to 2048 for linux platform?

sure, it's the simplest solution.

BTW, the size of argv_buf in wasm_runtime_invoke_native seems too large and unnecessary since normally the parameter count of wasm function and host function won't be very large:

uint64 argv_buf[32] = { 0 }, *argv1 = argv_buf, *ints, *stacks, size,
arg_i64;

How about we also decreasing it, e.g. uint64 argv_buf[12]?

it makes sense to decrease it.
what's your rationale for 12?

from wasm-micro-runtime.

yamt avatar yamt commented on May 29, 2024

btw, i want to group these issues with a label, say, "native stack overflow detection".
can you give me necessary permissions?

ditto for exception-handling.

from wasm-micro-runtime.

wenyongh avatar wenyongh commented on May 29, 2024

btw, i want to group these issues with a label, say, "native stack overflow detection". can you give me necessary permissions?

ditto for exception-handling.

OK, done, please have a try.

from wasm-micro-runtime.

yamt avatar yamt commented on May 29, 2024

btw, i want to group these issues with a label, say, "native stack overflow detection". can you give me necessary permissions?
ditto for exception-handling.

OK, done, please have a try.

i can assign existing labels. but i can't create new labels.

from wasm-micro-runtime.

wenyongh avatar wenyongh commented on May 29, 2024

btw, i want to group these issues with a label, say, "native stack overflow detection". can you give me necessary permissions?
ditto for exception-handling.

OK, done, please have a try.

i can assign existing labels. but i can't create new labels.

I just assigned you with Triage role, creating the new label requires Write role, we need to discuss it internally. Shall I create the "native stack overflow detection" and "exception handling" labels for you first?

from wasm-micro-runtime.

yamt avatar yamt commented on May 29, 2024

btw, i want to group these issues with a label, say, "native stack overflow detection". can you give me necessary permissions?
ditto for exception-handling.

OK, done, please have a try.

i can assign existing labels. but i can't create new labels.

I just assigned you with Triage role, creating the new label requires Write role, we need to discuss it internally. Shall I create the "native stack overflow detection" and "exception handling" labels for you first?

yes. it's enough.

from wasm-micro-runtime.

wenyongh avatar wenyongh commented on May 29, 2024

Yes, how about increasing it to 2048 for linux platform?

sure, it's the simplest solution.

BTW, the size of argv_buf in wasm_runtime_invoke_native seems too large and unnecessary since normally the parameter count of wasm function and host function won't be very large:

uint64 argv_buf[32] = { 0 }, *argv1 = argv_buf, *ints, *stacks, size,
arg_i64;

How about we also decreasing it, e.g. uint64 argv_buf[12]?

it makes sense to decrease it. what's your rationale for 12?

In current libc-wasi, it seems that API wasi_path_open has the maximum argument count: 9 arguments + 1 exec_env = 10, I suppose 12 is big enough for most cases. Or any suggestion from you?

from wasm-micro-runtime.

wenyongh avatar wenyongh commented on May 29, 2024

btw, i want to group these issues with a label, say, "native stack overflow detection". can you give me necessary permissions?
ditto for exception-handling.

OK, done, please have a try.

i can assign existing labels. but i can't create new labels.

I just assigned you with Triage role, creating the new label requires Write role, we need to discuss it internally. Shall I create the "native stack overflow detection" and "exception handling" labels for you first?

yes. it's enough.

Done, the two labels were created.

from wasm-micro-runtime.

yamt avatar yamt commented on May 29, 2024

btw, i want to group these issues with a label, say, "native stack overflow detection". can you give me necessary permissions?
ditto for exception-handling.

OK, done, please have a try.

i can assign existing labels. but i can't create new labels.

I just assigned you with Triage role, creating the new label requires Write role, we need to discuss it internally. Shall I create the "native stack overflow detection" and "exception handling" labels for you first?

yes. it's enough.

Done, the two labels were created.

thank you.

from wasm-micro-runtime.

yamt avatar yamt commented on May 29, 2024

Yes, how about increasing it to 2048 for linux platform?

sure, it's the simplest solution.

BTW, the size of argv_buf in wasm_runtime_invoke_native seems too large and unnecessary since normally the parameter count of wasm function and host function won't be very large:

uint64 argv_buf[32] = { 0 }, *argv1 = argv_buf, *ints, *stacks, size,
arg_i64;

How about we also decreasing it, e.g. uint64 argv_buf[12]?

it makes sense to decrease it. what's your rationale for 12?

In current libc-wasi, it seems that API wasi_path_open has the maximum argument count: 9 arguments + 1 exec_env = 10, I suppose 12 is big enough for most cases. Or any suggestion from you?

well, the principle "whatever largest commonly-used api needs" sounds reasonable to me.

however, the actual value seems a bit more larger than that:

#if WASM_ENABLE_SIMD == 0
argc1 = 1 + MAX_REG_FLOATS + (uint32)func_type->param_count + ext_ret_count;
#else
argc1 = 1 + MAX_REG_FLOATS * 2 + (uint32)func_type->param_count * 2
+ ext_ret_count;
#endif

from wasm-micro-runtime.

yamt avatar yamt commented on May 29, 2024

Yes, how about increasing it to 2048 for linux platform?

sure, it's the simplest solution.

probably 2048 is not enough as
aot_call_indirect + invoke_native_with_hw_bound_check + wasm_runtime_invoke_native
seems to consume about 1000 bytes. (macOS amd64)
how about 3KB?

from wasm-micro-runtime.

wenyongh avatar wenyongh commented on May 29, 2024

Yes, how about increasing it to 2048 for linux platform?

sure, it's the simplest solution.

BTW, the size of argv_buf in wasm_runtime_invoke_native seems too large and unnecessary since normally the parameter count of wasm function and host function won't be very large:

uint64 argv_buf[32] = { 0 }, *argv1 = argv_buf, *ints, *stacks, size,
arg_i64;

How about we also decreasing it, e.g. uint64 argv_buf[12]?

it makes sense to decrease it. what's your rationale for 12?

In current libc-wasi, it seems that API wasi_path_open has the maximum argument count: 9 arguments + 1 exec_env = 10, I suppose 12 is big enough for most cases. Or any suggestion from you?

well, the principle "whatever largest commonly-used api needs" sounds reasonable to me.

however, the actual value seems a bit more larger than that:

#if WASM_ENABLE_SIMD == 0
argc1 = 1 + MAX_REG_FLOATS + (uint32)func_type->param_count + ext_ret_count;
#else
argc1 = 1 + MAX_REG_FLOATS * 2 + (uint32)func_type->param_count * 2
+ ext_ret_count;
#endif

Oh, that's really upsetting, suppose MAX_REG_FLOATS is 8 and SIMD is enabled, allocation will occur when the native API has 8 arguments: 1 + 8 * 2 + 8 * 2= 33 > 32. Maybe we had better keep 32 unchanged.

from wasm-micro-runtime.

wenyongh avatar wenyongh commented on May 29, 2024

Yes, how about increasing it to 2048 for linux platform?

sure, it's the simplest solution.

probably 2048 is not enough as aot_call_indirect + invoke_native_with_hw_bound_check + wasm_runtime_invoke_native seems to consume about 1000 bytes. (macOS amd64) how about 3KB?

It sounds good to me.

from wasm-micro-runtime.

wenyongh avatar wenyongh commented on May 29, 2024

BTW, we are planning to release WAMR-2.0.0 since we haven't released a new version for some time and also there are some developers asking for the new release, is it ok to create the release before your enhancement PR for native stack overflow check is finished? Maybe we can add it in the release 2.0.1.

from wasm-micro-runtime.

yamt avatar yamt commented on May 29, 2024

BTW, we are planning to release WAMR-2.0.0 since we haven't released a new version for some time and also there are some developers asking for the new release, is it ok to create the release before your enhancement PR for native stack overflow check is finished? Maybe we can add it in the release 2.0.1.

#3325 might or might not involve abi breakage.

from wasm-micro-runtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.