Well, alright, it's unlikely.
Unless that app triggers some bug in the code or some bug in kernel mode stuff, there's no chance it will crash the OS, though.
Printable View
Well, alright, it's unlikely.
Unless that app triggers some bug in the code or some bug in kernel mode stuff, there's no chance it will crash the OS, though.
Nope I wasn't running as root, and nope I didn't write a fork bomb:devil:
I was just working on my asignment one day and poof! One of the linux geeks tried everything and told me the kernel really was crashed - nothing whatsoever worked.
As for Windows, that'll crash too if you're unlucky. You learn to avoid doing certain things after a while. For example, don't try performing a drag and drop operation in any program whilst your code is sitting at a breakpoint in the middle of your drag and drop handling code. It's also not good to terminate other processes or their threads at random.
"no chance it will crash the OS" - yeah cause OSes never have bugs - especially not Windows...:eek:
Of all kernel code, the graphics driver is statistically most likely to cause a BSOD - because graphics drivers, even for Vista where a large portion is moved out of kernel mode, is very complex, and there are oodles of combinations of arguments and functionality that are all handled by a handful of basic functions - many pointers for example are valid to be NULL in some circumstances, but not in others.
I would think that it does, but it's quite certainly one of the obvious corner cases that not normally is encountered in well-behaved code (you NEVER need to allocate zero bytes of memory). On the other hand, the management of allocated memory blocks is done outside of the actual allocation, so it shouldn't matter of it's 0, 1, 13 or 400KB - it's all done the same way anyways [and will most likely take up 32 or 64 bytes of memory even if you allocate zero bytes].Quote:
I'm totally OK with allowing 0 bytes, i'm just wondering if free(ptr) will behave normally on a 0-byte allocated pointer, and if i may have a memory leak.
--
Mats