engineer-man / piston

A high performance general purpose code execution engine.
https://emkc.org/run
MIT License
1.94k stars 249 forks source link

C++ is unstable in piston api. #676

Open SharkFishDeveloper opened 4 months ago

SharkFishDeveloper commented 4 months ago

Around 70% of the time, it shows SIGKILL error . Can someone fix it

Brikaa commented 4 months ago

Can you show the code that is causing this?

SharkFishDeveloper commented 4 months ago

{ language: 'cpp', version: '10.2.0', files: [ { name: 'index.g++', content: '\r\n' + ' #include \r\n' + ' using namespace std;\r\n' + '\r\n' + ' int add (int num1, int num2) {\r\n' + ' // Your code\r\n' + ' return num1+num2;\r\n' + '}\r\n' + '\r\n' + ' int main() {\r\n' + ' \r\n' + ' \r\n' + ' int a1 = add(1,3);\r\n' + ' cout<< a1<<endl;\r\n' + ' \r\n' + ' \r\n' + ' int a2 = add(4,5);\r\n' + ' cout<< a2<<endl;\r\n' + ' return 0;\r\n' + ' }\r\n' + ' \r\n' + ' ' } ], stdin: '', args: [], compile_timeout: 10000, run_timeout: 3000, compile_memory_limit: -1, run_memory_limit: -1 } { compile: { stdout: '', stderr: '', code: null, signal: 'SIGKILL', output: '' }, run: { stdout: '', stderr: '', code: null, signal: 'SIGKILL', output: '' }, language: 'c++', version: '10.2.0' }

I ran very simple Codes like this one , it sometimes runs sometimes doesn't