John Starks

165 posts

John Starks

John Starks

@gigastarks

Virtualization architect at Microsoft. WSL, Hyper-V, Windows containers, Azure.

Seattle, WA Katılım Şubat 2015
92 Takip Edilen1.6K Takipçiler
John Starks
John Starks@gigastarks·
@filpizlo What were they checking for with cpuid that didn’t require further inline asm?
English
1
0
0
138
Filip Jerzy Pizło
Filip Jerzy Pizło@filpizlo·
libwebp 1.4.0 works in Fil-C. Just had to change some inline assembly for cpuid to call `__get_cpuid` instead.
English
2
1
37
3.2K
John Starks
John Starks@gigastarks·
@filpizlo @redneckleeusmc But good for Fil-C that the first one is UB, right? Improves the odds that things will work without patches. The rest are obnoxious. I especially loathe the TBAA stuff, Rust got that one right.
English
1
0
0
84
Filip Jerzy Pizło
Filip Jerzy Pizło@filpizlo·
That’s a terrible example of UB since it’s not even really a language issue. The kind of UB people rely on is: - casting pointers to integers and then doing fancy math and then casting back to pointer - casting between pointer types while doing accesses to the same address (ie violating strict aliasing). Also, violating the active union member rule - intentionally overflowing signed integers - performing misaligned accesses And so on
English
1
0
2
76
Filip Jerzy Pizło
Filip Jerzy Pizło@filpizlo·
It's amusing that folks think that there is only one load-bearing C99 program that depends on things that the C spec calls UB. (It's harder to find a C program that *doesn't* depend on what the spec calls UB. If we're talking about load-bearing then it might be the null set.)
Corey Quinn@QuinnyPig

This killed me.

