short life linux, please

Standards in IT are like the promises in the bible, that your next life will be in heaven. Most people believe that they exist, as they do not go beyond some basic system call names like write/open, etc., and they continue to believe in life in heaven. I am already sick with all these preaches about standards that always failed. In case of linux things are even worst. As most of other unices are dying out, linux is practically the main reference point. Linux took it however in an even worst direction. They say they would keep compatibility blah blah. The same time is lot of chaos, but the more the chaos is growing the less chance is given for new ideas.

What is my problem at the moment. Well, I wanted to use already for longer in different situations the power of MMU to do different tricks. Finally I had to draw the conclusion that it is impossible on Linux. It is simply impossible, as Linux obscures part of the pattern. Today I was thinking to write a very little program to test different random memory layouts inside a linux process in different contexts, based on different sequences of mmap and brk calls. The idea was to “scan” the memory by trying to write to it. You set up a signal handler to sigsegv, and then if you try to write to an inexistent page, then the MMU will trigger an interrupt, the kernel will try to recover the page from swap, if it is the case, and then calls a signal handler. What went wrong in my experiment? After the signal handler did it’s job, the kernel is restoring the stack and the state of the registers, and will continue the process where it was stopped before the “bad” instruction was executed. The problem is that the instruction pointer does not advance so again the same sick instruction is called.
So, what is missing? Well, simply a piece of glue that the kernel should call after it has restored the state of the stack and registers, so that the “victim” process can safely jump over the “bad” instruction and handle it in some way.

Well, my little experiment is impossible, unless I will try to unwind the stack, find the position of the wrong instruction, and help it to run, run.. :)

Well, how is this related this to my frustration? Simply, if something like “post signal handler” would would be proposed to the key linux kernel developers it would be rejected as many many (other :) ) brilliant ideas I saw being lost… As the motto is industry ueber alles! In a better world, system calls would be able to cope with some primitive userspace closures, etc. etc. Well… nonsense to waste time to develop the idea

Leave Your Comment

Name*
Mail*
Website
Comment