-
Notifications
You must be signed in to change notification settings - Fork 171
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
Fail to build if tasks may overflow #1890
Conversation
1387f12
to
b6ad2f7
Compare
3bb0c0d
to
4f306fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only made one pass over this, but it looks good and is a valuable addition to the build process.
let detail = cs.insn_detail(instr).map_err(|e| { | ||
anyhow!("could not get instruction details: {e}") | ||
})?; | ||
if detail.groups().iter().any(|g| { | ||
g == &InsnGroupId(InsnGroupType::CS_GRP_CALL as u8) | ||
}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am obligated by myself to ask: is this why capstone in particular? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not specifically – I was using yaxpeax
earlier and was fine looking for BL
opcodes, but we're using enough weird instructions that I was hitting DecodeError::Incomplete
in a bunch of tasks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh! i'll have to take a look later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be easy enough to test by checking out one of the earlier commits, e.g. d7fc2eb uses yaxpeax
4f306fc
to
9bb0552
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be good to go!
@@ -1656,6 +1933,7 @@ fn build( | |||
"-C link-arg=-z -C link-arg=common-page-size=0x20 \ | |||
-C link-arg=-z -C link-arg=max-page-size=0x20 \ | |||
-C llvm-args=--enable-machine-outliner=never \ | |||
-Z emit-stack-sizes \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know if there is any work tracking this not being nightly only? We still have a goal (dream?) of being able to build hubris with a stable toolchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path to stabilization appears rocky, unfortunately:
rust-lang/rust#54192
@@ -1064,6 +1075,272 @@ fn build_task(cfg: &PackageConfig, name: &str) -> Result<()> { | |||
.context(format!("failed to build {}", name)) | |||
} | |||
|
|||
fn task_can_overflow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any concerns about false positives / false negatives? I guess for a false positive we'd increase the stack size unnecessarily and for a false negative, well, we're back to our old methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more comments in 9471544 about the possibility of false positives (possible but unlikely) and negatives (possible if using dynamic dispatch).
9bb0552
to
f960090
Compare
(details to come, but opening as a draft to see if any of the CI-checked builds fail)