-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't directly run cpp files in lux-ai-2021 (ETXTBSY error) #71
Comments
Replays show nothing special. When run in the same seed as their JS counterparts, they result in the exact same behavior. |
I've attached the I should mention that I'm on Linux Mint btw, so this error might not appear on Windows |
After rigorous testing, I am more confused than I was before. I spammed that command on a specific seed for a single bot and it still failed every so often, meaning the chance of this issue occurring is completely random and not dependent on seed or the bot run. Wth |
The |
Just making sure this isn't stale, is this still and issue @Desperationis ? |
It's still a issue, not sure what's causing it. What I know for certain though is that running the lux-ai command multiple times on the same seed will eventually run the match |
Oh ok so this error means you are trying to modify an executable while it is already running which is a weird error. |
Do you by any chance have the executable file opened for some reason. Additionally can you compile your C++ as you would and then execute from the command line yourself and not via lux ai (it should just hang) |
@Desperationis Ok so this issue is not even consistently happening either, hard to reproduce, which leads me to think there's something up with your setup. Can you tell me what node and npm version you are on and what linux mint version you are on? I think worst case, use docker to run matches (we can provide a simple script for this) but hopefully that won't be necessary. |
I'm running node v14.17.2 and npm v7.19.1 on Linux Mint Cinnamon Uma, though this happened on Ulyssa as well. |
still not sure sorry. I found this thread where someone else was using a nodejs application for something else and got the same error: Still not exactly sure what's going on. Maybe permissions? In which case can you do |
This is before running lux with main.cpp:
After a successful run right after:
After a bad run with the EXTBSY error:
As a test, I ran |
Hi @Desperationis can you try this script as a test. Put this script into the same directory you call const { spawn } = require('child_process');
const p = spawn('./main.out', {cwd: 'path/to/dir/of/main.out');
p.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
p.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
p.on('close', (code) => {
console.log(`child process exited with code ${code}`);
}); let me know if the EXTBSY error pops up. |
I tried the JS script with node and the program just hung; It didn't produce any output on stdout or stderr, and it was like if you just ran main.out raw. Btw you missed a |
But yeah, no EXTBSY error. Idk if this piece of information is useful or anything but running main.out raw from the command line never produces the error, though it doesn't produce any output either. |
ok this is helpful. It's supposed to just hang as the agent is waiting for input (match information and state) and didn't quit with a EXTBSY error. Small chance the bug may be caused by the
that just called the same command. |
A safe solution is to just use the kaggle-environments match running tool, although less recommended but still usable and probably doesn't break. Information on using that will be released later. |
Alright, got it |
@Desperationis Can you test our latest dockerized version of the lux-ai-2021 tool? there's instructions here: https://github.com/Lux-AI-Challenge/Lux-Design-2021#cli-docker It matches the lux-ai-2021 tool 1-1 (also please use the compile.sh tool in the new C++ starter kit and pass in main.out as the bot files) So copy over the
|
@StoneT2000 I tried your docker image and I wasn't able to have the container read neither the executable or source file. Keep in mind I have very little docker experience. The script worked fine, though it only worked with
|
Yes you need bash, I'll update the readme later. So you are saying you still can't run a game when using bash cli.sh? |
Yeah, but hey, at least it's not the same error. All I know is that the docker pseudo-vm cannot find the executable or cpp file in my local machine. Probably due to the bind mount not working correctly, or just me not using the script correctly. Here, main.out is a legitimate file created by |
Chiming in here that I am able to reproduce this issue. Here are some results that I found:
This is a stab in the dark, but could there be an issue with two compilation processes trying to write to the same file? Maybe agent 0 is trying to execute main.out, but agent 1 is trying to write to main.out. I'm not exactly sure how the game engine runs under the hood. |
@djkeyes That is very, very peculiar. Personally, I never encountered the ETXTBSY error again once I used the docker container, only the ENOENT error mentioned above but me and @StoneT2000 were able to resolve that. Maybe check I think you're right though on the write-conflict. The command sees both files as individual files and tries to compile a This also explain the py-cpp and out-out combinations. py-cpp only needs to transpile a single cpp file, while the out-out combination can read it directly. If this is indeed is what is happening, a possible solution for this is to simply name each transpiled executable either 1 or 2 depending on where it is in the parameters. This way, no confict occurs. |
OH you two may be right! I never knew this could be an issue. |
I believe you are exactly right! I think we will change the documentation to instead tell users to pass in main.out as the file instead of main.cpp. Our CLI tool's backing engine has the problem here: https://github.com/StoneT2000/Dimensions/blob/master/src/MatchEngine/index.ts#L107 For each agent we initialize, if the file given is .cpp, we run a default C++ compilation command (in hindsight, not very smart, should let the user decide on how to compile it better, maybe add a option to submit a compile.sh file (barring security problems with that)). However, in the line above, each agent is asynchronously compiled lmao, so two processes are probably trying to write at the same time or something. |
I'll leave this issue open in case others encounter this and i've added (ETXTBSY error) to the title so its more discoverable, thanks! |
So I've heard, you can run cpp files directly into lux-ai-2021. However, when I try to run it with my own bot, I get this error. https://pastebin.com/CQDev0Kw error in its entirety.
I get this error when trying to run the v1.1.x branch of the cpp kit as well; Not sure what is causing it. It works fine when transpiled into JS. I've tried running the
lux-ai-2021
command assudo
and notsudo
, though it doesn't make a difference. Here's the exactmain.cpp
code I tried to run in simple/:The text was updated successfully, but these errors were encountered: