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)