langgenius / dify-sandbox

A lightweight, fast, and secure code execution environment that supports multiple programming languages
https://docs.dify.ai/development/backend/sandbox
Apache License 2.0
443 stars 97 forks source link

update FAQ #28

Closed hjlarry closed 3 months ago

hjlarry commented 3 months ago

I removed the strace method to log all the system calls, it's not the correct way.

The output of this method is how many times the system calls appear in the strace_output.txt file, not the syscalls number.

Yeuoly commented 3 months ago

great comments!

dafang commented 3 months ago

@hjlarry @Yeuoly

Why was this method removed?

The numbers in the first column are not system call numbers, but rather the count of how many times they were invoked during execution. Then, the list is sorted based on the frequency of these invocations.

dafang commented 3 months ago

Very busy these days, just saw this PR.

hjlarry commented 3 months ago

@hjlarry @Yeuoly

Why was this method removed?

The numbers in the first column are not system call numbers, but rather the count of how many times they were invoked during execution. Then, the list is sorted based on the frequency of these invocations.

I tried to use this method to find which system call cause my code can't run, but the result not tell me,even though I tried to find it base on the system calls name, It still miss lots of system calls. This puzzles me a lot.

can you give an example how to make the import numpy run base on this method's result? thanks @dafang

dafang commented 3 months ago

I believe these are two separate matters: whether the method is efficient and whether the approach is correct. Using trace to track system calls is a conventional debugging method in itself. It's just that its approach is similar to point-based data collection, which might not be comprehensive, so multiple collections and attempts might be necessary. Compared to another solution, it's not as efficient. However, that doesn't mean it's wrong.