Subject: [clisp-list] Compile and Debugging options

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Mon Nov 11 07:29:01 2002

Dan wrote:

>What is lisp.a needed for?
Isnt'it used by the clisp-link etc. scripts, used when including modules?

So that might become a problem for Dan.

IIRC, the idea is to be able to say:
take your modules, then
 ld -o myclisp modules.o myadditionalobjects.o -l lisp.a libc.a/so/lib

but that's just convenience instead of writing all of CLISP's .o files explicitly - you get them anyway when compiling CLISP.

As I once said, I never used the clisp-link script to create modules on the Amiga, nor on MS-Windows. But I didn't automate the jobs either, which is needed for distributions.

Regards,
	Jorg.

---

From: [email-masked]
Date: Mon Nov 11 12:55:07 2002

I was able to compile with safety=3 after I did this on W2K, sp2.
make check passed all tests.

However, I have another problem.
Following is the backtrace:

This GDB was configured as "i686-pc-cygwin"...
(gdb) run
Starting program: /cygdrive/e/clisp-2.30/cygwin/gdi+base/lisp.exe

Program received signal SIGSEGV, Segmentation fault.
0x0043fb49 in main (argc=1, argv=0x100216d8) at spvw.d:1684
1684      user_uid = getuid();
(gdb) backtrace
#0  0x0043fb49 in main (argc=1, argv=0x100216d8) at spvw.d:1684
#1  0x61007288 in _libuser32_a_iname ()
#2  0x6100753d in _libuser32_a_iname ()
#3  0x005a7642 in cygwin_crt0 ()
#4  0x0040103c in mainCRTStartup ()
#5  0x77e97d08 in _libuser32_a_iname ()
(gdb) quit
The program is running.  Exit anyway? (y or n) y

The program is coreing in the first system call, after I link in
my module.  This does not happen when I compile without SAFETY, but
optimizations disabled.  I welcome any advice.
Thanks,
Dan Stanger

>Randall R Schulz wrote:
>
> 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
>
> At 23:16 2002-11-10, Arseny Slobodjuck wrote:
> >Hello Sam,
> >
> >Monday, November 11, 2002, 3:06:07 AM, you wrote:
> >
> > >> Is there a document, it the clisp distribution that covers the various
> > >> 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.
> >
> >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