Advertisement Β· 728 Γ— 90

Posts by Will Woods

Trying to understand this, if one of my students responds to my "How do we handle the reflections on trusting trust scenario" with "God will fix my compiler" and I give them bad marks, am I the bad guy

4 months ago 67 9 5 0

We really don't know what software we're running any more. Nor what hardware, to be honest.

10 months ago 32 5 0 0
Post image
11 months ago 2031 584 35 16

That’s the beauty of open source,

there’s always someone out there, ready and willing to contribute to your project,

who is wrong.

11 months ago 117 22 1 1

so which conclave are they running, SGX or TrustZone?

11 months ago 56 11 3 0

Writing minimal reproducers for bugs is Bizarro Coding

ME WRITE CODE! OH NO CODE AM NOT BREAK? ME FIX CODE SO IT WORK WRONG!

1 year ago 0 0 0 0

Fixed it! Part of me thinks I should try to make a minimal reproducer, just because.. wow, that was a weird one.

OTOH I don't know if there's a lesson here other than "my code was stupid and ugly, and x86_64 & arm64 have slightly different memory ordering". I already know these things!

1 year ago 2 0 1 0

ya boy's first attempt at a Real Multi-threaded Rust Program turns out to have a deadlock that *only* manifests on x86_64! Ha ha ha hoo boy

1 year ago 1 0 1 0

i bet it feels really good to overflow if you're a buffer. they just can't get enough of it

1 year ago 0 0 0 0
Advertisement

no harm done! was a fun adventure!

buffers just love overflowing so dang much

1 year ago 0 0 1 0

ah shit I forgot there's no money in fixing problems!!

1 year ago 1 0 0 0

YEEHAW MISSION ACCOMPLISHED, I'M TECHNICALLY ALMOST A RUST CONTRIBUTOR

TIME TO BECOME CRAB BABYYYYY πŸ¦€πŸ¦€πŸ¦€

1 year ago 2 0 1 0
Preview
Fix crash in BufReader::peek() by wgwoods Β· Pull Request #137832 Β· rust-lang/rust bufreader_peek tracking issue: #128405 This fixes a logic error in Buffer::read_more() that would make BufReader::peek() expose uninitialized data and/or segfault if read_more() was called with a p...

Aaaand fixing the suspicious code in Buffer::read_more() fixes the crash. Success!!

Here's the PR to get the fix upstream: github.com/rust-lang/ru...

1 year ago 3 0 2 0

Changed it to peek(5) after the read(4) - which should trigger a read_more() while there's still data in the buffer - and blammo:

---- library/std/src/io/buffered/bufreader.rs - io::buffered::bufreader::BufReader<R>::peek (line 117) stdout ----
Test executable failed (signal: 6 (SIGABRT)).

1 year ago 2 0 1 0

6. read_to_string(s) - reads everything left ("hello") into s. Reader is now at EOF.
7. peek(1) - calls read_more(), but reader is at EOF, so it returns 0 and returns an empty buffer.

So the test does call read_more().. but it never actually reads anything! So let's fix that!

1 year ago 1 0 1 0

What the doctest does:
1. Make a Reader (`bytes`) containing 9 bytes: "oh, hello"
2. Wrap it in a BufReader (`buf`) with a 6-byte capacity
3. peek(2) - this causes a buffer fill. buf contains "oh, he". 4. read 4 bytes: "oh, ". buf now contains "he".
5. peek(2) - just returns "he". (cont'd..)

1 year ago 1 0 1 0
A screenshot of the source and doc comment for BufReader's peek function, for people who can't be bothered to follow the link to the code

A screenshot of the source and doc comment for BufReader's peek function, for people who can't be bothered to follow the link to the code

Anyway! `/x.py test library/std` takes a while but all the tests pass. Great work Rust folks, high-fives all around, &c.

Now let's see if I can trigger the problem. Let's look at BufReader::peek() and its doctest: github.com/rust-lang/ru...

1 year ago 2 0 1 0

Have I mentioned that my internet connection is a point-to-point microwave wireless link that we share with our neighbor 'cuz our house doesn't have line-of-sight to the tower?

SORRY ABOUT YOUR NETFLIX STREAMING QUALITY BUT I GOTTA REINSTALL XCODE BECAUSE NOBODY KNOWS HOW TO FIX CONFIG FILES

1 year ago 2 0 1 0

apparently the only suggestion for this is.. delete & reinstall the xcode commandline utils?

sudo rm -rf $(xcode-select -p) && xcode-select --install

[redownloads 2GB of data I already had]

...aaaaand now it works! What a cool and efficient way to fix my tooling configuration!!

1 year ago 2 0 1 0
Advertisement

Okay fine whatever, setup complete, let's see if we can build the libraries! And.. uh.. hm.

fatal error: 'iostream' file not found

hoorayyyyyyy missing search paths, my favorite

1 year ago 1 0 1 0

So first I guess I'll clone the rust-lang/rust repo. Yeehaw, 670MG of data, let's go!

Next they suggest using their `x.py` tool to bootstrap the build environment.

Is this gonna download a buncha binary tarballs from rust-lang.org without checking sigs or certs? HELL YEAH, I LOVE SOFTWARE

1 year ago 5 0 1 0

First, the bug: I think there's a logic error in std::io::buffered::Buffer::read_more() that will make std::io::BufReader::peek() segfault if it has to refill the buffer.

I'm not using peek() - or nightly, for that matter - but I *did* steal Buffer::read_more() for my own thingy.

1 year ago 3 0 1 0

Think I just found a small bug in (unstable) Rust stdlib, yay, fun. Let's see if I can a) confirm it and b) fix it!

1 year ago 5 0 1 0

Periodic reminder: (()) is not a palindrome, but ())( is

1 year ago 1 0 0 0