• 4 Posts
  • 26 Comments
Joined 1 year ago
cake
Cake day: June 14th, 2023

help-circle











  • As mentioned in the article, this concerns release mode, which already does not have symbols by default for user code. It does have symbols for the standard library code, however, due to how the binaries for the standard library are shipped (i.e. with symbols only). This change simply also removes standard library symbols.

    If you need symbols, you can use default debugging build, or if you need both compiler optimizations and debugging symbols you can create a custom profile that inherets from release with debug = true. The second you already need to do to get full debugging symbols right now, so this isn’t really much of a change from a workflow standpoint.




  • Not actually a use-after-free bug, just memory corruption due to a non-aligned pointer. (Calculated from the unsound math in safe code you mentioned.)

    Non-aligned memory access in CPUs is a “don’t care” condition that can do whatever is most convenient for the processor implementation. Typically, the cause for the memory corruption is due to caching. Cache lines are a certain size, in this case 128 bytes. Let’s say you want to fetch 16 bytes of data, and the processor specifies for simplicity that all data you fetch or this width should have an address divisible by 16. This is so that the data in question is entirely within a single cache line, and the memory controller doesn’t have to handle fetching two cache lines for a single load, which would be slower for no good reason.

    If we violate this contract, let’s say we load a pointer with an offset that is 15 mod 16. Then the processor fetchs the cache line where the data starts, slots it into the cache memory, then reads from the cache memory and you get back either:

    1. 7/8 times: the entire correct data, because the pointer is not also at the end of the cache line
    2. 1/8 times: the first byte of the correct data and 15 bytes of other data from the cache, which data exactly is governed by the caching behavior of the L1 cache and can be difficult to predict.

    This affects both loads and stores, so you can overwrite other cache lines. And doing so may mark them dirty depending on implementation. When they get evicted from the cache if they’re marked as dirty (either from this or some other write) they’ll be committed, either to the L2 cache, or if the cache is write through, also to memory. This is the most likely source of the memory corruption, to my understanding.






  • If the streching is so small as to be unnoticable (and I agree it’s pretty subtle) then I also don’t really understand the benefit.

    Typically, the idea behind this sort of design is that it should be unnoticeable. The motivation is that, with other monospace fonts, the differences in character width, along with the inconsistent spacing and line thicknesses are both noticable and distracting. Some of this badness is avoidable, and this is what this font attempts.

    and yeah that height difference is really weird. That almost seems like a bug.

    I’ve been informed, (and had to double check because I didn’t believe it,) that the two "i"s are actually the exact same height. The first looking larger than the second is an optical illusion. Font design is hard.