<div dir="ltr">I tried building the source code with gcc 4.8.3 and it complains:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">gcc: error: unrecognized command line option ‘-fsanitize=address,undefined’<br></blockquote><div><br></div><div>It seems like this option is added to gcc 4.9:<br><a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60275">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60275</a><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 23, 2014 at 4:59 PM, Tuncer Ayaz <span dir="ltr"><<a href="mailto:tuncer.ayaz@gmail.com" target="_blank">tuncer.ayaz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Now that the --enable-sanitizers patch has been merged, it would be<br>
great if more users could test their code with an OTP install built<br>
with one or more sanitizers enabled in a dev/test environment. To be<br>
clear, it's _not_ a good idea to use in a production node.<br>
<br>
So far using only UBSan (undefined behavior sanitizer), we already<br>
found a couple bugs in the VM, and there's still time to find and fix<br>
more issues before OTP-18.0.<br>
<br>
The way sanitizers work is that the generated code is instrumented to<br>
find bugs at runtime. Basically, such an Erlang/OTP install will print<br>
what condition it encountered and possibly terminate.<br>
<br>
If you're interested and are using gcc >= 4.8 or clang >= 3.3, just<br>
make sure to enable it during ./configure as follows:<br>
<br>
# enable only undefined behavior sanitizer<br>
$ ./configure <your_usual_flags> --enable-sanitizers=undefined<br>
<br>
# enable both address sanitizer and undefined behavior sanitizer<br>
$ ./configure <your_usual_flags> --enable-sanitizers<br>
<br>
# enable just address sanitizer<br>
$ ./configure <your_usual_flags> --enable-sanitizers=address<br>
<br>
There are heavier and more specific sanitizers you can enable, and if<br>
you'd like to learn more, see the following links:<br>
<a href="http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation" target="_blank">http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation</a><br>
<a href="https://code.google.com/p/address-sanitizer/" target="_blank">https://code.google.com/p/address-sanitizer/</a><br>
<a href="http://clang.llvm.org/docs/AddressSanitizer.html" target="_blank">http://clang.llvm.org/docs/AddressSanitizer.html</a><br>
<a href="https://code.google.com/p/thread-sanitizer/" target="_blank">https://code.google.com/p/thread-sanitizer/</a><br>
<a href="http://clang.llvm.org/docs/ThreadSanitizer.html" target="_blank">http://clang.llvm.org/docs/ThreadSanitizer.html</a><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>