www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000096

When Created: 07/15/1996 07:07:26
Against DJGPP version: 2.00
By whom: eliz@is.elta.co.il
Abstract: Debuggers crash when environment is larger than 4KB
If your environment has more than 4KB of variables, the DJGPP debuggers
will crash when they load the debuggee.

The reason is a bug in v2load.c that only allocates 4KB for the
environment, no matter how large the actual environment size is.

Solution added: 07/15/1996 07:10:10
By whom: eliz@is.elta.co.il
Apply this patch to v2load.c:
*** src/debug/common/v2load.c~0 Thu Jan 11 04:45:10 1996
--- src/debug/common/v2load.c   Fri Jul 12 20:36:18 1996
*************** int v2loadimage(const char *program, con
*** 60,66 ****
    unsigned client_cs, client_ds, my_ds;
    __dpmi_meminfo memblock;
    unsigned new_env_selector;
!   char true_name[200];

    _truename(program, true_name);

--- 60,66 ----
    unsigned client_cs, client_ds, my_ds;
    __dpmi_meminfo memblock;
    unsigned new_env_selector;
!   char true_name[FILENAME_MAX];

    _truename(program, true_name);

*************** int v2loadimage(const char *program, con
*** 88,94 ****
      strcpy(si.magic, "go32stub, V 2.00");
      si.size = 0x44;
      si.minstack = 0x40000;
!     si.minkeep = 4096;                        /* transfer buffer size */
      memset(&si.basename, 0, 24);      /* Asciiz strings */
    }
    if (header[0] != 0x014c) {          /* COFF? */
--- 88,94 ----
      strcpy(si.magic, "go32stub, V 2.00");
      si.size = 0x44;
      si.minstack = 0x40000;
!     si.minkeep = 16384;                       /* transfer buffer size */
      memset(&si.basename, 0, 24);      /* Asciiz strings */
    }
    if (header[0] != 0x014c) {          /* COFF? */
*************** int v2loadimage(const char *program, con
*** 134,140 ****
    si.env_size += 4 + strlen(true_name);

    /* Allocate the dos memory for the environment and command line. */
!   i = __dpmi_allocate_dos_memory((si.minkeep + 256) / 16, (int *)&new_env_sele
ctor);
    if(i == -1)
      return -1;

--- 134,140 ----
    si.env_size += 4 + strlen(true_name);

    /* Allocate the dos memory for the environment and command line. */
!   i = __dpmi_allocate_dos_memory((si.env_size + 256) / 16, (int *)&new_env_sel
ector);
    if(i == -1)
      return -1;

Fixed in version 2.01 on 07/26/1996 00:35:58
By whom: dj@delorie.com



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010