# Floating pt error on NeXT

Hank Hughes (thigpen@fuji.ccs.neu.edu)
Thu, 7 Mar 1996 08:40:20 PST

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    	Compiling 1.8b3 on NeXTstep worked fine. However, running
    	the executable produces a snag: "Floating point exception"
    	I know, I know. "Nextstep, what the?!" But it's a real
    	idle machine and would be the only place to practice on.

    	Tracing it down using gdb showed, the error comes from
    	malloc() in storage.c:

    void *
    mymalloc(unsigned size, Memory_Type type)
    {
        void       *memptr;
        char	msg[100];

        if (size == 0)		/* For queasy systems */
    	size = 1;

    >>    memptr = (void *) malloc(size
    >> #ifdef FIND_LEAKS
    >>		             + 8
    >> #endif
    >>		             );
        if (!memptr) {
    	sprintf(msg, "memory allocation (size %u) failed!", size);
    	panic(msg);
        }

    #ifdef FIND_LEAKS
        *((int *) memptr) = type;
    #endif

    	Has anyone had similar problems?

    	Much appreciated,
    	-Hank