3 ms·
Yes, it is. Beyond simple examples, I've fixed segfaults by identifying the assembly where it happens, tracing that back to the lump of source where it happens,
by EliRivers 14d ago
Yes, it is. Beyond simple examples, I've fixed segfaults by identifying the assembly where it happens, tracing that back to the lump of source where it happens, guessed which piece is accessing memory and deducing from surrounding code how it was meant to be protected against.
In that case, the pattern matching was against every segfault I've ever fixed, which is a lot, and traipsing through assembly, which is also a lot. Lots of experience in tracing back to source code. So did that. Matching patterns. Didn't understand the language, don't know what it's trying to do, but I know what memory access is (because I've seen the pattern "access memory" a lot in my life) and this piece of code must be matching that pattern; whatever this code is, it must be touching memory. Now scroll up and down to look for similar code in other places, that I also cannot read but I can see when things look the same; match the pattern of pieces that work with this piece that doesn't. Oh, this looks the same but it has this extra piece; part of the pattern matches, part does not. Matching patterns. What if I copy it, paste into the bad place, apply a single change to match the symbols I see in the bad place, and see what happens... fixed.
It's not something I do every day and it's not nearly as good as actually understanding it, but the problem was solved and I did not know what the code was trying to do or how to read it.
All the above aside, surely it must be possible, because we have machines that do exactly that. They're made of statistics and patterns and they're doing it. Right in front of us. There is nothing else in there and they're doing it right now.