title: x86_64 Linux 3.0: Invalid Memory Addresses
body: <p>Processes on Linux 3.0 on x86_64 architecture have a 64-bit virtual address space.</p>
  
  <p>It is clear that <code>0</code> is guaranteed to be an invalid memory address [see definition below] in this address space, as this is used to indicate a <code>NULL</code> pointer.</p>
  
  <p>What other 64-bit numbers (if any) are guaranteed never to be valid memory addresses, and why?</p>
  
  <p>For example, can <code>1</code> ever be a valid address? What about <code>2^64-1</code>?</p>
  
  <p><strong>Definition</strong>: What do you mean "<em>guaranteed to be an invalid memory address</em>" ?</p>
  
  <pre><code>void deref_and_assign(uint64_t i)
  {
      char* p = (char*) i;
      *p = 42;
  }
  </code></pre>
  
  <p>For the purposes of this question a guaranteed invalid memory reference means that the function <code>deref_and_assign</code> will always raise a <code>SIGSEGV</code>.</p>