Subject: [clisp-list] Compile and Debugging options

From: Dan Stanger <[email-masked]>
Date: Sun Nov 10 06:47:01 2002

Is there a document, it the clisp distribution that covers the various
safety and debugging options
available for clisp compilation?
Thanks,
Dan Stanger

---

From: Sam Steingold <[email-masked]>
Date: Sun Nov 10 09:06:02 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Compile and Debugging options"
> * Sent on Sun, 10 Nov 2002 07:46:44 -0700
> * Honorable Dan Stanger <[email-masked]> writes:
>
> safety and debugging options available for clisp compilation?

configure builds CLISP with SAFETY=0 and gcc -O2
--with-debug means SAFETY=3 and gcc -g.

see lispbibl.d for the meaning of SAFETY: basically it enables various
run-time consistency checks that make CLISP crash earlier when it will
eventually crash due to a bug.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Those who can laugh at themselves will never cease to be amused.

---

From: Arseny Slobodjuck <[email-masked]>
Date: Mon Nov 11 03:13:03 2002

Hello Sam,

> --with-debug means SAFETY=3 and gcc -g.
Did you ever build clisp with cygwin & gcc & --with-debug ?
It stops at 'ar rcv lisp.a lisp.o' point with 'memory exhausted'
(this is cygwin bug or limitation). I investigated cygwin-list and
this problem seems quite old.

Dan, please tell if you'll successfully build with-debug.

-- 
Best regards,
 Arseny

---

From: Dan Stanger <[email-masked]>
Date: Mon Nov 11 05:43:06 2002

I got to that point also.  Is there no workaround?
I was going to build ar with debug, to see if I could run it with gdb.
Dan

Arseny Slobodjuck wrote:

> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> clisp-list mailing list
> [email-masked]
> https://lists.sourceforge.net/lists/listinfo/clisp-list

---

From: Sam Steingold <[email-masked]>
Date: Mon Nov 11 06:00:03 2002

> * In message <[email-masked]>
> * On the subject of "Re[2]: [clisp-list] Compile and Debugging options"
> * Sent on Mon, 11 Nov 2002 17:16:24 +1000
> * Honorable Arseny Slobodjuck <[email-masked]> writes:
>

yes,  I have seen this, but it does not prevent you from debugging
CLISP on cygwin.  this error happens after lisp.run is already there.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
cogito cogito ergo cogito sum

---

From: Arseny Slobodjuck <[email-masked]>
Date: Mon Nov 11 06:10:06 2002

Hello Dan,

> I got to that point also.  Is there no workaround?
I didn't found any.

> I was going to build ar with debug, to see if I could run it with gdb.
Wow, cool. But the problem seems to be not in ar but in memory management.
It's my impression.

Need to scan cygwin-list for the pass 2.

-- 
Best regards,
 Arseny

---

From: Dan Stanger <[email-masked]>
Date: Mon Nov 11 07:08:03 2002

> CLISP on cygwin.  this error happens after lisp.run is already there.

Does this mean that I can just touch lisp.a, and continue?  What is lisp.a
needed for?
Dan

---

From: Sam Steingold <[email-masked]>
Date: Mon Nov 11 07:17:07 2002

> * In message <[email-masked]>
> * On the subject of "Re: Compile and Debugging options"
> * Sent on Mon, 11 Nov 2002 08:07:58 -0700
> Does this mean that I can just touch lisp.a, and continue?

depends on what you want to accomplish. :-)
I _think_ you should be able to debug CLISP on cygwin despite this
problem... 

> What is lisp.a needed for?

it's for making binary distributions.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
If abortion is murder, then oral sex is cannibalism.

---

From: Randall R Schulz <[email-masked]>
Date: Mon Nov 11 07:50:08 2002

Dan, Arseny,

Look into the Cygwin registry setting "heap_chunk_in_mb". It's used to 
override the default 256 megabyte-per-process heap limit for Cygwin 
processes. I've had to use it to accomplish an optimized compile one module 
of an interpreter (XSB Prolog) that had a large switch statement (that was 
a few years ago using GCC 2.95--GCC 3.2 is now available under Cygwin).

This recipe from Charles Werner (posted in a message with the Subject 
"fixing heap_chunk_in_mb to 512MB doesn't work" on "Fri, 06 Sep 2002 
15:03:48 +0200" should be helpful:

-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
Re: Cygwin memory limit

Recently I wanted to increase the program/data memory limit for cygwin 
beyond the default 256 MB and a quick scan of the cygwin list revealed this 
thread. I was able to get this to work by doing the following:

1. modify the registry, adding a DWORD value  heap_chunk_in_mb and setting 
it to 1024 using the regtool that is part of the cygtools package in 
cygwin. The value here is in decimal Mbytes:

regtool -i  set  /HKCU/Software/Cygnus\ Solutions/Cygwin/heap_chunk_in_mb 1024
regtool -v  list  /HKCU/Software/Cygnus\ Solutions/Cygwin

2. rebooting the machine
3. turning off the inetd service (if you have installed the cygwin inetd 
service)
4. restarting the inetd service
5. open a cygwin bash shell window.

I tested the memory allocation using the following little C program, 
compiled with:

gcc -O  max_mem.c -o max_mem.exe

#include "stdlib.h"
#include "stdio.h"

int main(int argc, char **argv)
{
  char *m;
  int mb;
  size_t n;
  if(argc < 2) {
    printf("usage: %s <Mb>\n\n",argv[0]) ;
    printf("input parameters: \n");
    printf("  MB            number of MB of memory to allocate\n");
    exit(-1);
  }
  sscanf(argv[1],"%d",&n);
  m = malloc((size_t)n*1024*1024);
  if(m == NULL){fprintf(stderr,"cannot allocate memory %d MB of 
memory\n",n); exit(-1);}
  else printf("allocated %d MB of memory\n",n);
  free(m);
  return(0);
}

My system is an NT4 SP5 machine running the latest cygwin dll  version 
1.3.12. I also tried this on a win2K SP2 system sucessfully.

Cheers,
Charles

-- 
Dr. Charles L. Werner
Gamma Remote Sensing AG
Thunstrasse 130
CH-3074 Muri b. Bern, Switzerland

http://www.gamma-rs.ch
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-

Note this from the release notes for Cygwin 1.3.14-1:

- Accept heap_chunk_in_mb intry in HKEY_LOCAL_MACHINE, too,
   to allow global setting.  (Christopher Faylor)

Randall Schulz
Mountain View, CA USA

---

From: Arseny Slobodjuck <[email-masked]>
Date: Fri Nov 15 04:15:03 2002

Hi,

Tuesday, November 12, 2002, 1:49:25 AM, you wrote:

> Look into the Cygwin registry setting "heap_chunk_in_mb".

Thank you.

It didn't help. While heap_chunk_in_mb affects this allocation test
program, ar still doesn't work. But I don't have 1024 Mb of memory
anyway... Max is 400 Mb, but ar cannot require so much memory to
put 8Mb obj to library...

Just want you to know.

-- 
Best regards,
 Arseny