When using depmod on a RHEL 5 system, module-init-tools-cross can segfault. Reproducing this bug is dependent upon the memory layout of the host, so it may be difficult to reproduce. For the full bug report upstream see: http://article.gmane.org/gmane.linux.kernel.modules/478 (a bug will also be filed upstream.) Important bits quoted below: I was able to track down the problem to the output_pci_table function. The pci_table has a bad address in it. Tracing things back in elfops_core.c:fetch_tables, the memset of the tables is never done because strings and syms are both empty. Tracing back further to depmod.c:grab_module, it appears that the new = malloc(...) setups up things, but never clears the memory that was just allocated. As a quick hack I added a memset to clear memory: static struct module *grab_module(const char *dirname, const char *filename) { struct module *new; new = NOFAIL(malloc(sizeof(*new) + strlen(dirname?:"") + 1 + strlen(filename) + 1)); + memset(new, 0x00, sizeof(*new) + strlen(dirname?:"") + 1 + strlen(filename) + 1); if (dirname) sprintf(new->pathname, "%s/%s", dirname, filename); else Things now appear to be working as expected, no segfaults, no unusual behavior.
Filed with the upstream maintainer, see: https://bugzilla.kernel.org/show_bug.cgi?id=16528
Note: this was found on a RHEL 5.1 based system. Running kernel 2.6.18-53.el5PAE and glibc-2.5-18. I've been able to reproduce the segfault on both 32-bit and 64-bit ia32 systems.
This should be fixed in f4cb0870acd980a35e6e87b5bcf548a4452fd6a7 as far as Poky goes