Hacker Newsnew | past | comments | ask | show | jobs | submit | deafbybeheading's commentslogin

Can you explain what the program itself is doing to do that? That is, can you explain the Coq program itself (and how it triggers the bug)?


The program defines a type `t` with 257 constructors (`C_0` through to `C_256`). As an analogy, the type `boolean` has two constructors (`true` and `false`).

Each of these constructors takes a natural number as an argument.

It then defines a function `is_256` which checks whether it's argument has the form `C_256 n` for some `n`, returning a boolean.

It then defines the value `falso` of type `False` (which shouldn't be possible). It does this by defining two values: one has type `is_256 (C_256 0) = true`, the other has type `is_256 (C_256 0) = false`. This is clearly a contradiction, which is used to construct the value `falso`.

The reason one value gives `true` and the other `false` is that the former is getting calculated by the regular Coq implementation, whilst the latter is getting calculated by the buggy `vm_compute` alternative. vm_compute should give identical results, but faster; but since there's a bug, we can derive a contradiction by mixing correctly-calculated values with incorrectly-calculated values.


Oh my! That `||` is gorgeous. I hadn't seen that before.


It's like the opposite of && (continue until one alternative is false), for if you want to continue with alternatives in sequence until one alternative becomes true: a || b || c || ...

This usage is commonly found in other places than the shell, like JavaScript, Perl, and PHP.


Thanks, I know `||` in general--I meant I hadn't seen the specific construction GP had used. The error handling to delete the output file in case the command failed is really elegant.


It's actually a little dangerous; what happens when you hit "^C" and the process dies before getting a chance to clean up? It's safer to do:

  some_cmd >foo.tmp && mv foo.tmp foo
The mv will do an atomic rename(), so that you either get the fully formed contents, or nothing at all.


Only if you interrupt the actual `rm`, no? If you interrupt the main command, you won't get a 0 exit code so the `||` branch still executes.

Your mechanism is clearly safer, but the user is required to clean up `foo.tmp` themselves in case of failure, so it's not really comparable.


>Fun fact: ASCII actually reserved control characters for this stuff. 1F is the "unit separator" and 1E is the "record separator". There is even a "group separator" (1D) and a "file separator" (1C).

Which means you can't safely use it for arbitrary data (since your records themselves could contain these separators). Most of the time that doesn't matter; sometimes it does.


You can't use these control characters in CSV either. The grammar from RFC 4180 excludes the 0x00 to 0x1F range.


A colleague uses the Dell XPS 13 and it's pretty good; I'm eyeing that for my next machine.


I have the previous version and am really pleased with it. The new line is kind of missing a developer edition with 16GB RAM in my opinion.


Watch out, batter life is pretty crap! (About 2 hrs on my < 2yr old one)


The ones just released have a 15 hour battery (which even if it halves, is pretty good)



Why not have Apple require apps to run usefully with just basic permissions? Anything beyond access to own files is optional. This could certainly be gamed, but scrupulous app authors could gain a ton of trust from playing ball.


This is essentially already the case as Mac App Store apps must be sandboxed. This works fine for a lot of apps, but has presented issues for many prominent developers. (e.g. Panic had a fairly difficult time adapting Coda to the sandbox, if I recall correctly.)


Some valid points, but GitHub's UI evolution has been phenomenal over the last two years.


Oh yeah having six or more horizontal navigation bars was pure pain. Considering how difficult is to effect changes with an established user base, plus the complexity of the domain itself, their new design is anything but cosmetic.


Not really. Placing the clone URL on the side bar and half clipped is quite bad. It's a site for developers...


Stupid (and somewhat tangential) question: how do bypass kernels work with virtualization, if at all?


...and a mechanism provided by the party you are attempting to secure passwords from. I use LastPass, but just sayin'.


In about a year of using Campfire, I never saw a single bug fix or new feature. We've since moved to HipChat, and while it's not perfect, it's so refreshing to pay for a service that gets regular updates (not to mention has decent mobile clients).


Rollback is essentially like a fork to the past. It creates a new database, but only replays transactions up to a specific instant. It's based on the Postgres Point-in-Time Recovery feature: http://www.postgresql.org/docs/current/static/continuous-arc...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: