HNHacker News
TopNewBestAskShowJobs

abbeyj

1,119 karma · joined January 8, 2014

submissionscomments
abbeyj··on Sprites mods – A tiny Pinball Fantasies table
Possibly you are thinking of https://dmitry.gr/?r=05.Projects&proj=07.%20Linux%20on%208bi... but this is on an 8-bit AVR microcontroller, not a 32-bit Propeller.
abbeyj··on Linear Address Spaces: Unsafe at any speed
Go used to use noncontiguous stacks but they switched away from that model for performance reasons: https://agis.io/post/contiguous-stacks-golang/ .

If you put the pid in the high bits of every pointer you run into problems when you want to support fork(). The child gets a new pid but keeps all the same pointers as its parent.

And that only protects you against one process trying to read/write another process's memory. We already have good support for this type of protection on current hardware/OSes. What is desired is something that prevents a process from reading/writing its own memory, through an out of bounds pointer. This would prevent buffer overflows, stash smashing, etc. and be a good defense against RCE.

abbeyj··on Ampere Announces 5nm Arm Server CPU
https://nvidianews.nvidia.com/news/taiwans-tech-titans-adopt...
abbeyj··on A most vexing parse, but for Python packaging
I have a minor complaint about an otherwise enjoyable article. You introduce the term "bdist" and define it but then introduce the term "wheel" without defining it or explaining how it is different from "bdist". You mostly use the term "wheel" for the rest of the page so I'm wondering if you need to introduce the term "bdist" at all.
abbeyj··on An Afterlife User's Guide to the C64
https://en.m.wikipedia.org/wiki/Killer_poke
abbeyj··on MCC (Master Chief Collection) Server Incident Summary
I am but only with uBlock Origin turned on. uBlock Origin blocks something and then the page goes into an infinite loop requesting https://wpcontent.svc.halowaypoint.com/purchase-content/game... and https://wpcontent.svc.halowaypoint.com/content-ratings/esrb/... over and over again. It is also rapidly using up memory so eventually you run low and the whole browser starts performing poorly. Whitelisting the site in uBlock Origin is a workaround.
abbeyj··on Zig self hosted compiler is now capable of building itself
If the union is untagged, how can it be determined (at runtime) that you've accessed the wrong field?
abbeyj··on Moreutils: A collection of Unix tools that nobody thought to write long ago
In one terminal, run:

  $ mkfifo myfifo
  $ while true; do sed -rune 's/^Dev server started on port (.*)/\1/p' myfifo | xargs -n1 -I{} echo "Execute other command here with argument {}"; done

In the other terminal, run your server and tee the output to the fifo you just created:

  $ start_server | tee myfifo
abbeyj··on Three areas where Google Search lags behind competitors: code, cooking, travel
Quick and dirty version for uBlock Origin:

  news.ycombinator.com##tr.athing:has(a[href*="medium.com"])
  news.ycombinator.com##tr.athing:has(a[href*="medium.com"]) + tr
  news.ycombinator.com##tr.athing:has(a[href*="medium.com"]) + tr + tr.spacer
If somebody can improve this, please share.
abbeyj··on Reversing Sound Blaster X7 Control for Fun and Linux Support
Maybe your monitoring has cached DNS records? It seems like DNS is the problem here:

    $ host sayr.us
    sayr.us is an alias for sinkhole.paloaltonetworks.com.
    sinkhole.paloaltonetworks.com has address 72.5.65.111
abbeyj··on Hand-optimizing the TCC code generator
Is it always safe to make this change without considering the surrounding code? If you start with this code:

    testl %ebx, %ebx  # Set zero flag if %ebx is zero
    movl $0, %eax     # Set %eax to zero
    jz somewhere      # Jump if %ebx was zero
then after optimization you get this:

    testl %ebx, %ebx  # Set zero flag if %ebx is zero
    xorl %eax, %eax   # Set %eax to zero *and set zero flag*
    jz somewhere      # Jump always
Maybe this is OK because TCC doesn't (currently) generate any code like this.
abbeyj··on You can do a lot with an empty file
This can lead to an interesting situation where a program will work if launched by a shell (or by another program that uses `execlp`), but will fail if it is launched with a different variant of `exec`. For example:

    $ touch empty
    $ chmod a+x empty

    $ ./empty  # Works

    $ valgrind -q ./empty  # Works

    $ timeout 10s ./empty  # Works

    $ /usr/bin/time ./empty  # Works

    $ perl -e 'exec("./empty") or die'  # Works

    $ python -c 'import subprocess; subprocess.check_call("./empty", shell=True)'  # Works

    $ python -c 'import subprocess; subprocess.check_call("./empty")'  # Fails
    ...
    OSError: [Errno 8] Exec format error

    $ ruby -e 'exec "./empty"'   # Fails
    -e:1:in `exec': Exec format error - ./empty (Errno::ENOEXEC)
            from -e:1

    $ strace ./empty  # Fails
    execve("./empty", ["./empty"], 0x7fff6639f3a0 /* 84 vars */) = -1 ENOEXEC (Exec format error)
    strace: exec: Exec format error
    +++ exited with 1 +++

It can be quite fun to track down why a program executes successfully and then later fails to execute, with no changes made to the program in between.
abbeyj··on Pipefail: A missing shell option slowed Cloudflare down
I'm confused about how this change actually fixes the problem.

The article says:

> Enabling this option changes the shell’s behavior so that, when any command in a pipeline series fails, the entire pipeline stops processing.

This is not true! The entire pipeline runs to completion just as it normally would. The only thing that is affected is the exit status of the pipeline as seen by the shell.

You can see this by running something like `(set -o pipefail; false | sleep 10)` and see that it still takes 10 seconds to complete even those the `false` command exits with an error immediately.

Even after turning on the pipefail option, running a command like `false | dosctl set template_vars -` will still set template_vars to the empty string.

abbeyj··on The Dirty Pipe Vulnerability
Would this get caught by KMSAN (https://github.com/google/kmsan)? Maybe the circular buffer logic would need to get some calls to `__msan_allocated_memory` and/or `__sanitizer_dtor_callback` added to it? If this could be made to work then it would ensure that this bug stays fixed and doesn't regress.
abbeyj··on A pipe operator for JavaScript: introduction and use cases
> First off, you're plain wrong about Python

As pointed out by minitech, this syntax was allowed in some versions of Python 3 but that was a bug which has since been fixed. I didn't run into this bug in the version of Python 3 that I used for testing so I had no idea of the bug's existence.

> I doubt the veracity of the other examples

Python 3.10: https://godbolt.org/z/Po7K7cvY8 Ruby 3.0.2: https://godbolt.org/z/Ke5oWzaW3 C++ (clang 13.0.0): https://godbolt.org/z/zd5MfM4Mo Go (amd64 gc 1.17): https://godbolt.org/z/KrEsKaTjq Lua (luac 5.3.3): https://ideone.com/irl89j Perl (perl 2018.12): https://ideone.com/YZcCAC

> Honest question, are you aware of the comma operator and how it works?

I am. The existence of the comma operator is the reason that `console.log((a, b))` parses (and means something different than `console.log(a, b)`). If we consider a hypothetical version of JavaScript which does not have the comma operator then `console.log((a, b))` wouldn't parse at all! The comma there can't be the comma operator because we've removed that. And it can't be part of the function call because then the first argument to the function call would have to be `(a` which is obviously not a valid expression. And it can't be part of an array literal or an object literal because it isn't inside of `[]` or `{}`. That leaves us with no valid ways for this to parse.

You can usually add extra parentheses around any expression without changing the meaning. But "all the arguments to a function" is *not* an expression (except in the case where there happens to be exactly one argument). This is why it doesn't make sense to change `console.log(a, b)` into `console.log((a, b))`, why it doesn't make sense to change `console.log()` into `console.log(())`, and why it doesn't make sense to change `console.log(...a)` into `console.log((...a))`.

abbeyj··on A pipe operator for JavaScript: introduction and use cases
> in just about every sane language (not to mention plain-old mathematics), extraneous parentheses don't behave like this.

Let's test that out.

Python 3 doesn't like extra parentheses:

    a = ['hello', 'world']
    print(*a)    # OK
    print((*a))  # ERROR

Ruby doesn't like extra parentheses:

    a = ['hello', 'world']
    puts(*a)    # OK
    puts((*a))  # ERROR

C++ doesn't have a splat for C-style varargs functions but it does have one for template parameter packs and it doesn't like extra parentheses:

    template <typename ...Args>
    void g(Args... x) {
        f(x...);    // OK
        f((x...));  // ERROR
    }

Go doesn't like extra parentheses:

    package main
    import "fmt"
    func main() {
        a := []interface{}{"hello", "world"}
        fmt.Println(a...)    // OK
        fmt.Println((a...))  // ERROR
    }

Lua doesn't like extra parentheses:

    a = {"hello", "world"};
    print(table.unpack(a));    -- OK
    print((table.unpack(a)));  -- Only prints "hello"

Perl does like extra parentheses (but then again it doesn't really have a special "splat" syntax and just flattens all lists everywhere):

    my @a = ("hello", "world");
    print(@a);    # OK
    print((@a));  # OK


You seem to want `...` to behave as an operator, but it really can't since it doesn't produce a value. If you think it *should* produce a value you then have to decide what the type of that value should be and there doesn't seem to be a good answer for that. I mean, should this be allowed?

    let a = ['hello', 'world'];
    let b = (...a);  // What should the type of `b` be?

    // Somehow equivalent to console.log('hello', 'world')?
    console.log(b);
I suppose you could introduce some MagicFlattening type into the language and make `b` be of that type. Then every time any function is called the interpreter would have to check and see if the argument is a MagicFlattening object and, if so, change the call from having 1 argument to having N arguments. This would make things slower and make creating a JIT more difficult. It would have unfortunate ripple effects across the entire language. You've now got these magic objects floating around that can unexpectedly change the meaning of any function call in your program. This is probably why most languages have chosen not to go this route.

Instead `...` is a different way of calling a function. You can call a function in the normal way with `(` and `)` and you call it in this alternate way with `(`, `...`, and `)`. Any given call site only uses one or the other of these ways and which one it uses is known at compile time so there's no need for runtime checks and no magic objects.

The `...` is part of the function call so wrapping it in extra parentheses doesn't really make sense. You wouldn't change `console.log(a, b)` to `console.log((a, b))` and expect it to work the same, would you?

abbeyj··on Recovering redacted information from pixelated videos
There are some (fairly old) papers that might contain some useful ideas for you:

- http://www.eyetap.org/papers/docs/mann94virtual.pdf - http://wearcam.org/orbits/index.html

I seem to recall that there used to be a video showing this approach in action. As input it took a video panning across a shelf full of books where the resolution was so low that the titles were illegible. And as output it produced a video with higher resolution and all the titles easily readable. Unfortunately I can't find that video any longer.

abbeyj··on Unidentified PC DOS 1.1 Boot Sector Junk Identified
Maybe https://en.wikipedia.org/wiki/Against_the_Fall_of_Night or https://en.wikipedia.org/wiki/The_City_and_the_Stars ? Also sounds similar to https://en.wikipedia.org/wiki/Logan%27s_Run but doesn't quite match.
abbeyj··on Unidentified PC DOS 1.1 Boot Sector Junk Identified
You might want to try https://www.reddit.com/r/tipofmytongue/
abbeyj··on Individuals Matter
"There is always a well-known solution to every human problem—neat, plausible, and wrong" - H. L. Mencken
abbeyj··on Bash functions are better than I thought
If you don't want the timing, use `"${@}"`, not `eval "${@}"`. The latter will parse all of your arguments through the shell an additional, unwanted time.

For example, take the command `./run echo "Don't"`. When using `time`, this will print `Don't`. If you use just `"${@}"`, it will also print `Don't`.

But if you use `eval "$@"`, this will crash with an error like

    eval: line 10: unexpected EOF while looking for matching `''
abbeyj··on The Problem with Macros
The phrase "no notes" is slang from show business. After you're shown a script or a performance you may have "notes" to share indicating what you think is wrong with it. If you have "no notes" then you think it is perfect as-is and needs no changes.

The author here is not saying that the message has no notes. They are saying that they have "no notes" to offer the creators of the message on ways to improve it

See, for example: https://forum.wordreference.com/threads/no-notes.3042292/ https://hinative.com/en-US/questions/15238431 https://www.youtube.com/watch?v=5NVQ8v1P4go

abbeyj··on Intel’s Thread Director: Assisting the OS to make task placement decisions
https://medium.com/@niaow/a-big-little-problem-a-tale-of-big...
abbeyj··on Plants, heavy metals, and the lingering scars of World War I
Sounds like Visual Player 2.0: https://www.youtube.com/watch?v=dtTDPmEywHE

Edit: sorry, this was supposed to be a reply to https://news.ycombinator.com/item?id=27998754

abbeyj··on Monkey Island PC-speaker music player
A classic: https://modarchive.org/index.php?request=view_by_moduleid&qu...

There's a web-based player so you can hear this MOD without having to download anything.

abbeyj··on Windows Timer Resolution: The Great Rule Change (2020)
I believe that this is included in the report generated by `powercfg /energy`.
abbeyj··on Reverse engineering the Nest home/away API
How would you use ARP here? ARP lets you find a MAC address assuming that you already know the IP address that you want to talk to. But without static IPs you wouldn't know the IP address of the phone that you're interested in. I'm not seeing how ARP will help here.
abbeyj··on The Case of the Extra 40ms
I was sure that I had read this story before but checking the date showed that this blog post was just published a few days ago. A little searching turned up the place that I had originally seen it: a comment on this very site. https://news.ycombinator.com/item?id=24799332
abbeyj··on ARM and Lock-Free Programming
It seems to be a CPU flag. This is managed by the kernel so that it is on for Rosetta 2 processes and off for everything else. See https://github.com/saagarjha/TSOEnabler
abbeyj··on Z80 CPU User Manual (2016)
Tandy used the "TRS-80" name for many of their computer lines, even when they used completely different architectures.

The original TRS-80 ("Model I"), the TRS-80 Model III, and the TRS-80 Model 4 all used a Z80. https://en.wikipedia.org/wiki/TRS-80

The TRS-80 Color Computer ("CoCo") used the 6909. https://en.wikipedia.org/wiki/TRS-80_Color_Computer

The portable TRS-80 Model 100 used an 8085. https://en.wikipedia.org/wiki/TRS-80_Model_100

← PreviousPage 3 of 5Next →