Date: Sat, 18 Dec 1999 18:31:15 -0500 (EST) From: dm@reeducation-labor.lcs.mit.edu To: FreeBSD-gnats-submit@freebsd.org Subject: kern/15554: malloc fails in OMAGIC programs Message-ID: <199912182331.SAA38082@punitive-surgery.lcs.mit.edu>
next in thread | raw e-mail | index | archive | help
>Number: 15554 >Category: kern >Synopsis: malloc fails in OMAGIC programs >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 18 15:40:00 PST 1999 >Closed-Date: >Last-Modified: >Originator: David Mazieres >Release: FreeBSD 3.3-RELEASE i386 >Organization: >Environment: i386 machine running stock FreeBSD-3.3-RELEASE (including generic kernel) >Description: Memory allocation files in OMAGIC programs. >How-To-Repeat: Compile and run this program: #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> int main (int argc, char **argv) { char *p = malloc (8192); if (!p) { char badmalloc[] = "malloc failed\n"; write (2, badmalloc, sizeof (badmalloc)); write (2, strerror (errno), strlen (strerror (errno))); write (2, "\n", 1); exit (1); } exit (0); } /* --- end --- */ like this: % cc -static -N -o badomagic badomagic.c % ./badomagic malloc failed Cannot allocate memory % >Fix: unknown >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912182331.SAA38082>