English
1
4
52
5.5K
John Starks
John Starks@gigastarks·
@redneckleeusmc @filpizlo Sure. But it’s usually shortsighted to depend on behaviors that differ between mainstream vendors. realloc(p,0) is a bad idea if you ever want your code to run on both Linux and BSD, for example.
English
1
0
0
69
Lee 🇺🇸
Lee 🇺🇸@redneckleeusmc·
@gigastarks @filpizlo Because different dialects do different things and that's okay. Different compiler options do different things and that's okay. Not everything in life needs to be micromanaged by a standards committee.
English
2
0
4
81
John Starks
John Starks@gigastarks·
@redneckleeusmc @filpizlo If these behaviors are fine to depend on, then why not fix the C standard to guarantee them? Why won’t the committee agree to that?
English
3
0
0
92
Lee 🇺🇸
Lee 🇺🇸@redneckleeusmc·
@filpizlo It will never not annoy me that many people—especially Rust zealots—assume UB means memory corruption and unpredictable behavior. realloc(p, 0) is fine, but check docs to make sure you know what it does. fwrapv is fine depending on use case. UB is not inherently dangerous.
English
3
0
5
231
John Starks
John Starks@gigastarks·
@filpizlo How do signal handlers for hardware exceptions (SIGBUS, SIGILL, etc.) work? They can't be deferred to a safepoint.
English
1
0
0
115
Filip Jerzy Pizło
Filip Jerzy Pizło@filpizlo·
@gigastarks @lcc_27 That's true if: (1) you wanted to get to the level of fidelity I have on Linux, and (2) you're not Microsoft. The way to think of Fil-C if you're an OS builder is that it's an opportunity to create a new ABI slice that is totally memory safe. It's expensive, sure, but doable
English
1
0
1
96
John Starks
John Starks@gigastarks·
@filpizlo @lcc_27 I think for Windows you’d need to create a much wider “syscall” layer wrapping all the Win32 APIs you want to support, since you can’t rebuild the system DLLs with the Fil-C ABI. This seems impractical.
English
1
0
1
213
Filip Jerzy Pizło
Filip Jerzy Pizło@filpizlo·
@lcc_27 Good question. I think that for Fil-C to have support for other OSes, it would have to be something contributed by other volunteers.
English
1
0
1
300
John Starks
John Starks@gigastarks·
@filpizlo Because IIUC, everything in your binary has to be built with Fil-C—it’s a new ABI, incompatible with existing libraries. So if your C code uses a Rust lib, you can’t use Fil-C today.
English
0
0
0
65
John Starks
John Starks@gigastarks·
@filpizlo How much of Fil-C is in clang vs llvm? What would it take to extend Fil-C to support other LLVM-backed languages (such as Rust)?
English
2
0
2
591
John Starks
John Starks@gigastarks·
@filpizlo @learntToCode Are syscalls really that different with Fil-C? I.e., Fil-C needs some encoding of the semantics of the syscall in order to validate inputs, right? No different from writing a safe wrapper around an (unsafe) syscall. Just a question of where the escape hatch is.
English
1
0
2
540
Filip Jerzy Pizło
Filip Jerzy Pizło@filpizlo·
The borrow checker is stronger if you can make your whole program conform to it. And that’s the problem. You won’t get your whole program to conform to it; you’ll have unsafe blocks for syscalls and your wackiest data structures. But in Fil-C, all of that passes Fil-C’s checking - no unsafe escape hatch needed
English
1
0
18
1.4K
Filip Jerzy Pizło
Filip Jerzy Pizło@filpizlo·
Status of Fil-C. - Reliably achieves memory safety for C and C++ with stronger guarantees than rewriting in Java or Rust. Much stronger guarantees than asan/valgrind/softbound/hwasan/mte (those aren’t memory safe at all! Too easy to bypass). Similar guarantees to CHERI, just on stock HW. - Stable enough for production use. I’ve tested 100s of C/C++ programs. Most work with zero changes, or just minor build system changes. The compiler is clang 17 based so you get all of those features. - Performant enough for many use cases. Some programs experience less than 2x overhead or even zero perceptible overhead. Text editor, shells, cmdline utilities just work and you won’t notice a perf hit. - Only available on Linux/X86-64 and requires its own ABI slice. Easy to port to other platforms, I just don’t have time for that. - More than zero users. - Zero high profile users have publicly (or even privately) said they are using it, but that doesn’t mean that there aren’t any. - Still a solo project. If I got hit by a bus then the project would likely die. It’s a fun state to be in. Like, maybe there is a high profile user and I just don’t know it. Maybe the low profile folks using it will find great success in whatever they are doing with Fil-C. Anything is possible
English
8
26
276
18.7K
Andrew Gallant
Andrew Gallant@burntsushi5·
This week is the first time I used a rice cooker. Wow! I knew they existed before, but it just never really entered my awareness. In terms of convenience, it's like sous vide, but for rice. Total game changer in terms of time management for dinner prep.
English
1
0
24
2.8K
John Starks
John Starks@gigastarks·
@gerhart_x @clift_m We are working on improving the TLFS. If you have specific areas you’d like to see addressed, let me know.
English
0
0
3
59
x86matthew
x86matthew@x86matthew·
I created a hypervisor-based emulator for Windows x64 binaries. This project uses Windows Hypervisor Platform to build a virtualized user-mode environment, allowing syscalls and memory accesses to be logged or intercepted. elastic.co/security-labs/… Project: github.com/x86matthew/Win…
English
29
344
1.3K
112.5K
John Starks
John Starks@gigastarks·
@kromych @x86matthew Should work… we added support a good while ago for hot add of VP after partition setup.
English
0
0
1
69
romank
romank@kromych·
@x86matthew Very cool stuff, thanks for sharing! If WHvCreateVirtualProcessor was allowed (is it?) after setting the partition up, that might’ve been the way to model threads, albeit the limit is 2048 VPs/partition iirc. The hv then would do the scheduling, VPs would share CR3…
English
1
0
1
550
John Starks retweetledi
Dmitrii Kovanikov
Dmitrii Kovanikov@ChShersh·
I hate generic ‘utils’, ‘helpers’ and ‘miscellaneous’ directories and modules in software projects. But it’s been surprisingly hard to get rid of them. I feel like there’s a lesson here. Every house has a storage box where you just store random stuff.
English
90
40
1.2K
85.3K
John Starks
John Starks@gigastarks·
So, I’m trying to install manim and… are Python people okay?
English
4
0
0
789
John Starks
John Starks@gigastarks·
@stanzillaz @charliermarsh Looked promising, but I hit some known bug where it hard codes some CFLAGS or something from their build machine, and those flags reference paths that don’t exist on my machine, so random dependencies fail to build.
English
1
0
1
86