kmodloader segfault on ixp4xx (armeb)
Username: Ted Hess
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=544
I believe this issue to be a really obscure endian problem which may be more toolchain related than a raw software bug in the source code. I’ve tried to work-around this issue with code changes, but the problem persists. I give up...
Inside the routine ‘alloc_module’ the following code produces the wrong result – specifically byte-swapped pointers in the ‘_aliases’ array.
char **_aliases; ... char *ptr = (char *)_aliases + naliases * sizeof(_aliases[0]); int len;
i = 0; do { len = strlen(aliases[i]) + 1; memcpy(ptr, aliases[i], len); _aliases[i] = ptr; <<-- this is the failing assignment ptr += len; i++; } while (i < naliases);