lkml.org 
[lkml]   [1999]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] *(int*)0 = 0 & variations
Hi Manfred.

>>> + kassert() identical to the normal user mode assert().
>>> It _does not_ oops.

>> Looking at /usr/include/assert.h verifies this. assert() always
>> calls abort() and always has. It certainly makes sense to have
>> an assert macro that does not abort, but it is incorrect to
>> claim that the normal assert does not kill the program.

> I was aware of that, this is why I underlined _does not_.

> But it would be overdosed to call panic() on kassert(), so
> kassert() is identical to assert() except that is does return.

Personally, I'm in full agreement with that, which is why I won't
agree to have kassert() itself call panic() or oops() or any such.

> I don't think that kassert() and kassertoops() are required:
> kassert() should print all information that an oops would print,
> but then it tries to continue. The worst thing that could happen
> is an oops, so we win nothing by oopsing immediately.

Like you, I can see no benefit to be gained from using kassertoops()
and have it panic, but it seems to be desired...

However, I would not be surprised to find that there are places in the
kernel where if an assumption proves to be false, we would need to
abort the operation that led to that function, and I would see
something like the following being used:

#define kassertexit(cond,label) \
if (cond) { \
/* Do nothing */; \
} else { \
printk( ... ); \
goto label; \
}

Likewise, in the majority of cases, the jump is probably not required,
so the plain kassert() function would be used that didn't include that
goto line...

Best wishes from Riley.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* ftp://ftp.MemAlpha.cx/pub/rhw/Linux
* http://www.MemAlpha.cx/kernel.versions.html


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.054 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site