Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dezgeg
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
31 ms
·
391.
▲
by
dezgeg
12y ago
Here are some attempts at axiomatic validation of memory barriers and atomics on several architectures: http://lwn.net/Articles/608550/
392.
▲
Coq: The world’s best macro assembler? (2013) [pdf]
(research.microsoft.com)
187 points
by
dezgeg
12y ago
|
61 comments
393.
▲
by
dezgeg
12y ago
Valgrind doesn't do integer overflow checking. In general, it's not even possible to add such checks via binary translation, as on two's complement systems most unsigned and signed operations are compiled to the same machine
394.
▲
by
dezgeg
12y ago
A sane implementation of bigints uses pointer tagging such that arithmetic on sufficiently small numbers (e.g. two 63-bit operands on a 64-bit machine) is still just a couple of cycles, with just an extra comparison and a (most likely optim
395.
▲
by
dezgeg
12y ago
With a dedicated zero register it's possible to implement some useful instructions as assembler pseudoinstructions and not on the CPU itself, saving chip area. For example, the original MIPS instruction set has these pseudoinstructions
396.
▲
by
dezgeg
12y ago
AFAIK inotify isn't especially great for recursively watching a large directory.
397.
▲
JetBrains Upsource 1.0
(blog.jetbrains.com)
10 points
by
dezgeg
12y ago
|
0 comments
398.
▲
by
dezgeg
12y ago
It's already not a terribly good idea to use rand() for deterministic pseudorandom numbers, as the generated sequence isn't portable between systems.
399.
▲
by
dezgeg
12y ago
This title "DIY Card Reader" is very misleading. The article is about making a punch card reader, not e.g. a smart card reader.
400.
▲
by
dezgeg
12y ago
I'd still trust sqlite to be more reliable than git. For instance, I've previously had git crash and burn with some extremely obscure error message when disk space ran out.
401.
▲
by
dezgeg
12y ago
It's the View Patterns extension: https://ghc.haskell.org/trac/ghc/wiki/ViewPatterns
402.
▲
by
dezgeg
12y ago
Sadly, running Lindent on almost any existing source file in the tree will produce dozens of spurious diff hunks due to most other people manually formatting their code, so Lindent is quite useless in practice. It really does bother me how
403.
▲
by
dezgeg
12y ago
In theory, it sounds like a nice idea that by having tabs, you could choose your own preferred indent width of something different than 8 columns. But in practice, this will cause problems, such as code written by you going over the maxim
404.
▲
Jolla Tablet
(jolla.com)
243 points
by
dezgeg
12y ago
|
113 comments
405.
▲
by
dezgeg
12y ago
The RCU technique ( http://en.wikipedia.org/wiki/Read-copy-update ) used in the Linux kernel does solve the "safe free()" problem. I've heard there's an userspace implementation ( http://lwn
406.
▲
by
dezgeg
12y ago
Yes, as far as I believe, this should always work in standard C89/C99. In the char array case, it works due to the brace elision rule in aggregates: assuming struct foo { char bar[3]; }; These declarations are equivalent:
407.
▲
by
dezgeg
12y ago
There's also a way to do this without any user-defined functions that works in both C and C++: struct tm tm_struct = { 0, };
408.
▲
by
dezgeg
12y ago
Because it could break existing boot scripts/programs that read from /dev/urandom. Linus doesn't consider "[...] the ones who are [writing code that runs at boot], ought to be made aware of the danger" as a sol
409.
▲
by
dezgeg
12y ago
The one thing I really miss in Tup is the '* * ' glob, i.e. '* ' that also recurses through subdirectories. Other than that, it's great. I was able to replace my C++ project's (utilizing generated sources and h
410.
▲
by
dezgeg
12y ago
> In other words, a silly patch that fixes a non-problem in one tiny place in a huge codebase doesn't accomplish anything. I don't understand this line of thinking at all. "reallocarray()/kmalloc_array() doesn't
411.
▲
by
dezgeg
12y ago
> OOM in general cannot be used for remote code execution. heap overflow can. That was exactly my point. Using reallocarray() instead of malloc(x * sizeof(foo)) can prevent a heap overflow bug. For a concrete example (assuming 32-bit s
412.
▲
by
dezgeg
12y ago
> I suspect nobody playing with the USB code would have to look up the type of bNumEndpoints. I could very well imagine a security auditor (who is not an USB expert) reading this code. > Another way of looking at the matter is that yo
413.
▲
by
dezgeg
12y ago
Defence in depth. This single overflow check could very well be the difference between denial-of-service-via-OOM and heap overflow. Should we then abandon ASLR or PIE or other defensive measures as well, just because some code is "alre
414.
▲
by
dezgeg
12y ago
> One solution to both of these problems I have thought about, but do not work at a low enough level to know if it is already a thing, is an opcode for unlikely branches. x86 actually does have jump instructions with branch prediction hi
415.
▲
by
dezgeg
12y ago
Unfortunately, having this kind of function doesn't fix the real problem, which is those certain kinds of programmers who won't let a single machine cycle be wasted. Here's just a completely random example from the Linux kern
416.
▲
by
dezgeg
12y ago
There is no loophole, the Linux license explicitly allows usermode apps to use the (GPL-licensed) interface headers without requiring the app to be GPL. See https://github.com/torvalds/linux/blob/master/C
417.
▲
by
dezgeg
12y ago
Nope, there is nothing questionable about it. Linus himself has stated it: http://www.groklaw.net/articlebasic.php?story=20110322014831...
418.
▲
by
dezgeg
12y ago
> In principle, your terminal could also turn Ctrl-Shift-I into some special escape sequence which an application could parse. Such a sequence just doesn't exist in the terminal protocol you are using, that is all. A specification t
419.
▲
by
dezgeg
12y ago
These kinds of code issues aren't unique to bash. Just take a look at almost any FOSS project with a bit of history, say GCC, GNU binutils or Xorg, and you'll find the same issues in those projects. IMNSHO the real issue is with t
420.
▲
by
dezgeg
13y ago
I've implemented the exact same thing once, and found out later that it really doesn't work. The problem is that the caller cleans up the stack in the 32-bit ccall calling convention. For example, when main calls write_stdout(&quo
More ›