Skip to content
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

Fix asan in the builder #106

Closed
ianhbell opened this issue Mar 8, 2024 · 2 comments
Closed

Fix asan in the builder #106

ianhbell opened this issue Mar 8, 2024 · 2 comments
Milestone

Comments

@ianhbell
Copy link
Collaborator

ianhbell commented Mar 8, 2024

This should be flagged as failure because x is a local copy within the function :

#include "autodiff/forward/dual.hpp"
#include <iostream>

template<typename T1, typename T2>
auto f(const T1 x, const T2 y){
    return x*sin(y);
};
int main(){
    
    autodiff::dual2nd x = 3.8, y = 9.8;
    auto g = f(x, y);
    std::cout << g.l << std::endl;
}
@ianhbell
Copy link
Collaborator Author

ianhbell commented Mar 8, 2024

Docs here: https://clang.llvm.org/docs/AddressSanitizer.html

Cannot reproduce with autodiff at the command line, but correctly flagged in Xcode

ianhbell added a commit that referenced this issue Mar 8, 2024
@ianhbell ianhbell added this to the 0.19 milestone Mar 8, 2024
@ianhbell
Copy link
Collaborator Author

ianhbell commented Mar 8, 2024

@ianhbell ianhbell closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant