This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

malloc overrides


GraphViz uses iffe tests to determine system capabilities. Two tests, however, hang and require manual intervention to kill them and continue. These are the culprits:

####### start code 1 #######

/* Are we stuck with standard malloc? */

extern void _exit (int);
extern char* strdup (const char*);

char* malloc(unsigned n) {
    _exit(0);
    return 0;
}

int main(void) {
    strdup("yo");
    _exit(1);
}

####### end code 1 #######

####### start code 2 #######

/* Is alloca is based on malloc()? */

#include <alloca.h>

void* malloc(unsigned int size) {
    exit(0);
    return 0;
}

int main(void) {
    alloca(10);
    return 1;
}

####### end code 1 #######

In both cases, the program hangs and needs to be forcefully killed through Windows' taskmgr. On Linux, these run quickly and return 0 and 1, respectively.

Is this a problem with the code, or is this a bug or limitation in Cygwin?


Yaakov



-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]