On Mon, 10 Jul 2006 [EMAIL PROTECTED] wrote:


On Solaris, if a NULL argument is passed to printf type function for %s format 
the program crashes
. On Linux it does not. Would it be possible to change Solaris behavior to be 
similar to Linux?

Yes, fix the code which passes NULL to printf().

Fix the code not to use printf, but rather:

DTRACE_PROBE1(mymod__myprobe, char *, mystring)

or DTRACE_PROBE2(...) if you've got more arguments. Type them as needed.


debugging is safe via DTRACE_PROBE against invaid args - dtrace catches that.

Generic kernel function calling (including printf) isn't hardened - and why should the framework work around bugs in your driver ?

FrankH.


Having code stumble on in the presence of bugs is a bad idea.

The only way to "fix" this behaviour in Solaris is to map something at
address zero, e.g., by preloading the [EMAIL PROTECTED] dynamic object.

What does glibc print when confronted with a NULL?

It bothers me that they accept this; won't they ever learn that permissive
library code only helps in hiding bugs?

Casper

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code


==========================================================================
No good can come from selling your freedom, not for all gold of the world,
for the value of this heavenly gift exceeds that of any fortune on earth.
==========================================================================
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to