delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/01/18/00:39:18

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10201180538.AA24590@clio.rice.edu>
Subject: Re: env.exe crash - reproducible test program
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Thu, 17 Jan 2002 23:38:24 -0600 (CST)
Cc: acottrel AT ihug DOT com DOT au (Andrew Cottrell),
djgpp-workers AT delorie DOT com (DJGPP developers)
In-Reply-To: <Pine.SUN.3.91.1020116081912.2698H-100000@is> from "Eli Zaretskii" at Jan 16, 2002 08:24:20 AM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

The following program will crash when built with v2.04/cvs due to a free
nonallocate block assert failure.  Fails on Win2K and Win95.

You must not have the DJGPP environment variable set to have it fail 
(if set, it runs).  Evil.

Compiled with gcc -g env2.c -o env2.exe

#include <stdio.h>

extern char **environ;

int main (int argc, char **argv, char **envp)
{
  char *dummy_environ[1];

  malloc_debug(3);

  environ = dummy_environ;
  environ[0] = NULL;

  for (; *envp; envp++)
    putenv (*envp);

  while (*environ)
    puts (*environ++);

  return 0;
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019