Re: Crash with kfree(null) on MacBook? kobject_set_name_vargs

From: RafaÅ MiÅecki
Date: Mon Apr 11 2011 - 13:28:39 EST


I just got report from Arend that he's hitting the same issue. I've no
idea what's wrong with my dev_set_name call. Should I pre-init struct
dev somehow? Before calling dev_set_name on it?

W dniu 10 kwietnia 2011 23:28 uÅytkownik Bob Copeland
<me@xxxxxxxxxxxxxxx> napisaÅ:
> 2011/4/10 RafaÅ MiÅecki <zajec5@xxxxxxxxx>:
>> I'm writing new axi bus driver and one of the early testers reported
>> it crashing for him. Andy is using MacBook and backtrace+debugging
>> pretty clearly point to kfree being called on null string.
>
>> bcopeland on #linux-wireless suggested turning on SLAB or SLUB. Is
>> this going to provide some interesting info?
>
> To be precise, I said slab or slub _debugging_. ÂThe reason I said
> this is that often a crash on kfree() is due to memory corruption.
> Many places in the kernel rely on kfree(NULL) being a safe operation,
> so it's likely something more than that. ÂSL?B debugging adds
> poisoning and corresponding checks that detect several kinds of
> corruption like buffer overruns, use-after-free, etc.
>
> The other thing you can do is get the disassembly of the Code portion
> for your oops and match it up with specific C code, look at the
> register file in the oops and match that up with variable names, and
> work backwards to figure out which pointers are broken. ÂSometimes
> this can be enlightening, like if a pointer has ascii values, or is a
> small number (0 + some struct offset).

Andy, Arend: I'm not sure if someone will have straight idea whats
wrong with my code. Could you try this SL?B debugging maybe?

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