Re: Kernel panic help - kernel controls?
Re: Kernel panic help - kernel controls?
- Subject: Re: Kernel panic help - kernel controls?
- From: Shawn Erickson <email@hidden>
- Date: Sat, 23 Jun 2007 15:59:15 -0700
On Jun 23, 2007, at 2:31 PM, Greg wrote:
I was able to fix the panic, the culprit turned out to be some code
I was using (seemingly from a trustworthy and reputable source)
that recycled memory allocations (to prevent unnecessary
mallocing). Forgive me for the misguided accusations at kernel
controls, it's just that I did not trust my understanding of them
and the backtraces from gdb were fairly vague.
I then came across another panic that was caused by what I *think*
are boundary alignment problems in a data structure that I have,
I've implemented a simple hack-like fix for it but I'm sure there
has to be a better way.
#define MAXLEN 64
struct ItemStruct {
int len;
int flags;
char inQueue;
#if ALIGNMENT_HACK
char *name;
#else
char name[MAXLEN];
#endif
char *other;
};
The panic occurs when I try to free it like so:
kern_os_free(item->other);
kern_os_free(item);
Sounds like something is writing outside of name[MAXLEN] and
overwriting the pointer in other.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden