Re: Kernel panic help - kernel controls?
site_archiver@lists.apple.com Delivered-To: Darwin-kernel@lists.apple.com On Jun 23, 2007, at 2:31 PM, Greg wrote: #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); -Shawn _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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. Sounds like something is writing outside of name[MAXLEN] and overwriting the pointer in other. This email sent to site_archiver@lists.apple.com
participants (1)
-
Shawn Erickson