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

When Created: 12/14/1996 22:56:05
Against DJGPP version: 2.01
By whom: evos@m140.aone.net.au
Abstract: Programs compiled with -pg crash heavily.
Any of my source code compiled with djgpp 2.01 gcc 2.7.2.1 using the -pg switch
locks up my PC (486SX, 8mb ram, 12mb free space). Programs compiled without
this switch run fine with no errors.

Workaround added: 12/25/1996 02:50:25
By whom: evos@m140.aone.net.au
The problems is caused by the profiling code calling functions that access the 
monchrome display memory in the PC. If that memory is being used for something 
else the program crashes. To workaround this change your the EMM386 args in 
config.sys so that the memory region between B000 and BFFF is not being used.
If you cannot figure out the above then another way of doing it is to run
memmaker and select Custom Setup when it asks you. Change the settings so that
Use Monochrome Memory Region is No.

Solution added: 12/26/1996 09:50:29
By whom: eliz@is.elta.co.il
Patch src/libc/crt0/mcount.c with the patch below, recompile and
put into the library.  Then relink any program compiled with
-pg option.

*** src/libc/crt0/mcount.c~0    Thu Dec 26 13:59:04 1996
--- src/libc/crt0/mcount.c      Thu Dec 26 13:56:06 1996
*************** void mcount(int _to)
*** 64,70 ****
    to = *((&_to)-1) - 12;
    ebp = *((&_to)-2); /* glean the caller's return address from the stack */
    from = ((int *)ebp)[1];
-   _mono_printf("from %08x  to %08x\n", from, to);
    if (*cache && ((*cache)->from == from) && ((*cache)->to == to))
    {
      /* cache paid off - works quickly */
--- 64,69 ----

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



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