-
Notifications
You must be signed in to change notification settings - Fork 13k
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
include_dir rustdoc segfault #56900
Comments
Looks like unbounded memory growth. And it's not just a problem with rustdoc, trying to build the integration test triggers the bug as well. |
Agreed, this doesn't reproduce locally for me and is likely within some sort of C library or something like that which may not handle malloc failure well |
It reproduces for me. I don't think there's a C library involved, because it's just a proc-macro that uses proc-macro-hack. The failing test attempts to include the directory of the crate itself, and there was a recent change to how |
Ping @rust-lang/rustdoc, can someone look at this? |
This test managed to take down my server! 😆 Based on @euclio's comment, i don't think this is a problem specific to rustdoc, since i can at least see logs up to where it tries to compile the sample. cc @michaelwoerister and @mcr431 since #54517 seems to be related. |
I'll give it a look tonight. |
@QuietMisdreavus @euclio Sorry if this is ignorant -- I haven't been helping with the compiler for that long -- but how do I reproduce this? I haven't used crater before and when I try to run the rustdoc test manually it won't compile due to unwrapping an error inside the macro but I can't see exactly where things are breaking and it seems my error is different than the one you're talking about. |
@mcr431 This is the procedure i used to get the issue i did:
I'm not totally sure what's going wrong, but i'm assuming it's in the implementation of the macros inside that crate, and an interaction with the new file-inclusion mechanism. |
@QuietMisdreavus Thanks, I was trying to manually run rustdoc with the test flags and I don't think i was properly linking all dependencies. I'll look at it today and see if I can find anything |
FYI, if you're on Linux or Mac you can use |
@QuietMisdreavus So I found that it works as expected when cloned from github but not when using cargo clone. The github version includes the include_dir_impl right in the source tree where with cargo clone it is an externally fetched crate. The source of include_dir is the same in both so I'm fairly certain there is a difference in the published include_dir_impl vs the local one. Will look into it a bit more tonight. |
I made no progress on this last night. The source is exactly the same for the include_dir_impl as well. I'm not too positive why it would behave differently when the crate is downloaded from crates rather than specified in a local path. I'll try to give it another look this weekend when i have some more time |
Hi all, someone recently mentioned (Michael-F-Bryan/include_dir#34 (comment)) that To see exactly what Trying to run In the meantime, are there any ways I can tweak the macro's implementation so it won't cause At the moment, all the macro does is recursively traverse a directory tree and generate a static DIR: Dir = include_dir!("stuff");
// expands to
static DIR: Dir = Dir {
path: "stuff",
files: &[
File {
path: r"stuff/jstree.min.js",
contents: include_bytes!(r"stuff/jstree.min.js"),
},
File {
path: r"stuff/test.txt",
contents: include_bytes!(r"stuff/test.txt"),
},
],
dirs: &[],
}; |
Sorry for the delay, this completely slipped my mind. Realistically I probably won't get to it this weekend, but I'll try messing around and see if I can get to the root of it. |
I poked around for a little bit the other day, and couldn't reproduce the issue without using the full |
I'm encountering something I think may be related to this issue - no segfault, but attempting to |
Marked p-medium according to t he prioritisation discussion |
I can't replicate this on master. I tried |
I'm going to close this, since it seems like people aren't running into it anymore. Feel free to reopen if you're still having trouble. |
https://crater-reports.s3.amazonaws.com/beta-1.32-1/beta-2018-12-05/reg/include_dir-0.2.1/log.txt
The text was updated successfully, but these errors were encountered: