1

This question is related to a question offsite at FATAL: MemorySanitizer can not mmap the shadow memory. The person who responded said:

Do simple tests (e.g. this one) work for you?

The link takes me to a GitHub web page at http://github.com/llvm-mirror/compiler-rt/blob/master/test/msan/stack-origin.cc, which include the HTML markup. That means I can't perform the following with wget or curl:

wget http://github.com/llvm-mirror/compiler-rt/blob/master/test/msan/stack-origin.cc
gcc -g2 -fsanitize=memory stack-origin.cc -o stack-origin.exe

I'm also trying to avoid the entire clone since I only need the one source file.

How do I fetch the actual source file from GitHub using wget or curl?

2

In the header of the code on the page, you can see Raw. If you check the URL of it by, for example, clicking it, you will see https://raw.githubusercontent.com/llvm-mirror/compiler-rt/master/test/msan/stack-origin.cc and that's what you have to know to use wget.

  • Thanks. So do we always use http://raw.githubusercontent.com/ as the prefix? Is that the rule? (I ask because I presumed I needed to append something like ?source=raw to the URL). – jww Feb 27 '16 at 17:00
  • I don't know (just guess so). But you can always check by downloading the formatted page and look for a similar line: <a href="/llvm-mirror/compiler-rt/raw/master/test/msan/stack-origin.cc" class="btn btn-sm " id="raw-url">Raw</a> – Gombai Sándor Feb 27 '16 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.