Skip to content

Kaspersky rejected your run doctest and warned you that it is virus #15388

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

Closed
SandmeyerX opened this issue Apr 4, 2025 · 1 comment
Closed
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@SandmeyerX
Copy link

Problem

Kaspersky rejected your run doctest and warned you that it is virus

Image

I remember everything was normal yesterday ☠️

Steps

1.run doctest

user\.cargo\bin\cargo.exe test --doc --package bilibulu_lib -- utils::de_empty_string_to_none --show-output 

my doctest code:

/// 将空 `String` ("") 反序列化为 `None`
/// # Example
/// ```
/// use serde::Deserialize;
/// use serde_json;
/// use bilibulu_lib::utils::de_empty_string_to_none;
/// 
/// #[derive(Debug, Deserialize)]
/// struct Foo {
///    #[serde(deserialize_with = "de_empty_string_to_none")]
///    bar: Option<String>,
/// }
/// 
/// let json = r#"{ "bar": "" }"#;
/// let data: Foo = serde_json::from_str(json).unwrap();
/// assert!(data.bar.is_none());
/// 
/// let json = r#"{ "bar": null }"#;
/// let data: Foo = serde_json::from_str(json).unwrap();
/// assert!(data.bar.is_none());
/// 
/// let json = r#"{ "bar": "something here" }"#;
/// let data: Foo = serde_json::from_str(json).unwrap();
/// assert_eq!(data.bar, Some(String::from("something here")));
/// ```
pub fn de_empty_string_to_none<'de, D>(deserializer: D) -> Result<Option<String>, D::Error>
where
    D: Deserializer<'de>
{
    let str: Option<String> = Option::deserialize(deserializer)?;
    match str {
        // `str` 为 空("") 时
        Some(s) if s.is_empty() => Ok(None),
        // 缺少该字段时
        None => Ok(None),
        Some(s) => Ok(Some(s))
    }
}

2.output

Couldn't run the test: Access is denied. (os error 5) - maybe your tempdir is mounted with noexec?

Kaspersky rejected the run doctest and warned that it is virus:

VHO: Trojan-Spy.Win64.KeyLogger.gen
object: C:\Users\xxx\AppData\Local\Temp\rustdoctestjIysfn\rust_out.exe

kaspersky - Trojan-Spy.Win64.KeyLogger.gen details

Possible Solution(s)

No response

Notes

No response

Version


@SandmeyerX SandmeyerX added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Apr 4, 2025
@weihanglo
Copy link
Member

Antivirus software usually has heuristics and we don't really have controls over that. Let's track it in rust-lang/rust#93187. Thank you.

Side note: maybe moving doctest binaries out from temporary directory help. This part is tracked by rust-lang/testing-devex-team#5, which will shift test runner from rustdoc to cargo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants