7 ms·
I am wondering if machine learning can use used to solve these problems. I have heard that Google uses a machine learning to auto find the bugs and raise merge
by namanaggarwal 7y ago
I am wondering if machine learning can use used to solve these problems. I have heard that Google uses a machine learning to auto find the bugs and raise merge request against them. Someone from Google can confirm.
- Mountain_Skies 7y agoIt's very likely. Code linting has been around for a long time. In the security world, static code analysis tools are used to find security vulnerabilities. It makes sense that Google would have something similar for identifying all manner of code defects.
- jacquesm 7y agoYou don't need machine learning, you need a better architecture. Micro kernels can be made in such a way that they are guaranteed race condition free.
- adrianN 7y agoIf you're willing to throw a large part of the existing code away to move to a microkernel architecture, you might as well rewrite it in a language that doesn't have race conditions by design.
- moomin 7y agoThe funny thing about this being that Linux was originally announced on comp.os.minix.
- tormeh 7y agohttps://redox-os.org/ https://redox-os.org/
- danmg 7y agoHow does rust negate data race conditions? These aren't memory errors.
- jolux 7y agoThe borrow checker prevents it. Race conditions that aren’t data races are not prevented, though.
- tormeh 7y agoIt's an OS with microkernel written in Rust. It's literally the first thing you see on the website. So it's both microkernel, and Rust, so it is an example of people doing what parent mentioned.
- jacquesm 7y agoRace conditions can be constructed in almost any language. It is more of a systemic thing than a language artifact though some languages are more race condition prone than others. You can even have race conditions in hardware. Multi-threading or distributed software are excellent recipes for the introduction of race conditions, sometimes so subtle that the code looks good and the only proof that there is something bad going on is the once-in-a-fortnight system lockup.
- lokedhs 7y agoI believe the undocumented instructions in the 6502 was caused by race conditions in the CPU. Some of these instructions are actually usable while others give random results.
- jacquesm 7y agoI wrote a 6502 assembler and had a really hard time not giving $88 it's own mnemonic in the main table rather than to load it at the start of every file from an include. It was just too useful :)
- lokedhs 7y agoWhy wouldn't you? These opcodes seems to be used by most people these days, so there seems to be no reason not to treat them just like any other opcode?
- mondoshawan 7y agoAh, no. Those are caused by don't care states in the logic of the PLA instruction decode block.
- Symmetry 7y agoOne of my professors in processor design had a story about debugging a register leak in an out of order processor with register renaming.
- vkaku 7y agoRace conditions can be created by I/O paths. I'm willing to state that unless the said language abstracts away all I/O, it will always be possible to introduce a bug :)
- ukj 7y agoHaskell Monads! #Sarcasm
- not_a_cop75 7y agoIs the trade off efficiency? Because I'm sure a language that is willing to wait 5 seconds between operations can do pretty well at eliminating race conditions.
- jacquesm 7y agoRace conditions do not have anything to do with absolute time, it is simply an assumption about the sequence in which things are going to happen and finding out in practice that the implementation allows other sequences the output of which is undefined.
- not_a_cop75 7y agoMost absolutes spoken about anything are natural fallacies. The truth is that they can. Hell, I see Apple devices that don't update anything including time until you take them out of screen lock, and you see the previous date and charge amount sometimes even after unlock. That is an efficiency based form of race condition.
- gpderetta 7y agoWhat magic in microkernels prevents race conditions?
- jacquesm 7y agoThat they allow for reduction of scope to the point that race conditions can be mostly eliminated. A macro kernel has untold opportunities for race conditions because the kernel itself is multi-threaded. Effectively every driver is a potential candidate. In a - properly implemented - micro kernel you will have each of those drivers isolated in its own user process, and if there is an issue (memory corruption, crash, logic error or race condition) the possibility of its effects spreading is limited. Isolation is half the battle when dealing with issues such as these.
- gpderetta 7y ago> Isolation is half the battle when dealing with issues such as these. having had to deal with race conditions between processes running at opposite side of a continent, color me unimpressed.
- jacquesm 7y agoThat's a sign of a very poor architecture, see also: the fallacies of distributed systems.
- joosters 7y agoDo you mean that each driver is forced to be single-threaded, somehow? Or just that the drivers are isolated, so they can have as many race conditions as they like, but the microkernel will keep running? Because I don't see the advantage here. So what if my filesystem driver is isolated, a race condition in there is still going to corrupt all my data and I'm not going to be cheered up by the fact that the kernel can keep on ticking.
- jacquesm 7y agoThat's one way of looking at it. Another is to think of this as layers of essential services: kernel, memory management, networking services, file services and so on. For a layer to be reliable the layers below it have to be reliable too. Isolating the layers in processes allows for faster resolution of where a problem originates which in turn will help to solve it. And being able to identify the source of a problem allows for several other options: restart the process, proper identification of a longer term resolution because of the ability to log the error much closer to where it originated. These are not silver bullets but structural approaches acknowledging the fact that software over a certain level of complexity is going to be faulty. In my opinion the only system that gets this right is Erlang. (not the language, but the whole system)
- atq2119 7y agoPerhaps the microkernel is free of race conditions. But now you've introduced a zoo of interacting processes (drivers, servers, etc.) and with that a new class of race condition in their interactions, which may or may not be harder to debug than what you started out with.
- jacquesm 7y agoThat zoo will still have a lot of advantages over a monolith, and one of those advantages will be that if the components stick to their defined interfaces for interaction that your chances of race conditions are substantially limited.
- JaRail 7y agoIt'd be a really interesting project to data-mine a large number of IDEs at a company like google. Use machine learning to predict fixes to lint/compile errors, and surface those suggestions in the IDE. Would also be fun to do it with code reviews to see what kind of garbage suggestions you can generate there. Probably a lot of "I don't understand what this does" and "please write tests for this." Would also be cool for auto-complete suggestions. I'm thinking more along the lines of extracting larger patterns than for loops, such as stubbing out classes that follow a projects existing style. For example, adding an auth check at the start of a web request handler if that's what it sees elsewhere.