Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!snorkelwacker.mit.edu!ira.uka.de!smurf.sub.org!flatlin!ptavv!ralf From: ralf@ptavv.ka.sub.org (Ralf Wenk) Newsgroups: comp.os.minix Subject: Re: Is this a MacMinix bug, or is it my machine only? Message-ID: <1991Jun29.213157.00751@ptavv.ka.sub.org> Date: 29 Jun 91 21:31:57 GMT Article-I.D.: ptavv.1991Jun29.213157.00751 References: <1991Jun28.084706.12180@ukpoit.co.uk> Lines: 42 In article <1991Jun28.084706.12180@ukpoit.co.uk> paul@ukpoit.co.uk (Paul Wood) writes: > I have been testing the recently posted uucp and I am getting problems > with the uucico. The problems are really puzzelling. Can some MacMinix > user please try out the following test code based upon a section of > uucico and tell me if it works or fails. > > main() { > char *memory; > > if((memory=(char *)malloc(15)) == (char *)0) { > printf("malloc failed\n"); > } > else { > free(memory); > printf("memory freed\n"); > } > printf("test complete\n"); > } > > The free fails on my MacMinix with the message > "assert failed in lib/malloc.c" Same problem in MINIX ST with this source. The address passed to free(3) is garbage. You are assuming sizeof(int) == sizeof(void *) which is not true in Mac and ST (AMIGA ?) but in PC MINIX. Look at the assembler output of the ACK compiler and you will see why the result is damaged. If you add exterm void *malloc(); or better #include it will work. > > It works on my Unix machines, which of course is should! Because the sizes are equal for your C compiler. -- -- Ralf Wenk -- ralf@ptavv.ka.sub.org