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

When Created: 02/23/1998 04:47:29
Against DJGPP version: 2.01
By whom: martin.stromberg@lu.erisoft.se
Abstract: gdb crashes if you try to derefence a pointer with value -1
When you are debugging a program and try to do "p *q", where 
q == 0xffffffff, gdb crashes.

Solution added: 02/23/1998 04:50:12
By whom: Martin.Stromberg@lu.erisoft.se
The problem is in the library code, here's a patch:


*** src/debug/common/dbgcom.c   Wed Feb 18 22:19:04 1998
--- src/debug/common/dbgcom.org Tue Aug 13 00:08:04 1996
***************
*** 553,562 ****
 
    unsigned limit;
    limit = __dpmi_get_segment_limit(__djgpp_app_DS);
!   if(4096 <= a             /* First page is used for NULL pointer detection. */
!   && a <= limit            /* To guard against limit < len. */
!   && a - 1 <= limit - len  /* To guard against limit <= a + len - 1. */
!      )
      return 0;
  /*  printf("Invalid access to child, address %#x length %#x  limit: %#x\n", a, len, limit);
    if (can_longjmp)
--- 553,559 ----
 
    unsigned limit;
    limit = __dpmi_get_segment_limit(__djgpp_app_DS);
!   if(a >= 4096 && (a+len-1) <= limit)
      return 0;
  /*  printf("Invalid access to child, address %#x length %#x  limit: %#x\n", a, len, limit);
    if (can_longjmp)

Solution added: 04/12/1999 10:00:53
By whom: eliz@is.elta.co.il
Fixed in WIP for v2.03.

Fixed in version on 04/22/1999 09:00:40
By whom: eliz@is.elta.co.il



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