HN user

jpcfl

287 karma
Posts0
Comments137
View on HN
No posts found.

Anyone who calls this election fair is not impartial. The scale of the fraud is enormous and undeniable.

Tell me, how many Venezuelans abroad were able to vote? How many were kept out of the country because the borders were closed? How many were threatened or intimidated into voting for Maduro? How many votes were cast using false ID? How many were confused by the ballot which had 13 options to vote for Maduro? How many polling stations were closed at the last minute?

There is if your goal is to attract a wider audience. Call me old fashioned, but if you can't even be bothered to capitalize the first letter of each sentence in your publication, I'm probably not going to read it.

It is incredibly frustrating to realize that a lot of companies are within their right to deny you service as soon as you even _appear_ to pose a risk to them.

Geico recently denied my renewal of insurance because they said their underwriters received notification that I use my vehicle for business. (I don't.) I have spent hours trying to explain to them that this is a mistake, but they have zero interest in providing me with insurance. I've heard this is common for people in CA.

I'm not sure what legal recourse the people in this story have. Hopefully they have a legal right to at least download an archive of their data so they can recover old emails, attachments, photos, etc.

There is no 1:1 relationship between mining cost and reward on a single block

Ah, I see what you mean.

I think I've been mixing up my costs. When I wrote the original comment, I was thinking about the total energy cost for mining this block, i.e., the energy cost of all the nodes that worked on it. But the truth is, I have no idea about the economics of BTC mining. I was just being facetious :)

That wasn't my point. My point was that they could stay in business.

My original point was that it was in the ballpark of $2M. Could be more, could be less, all depending on a number of variables--I believe one of those variable just doubled.

I'm not sure what the cost is now, but back in 2012-ish when I briefly looked into mining, it cost about $1 in energy to mine $1 worth of BTC. I used your logic and decided it didn't make sense to invest in mining, so I didn't. I wish I had, or at least purchased some BTC, but I was a broke college student just looking to capitalize on the hardware I already owned, and I didn't really know a thing about investing (other than investing in a 6 pack of beer to meet girls at parties--my ROI was not great, BTW, so I don't recommend this strategy).

If I spend $2M to mine $2M of gold, and the value of that gold increases by 2x over the next 10 years, then I think I could stay in business. That would actually be a pretty solid business.

The value of BTC has increased nearly ~200x in the last 10 years. I don't anticipate it will do this again, but I'm sure some of these miners think it will continue to grow at some rate (plus, they have already capitalized on the last 10yrs of growth).

What does preemption change here? Before the stack checker has finished, nothing else should hold a reference to any of the yet-unchecked stack.

If your thread overflows the stack, it could start writing into memory for which it does not hold a reference. If the thread is preempted before the stack checker can run (see below*) and detect the overflow, and another thread runs which accesses the now-corrupted memory, then you're hosed.

just an "if (stack_curr - stack_end < desired_size) abort();"

That's not how the compiler-emitted stack checking works AFAIK (*I believe it uses canaries on the stack which are checked at certain points in code). But, I could see this solving the problem. Basically, for every instruction that manipulates the stack pointer (function calls, alloca's, and on some arch's interrupts use the current stack), the resulting address would need to be checked. That would be costly and require OS awareness, but I think it would be safe. Is this an option that the compiler provides? It would save me a lot of time debugging.*

Yes it does, unless you're violating the memory model.

Overflowing the stack violates the memory model.

Such systems are not secure if they don't have IOMMUs.

Secure in what sense? I was under the impression that Rust could run on embedded devices like the ARM Cortex-M3, but maybe I'm wrong.

Software stack checking does not guarantee protection from stack overflows wreaking havoc. E.g., your thread could blow its stack, then get preempted before the stack checker can run.

Mandating guard pages/MPU protection would rule out targeting embedded platforms which lack sufficient hardware support.

Stack overflows are checked in C on macOS not because of guard pages but because the compiler emits stack checks (with cookies).

Compiler-emitted stack checking is optional and not the default, and definitely not what is causing the crash here.

That's implementation-defined, not undefined.

How could an implementation reasonably define the behavior for a stack overflow that silently corrupts another variable?

The fact that this program results in reading/writing an unmapped memory address means it’s doing an out-of-bounds access. It segfaults on macOS because the runtime/OS has allocated the stack such that the overflow results in a bad memory access, but that is a behavior of the runtime/OS/hardware, not the language.

I guarantee I could exploit this on a system that does not have virtual memory, or a runtime that does not have unmapped addresses at the end of the stack, to, say, manipulate the contents of another thread’s stack. Therefore, this behavior is undefined.

Safe rust has 0 UB

Safe Rust aims for 0 UB, but I don't think you can make the claim that it absolutely has no UB.

This program SEGFAULTs on my system (macOS), because it's reading an invalid memory address due to a stack overflow:

  const N: usize = 1024*1024*1024;

  fn main() {
      let var: [u8; N] = [0; N];
      println!("var: {:?}", var);
  }

I also tend to remember where a tidbit of information was physically. For some reason, details like "~50 pages back around the end of the paragraph in the top-right corner of the right page" will stick in my brain. Then I can quickly scan and parse out keywords to find what I'm looking for. This doesn't work reliably with e-books for me.