Created
October 16, 2025 19:45
-
-
Save iximeow/aeee3902aa443ed82c6f2f9faaa4ae9c to your computer and use it in GitHub Desktop.
rustc sadness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BEGIN { | |
| /* | |
| substring = "/omicron/target/debug/incremental"; | |
| */ | |
| substring = "nexus_db_queries-"; | |
| } | |
| /* | |
| * sometimes when rustc invokes gcc (linking?), it dies out of nowhere with `Not | |
| * enuogh space (os error 12)`. it's not clear what syscall returned that or | |
| * where in GCC this happens, so lets find out some more details... | |
| * | |
| * Notably, errno 12 is ENOMEM, not ENOSPC! | |
| */ | |
| syscall::*:return / errno == 12 / { | |
| printf("sorry about your link, i guess"); | |
| ustack(); | |
| } | |
| syscall::rename:entry { | |
| self->rename_from_addr = arg0; | |
| self->rename_to_addr = arg1; | |
| } | |
| syscall::rename:return { | |
| this->rename_from = copyinstr(self->rename_from_addr); | |
| this->rename_to = copyinstr(self->rename_to_addr); | |
| self->rename_from_addr = NULL; | |
| self->rename_to_addr = NULL; | |
| this->interested = strstr(this->rename_from, substring); | |
| if (this->interested != NULL) { | |
| printf(" pid[%05d]: %d: rename(\n", pid, timestamp / 1000000000); | |
| printf(" %s,\n", this->rename_from); | |
| printf(" %s\n", this->rename_to); | |
| printf(" )\n"); | |
| } | |
| } | |
| syscall::renameat:entry { | |
| self->renameat_from_addr = arg1; | |
| self->renameat_to_addr = arg3; | |
| } | |
| syscall::renameat:return { | |
| this->renameat_from = copyinstr(self->renameat_from_addr); | |
| this->renameat_to = copyinstr(self->renameat_to_addr); | |
| self->renameat_from_addr = NULL; | |
| self->renameat_to_addr = NULL; | |
| this->interested = strstr(this->renameat_from, substring); | |
| if (this->interested != NULL) { | |
| printf(" pid[%05d]: %d: renameat(\n", pid, timestamp / 1000000000); | |
| printf(" %s,\n", this->renameat_from); | |
| printf(" %s\n", this->renameat_to); | |
| printf(" )\n"); | |
| } | |
| } | |
| syscall::mkdir:entry { | |
| self->mkdirpath_addr = arg0; | |
| self->mkdirflags = arg1; | |
| } | |
| syscall::mkdir:return { | |
| this->mkdirpath_addr = self->mkdirpath_addr; | |
| self->mkdirpath_addr = NULL; | |
| this->mkdirflags = self->mkdirflags; | |
| self->mkdirflags = NULL; | |
| this->mkdirpath = copyinstr(this->mkdirpath_addr); | |
| this->interested = strstr(this->mkdirpath, substring); | |
| if (this->interested != NULL && strstr(this->mkdirpath, "nexus_db_queries") != NULL) { | |
| printf(" pid[%05d]: %d: mkdir(%s), flags=%x returned %d", pid, timestamp / 1000000000, this->mkdirpath, this->mkdirflags, arg0); | |
| if (arg0 == 0) { | |
| printf(" errno: %d", errno); | |
| } | |
| ustack(); | |
| } | |
| } | |
| syscall::rmdir:entry { | |
| self->rmdirpath_addr = arg0; | |
| } | |
| syscall::rmdir:return { | |
| this->rmdirpath_addr = self->rmdirpath_addr; | |
| self->rmdirpath_addr = NULL; | |
| this->rmdirpath = copyinstr(this->rmdirpath_addr); | |
| this->interested = strstr(this->rmdirpath, substring); | |
| printf("what what what WHAT WHAT WHAT"); | |
| if (this->interested != NULL || 1 == 1) { | |
| printf(" pid[%05d]: %d: rmdir(%s), returned %d", pid, timestamp / 1000000000, this->rmdirpath, arg0); | |
| if (arg0 == -1) { | |
| printf(" errno: %d", errno); | |
| } | |
| } | |
| } | |
| syscall::unlinkat:entry / arg2 == 1 /* AT_REMOVEDIR */ / { | |
| self->unlinkatpath_addr = arg1; | |
| } | |
| syscall::unlinkat:return / self->unlinkatpath_addr != NULL /{ | |
| this->unlinkatpath_addr = self->unlinkatpath_addr; | |
| self->unlinkatpath_addr = NULL; | |
| this->unlinkatpath = copyinstr(this->unlinkatpath_addr); | |
| this->interested = strstr(this->unlinkatpath, substring); | |
| if (this->interested != NULL) { | |
| printf(" pid[%05d]: %d: unlinkat(%s, rmdir), returned %d", pid, timestamp / 1000000000, this->unlinkatpath, arg0); | |
| if (arg0 == -1) { | |
| printf(" errno: %d", errno); | |
| } | |
| ustack(); | |
| } | |
| } | |
| syscall::unlink:entry { | |
| self->unlinkpath_addr = arg0; | |
| } | |
| syscall::unlink:return { | |
| this->unlinkpath_addr = self->unlinkpath_addr; | |
| self->unlinkpath_addr = NULL; | |
| this->unlinkpath = copyinstr(this->unlinkpath_addr); | |
| this->interested = strstr(this->unlinkpath, substring); | |
| if (this->interested != NULL && (strstr(this->unlinkpath, "-working") != NULL) || (strstr(this->unlinkpath, ".lock") != NULL)) { | |
| printf(" pid[%05d]: %d: unlink(%s), returned %d", pid, timestamp / 1000000000, this->unlinkpath, arg0); | |
| if (arg0 == -1) { | |
| printf(" errno: %d", errno); | |
| } | |
| } | |
| } | |
| syscall::open:entry { | |
| self->openpath_addr = arg0; | |
| self->oflags = arg1; | |
| } | |
| /* | |
| * a few people have seen an error like | |
| * ``` | |
| * error: failed to create dependency graph at | |
| * `<blah>/omicron/target/debug/incremental/<crate>/<blah>-working/dep-graph.part.bin`: | |
| * No such file or directory (os error 2) | |
| * ``` | |
| * | |
| * now, the point at which this is produced by Cargo seems to strongly suggest | |
| * the directory was just successfully created. first, lets see if we actually | |
| * saw open fail this way when Cargo thinks it did... | |
| */ | |
| syscall::open:return { | |
| this->openpath_addr = self->openpath_addr; | |
| self->openpath_addr = NULL; | |
| this->oflags = self->oflags; | |
| self->oflags = NULL; | |
| this->openpath = copyinstr(this->openpath_addr); | |
| this->interested = strstr(this->openpath, substring); | |
| if (this->interested != NULL) { | |
| if (arg0 == -1) { | |
| printf(" pid[%05d], %d: open(%x) error %d\n", pid, timestamp / 1000000000, this->oflags, errno); | |
| printf(" path: %s", this->openpath); | |
| ustack(); | |
| } else if (strstr(this->openpath, ".lock") != NULL) { | |
| printf(" pid[%05d], %d: open(%x) = %d\n", pid, timestamp / 1000000000, this->oflags, arg0); | |
| printf(" path: %s", this->openpath); | |
| ustack(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment