Discussion:
trying to solve a core dump
(too old to reply)
Jens Staal
2015-02-05 15:23:46 UTC
Permalink
Hi

I have been able to build busybox for both Win32 and Linux using Open Watcom
(v2), but the build still depends on gcc as HOSTCC. While trying to use owcc
as HOSTCC, the binary "conf" crashes with a core dump (SIGSEGV).

running wd on "conf" built with -g3 identifies the following function
failing at the "if (!f && name[0] != '/')" :

/*
* Try to open specified file with following names:
* ./name
* $(srctree)/name
* The latter is used when srctree is separate from objtree
* when compiling the kernel.
* Return NULL if file is not found.
*/
FILE *zconf_fopen(const char *name)
{
char *env;
FILE *f;

f = (const char*) fopen(name, "r");
if (!f && name[0] != '/') {
env = getenv(SRCTREE);
if (env) {
char *fullname = alloca( strlen(env) +
strlen(name) + 2 );
sprintf(fullname, "%s/%s", env, name);
f = fopen(fullname, "r");
}
}
return f;
}


according to wd is both f and name NULL.
Any way to solve this?
Johann Klammer
2015-02-05 18:03:32 UTC
Permalink
Post by Jens Staal
Hi
I have been able to build busybox for both Win32 and Linux using Open Watcom
(v2), but the build still depends on gcc as HOSTCC. While trying to use owcc
as HOSTCC, the binary "conf" crashes with a core dump (SIGSEGV).
running wd on "conf" built with -g3 identifies the following function
/*
* ./name
* $(srctree)/name
* The latter is used when srctree is separate from objtree
* when compiling the kernel.
* Return NULL if file is not found.
*/
FILE *zconf_fopen(const char *name)
{
char *env;
FILE *f;
f = (const char*) fopen(name, "r");
if (!f && name[0] != '/') {
env = getenv(SRCTREE);
if (env) {
char *fullname = alloca( strlen(env) +
strlen(name) + 2 );
sprintf(fullname, "%s/%s", env, name);
f = fopen(fullname, "r");
}
}
return f;
}
according to wd is both f and name NULL.
Any way to solve this?
go up the stack and look what called zconf_fopen with NULL?
(I forgot if wd has a backtrace cmd...)

Loading...