Re: how to cause a kernel panic
Re: how to cause a kernel panic
- Subject: Re: how to cause a kernel panic
- From: Jim Magee <email@hidden>
- Date: Tue, 13 Aug 2002 19:31:58 -0400
First, a gentle nudge. The registered ports are reserved for system
library use. You should not be attempting to use them for your own
services. We may likely use those slots for other system services in
the future, and your software will not be compatible with that use.
You should use the bootstrap namespace to pass ports between processes.
If exposing the ports to other tasks is a problem, you can create a
private bootstrap subset for passing ports shared between the parent
and child only.
At first, I was suspicious. That's too easy to cause a panic. But I
get it too. I'll let you know when there is a fix.
But it is triggered by a flaw in your logic. You created a receive
right, and then made a call which assumed you have a send right as well
(mach_ports_register() is defined to copy each of the send rights
specified in the slots array into the kernel). You have to insert a
send right (using mach_port_insert_right() or
mach_port_extract_right()) for your newly created port before making
the call.
Of course, this should just return an error. As I said, I'm looking
into why that isn't so. ;-(
On Tuesday, August 13, 2002, at 02:04 PM, Joshua LeVasseur wrote:
Hello. I run Darwin 1.4.1 on a Pismo. Just a plain Darwin install;
not
OS X. From sysctl:
kern.osrelease = 1.4.1
kern.osrevision = 199506
kern.version = Darwin Kernel Version 1.4.1:
Sun Sep 30 20:54:21 PDT 2001;
root:xnu-201.roots/xnu-201.obj/RELEASE_PPC
I cause a kernel panic when using mach_ports_register(). The offending
code:
---------------
mach_port_t *registered_ports;
mach_msg_type_number_t count;
mach_port_t my_service_port;
mach_port_allocate( mach_task_self(), MACH_PORT_RIGHT_RECEIVE,
&my_service_port );
mach_ports_lookup( mach_task_self(), ®istered_ports, &count );
registered_ports[ ENVIRONMENT_SLOT ] = my_service_port;
mach_ports_register( mach_task_self(), registered_ports, count );
----------------
Sorry if this is an inappropriate forum for this info ... I'm new to
Apple's Darwin resources and haven't figured out where to submit bugs.
-jtl
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.