Re: getting Segmentation Violation



thanks for replying. I need to specify few more details to make the
problem clearer. I am using Allegro CL 7 on windows machine with 512
mb RAM.

On Jan 8, 2:02 am, vanekl <va...@xxxxxxx> wrote:
On Jan 7, 3:18 pm, "000.tus...@xxxxxxxxx" <000.tus...@xxxxxxxxx>
wrote:

hello all,

I am developing a lisp application which analyzes the source code.
During analysis  it creates many objects using make-instance. The
problem is ....the program consumes available memory and PF usage
reaches to 1.90 GB and program emits an exception 'Segmentation
violation: error no 11'
To optimize it,  I am now using secondary storage to dump the
intermediate objects and retrieving them back whenever required. But
still...I am not getting rid of the problem(even though many make-
instance are removed).

So ... can anyone help me. or atleast  some pointers towards memory
model of lisp. thanks in advance.

1. Make sure your code works with smaller test samples.

yes, it works fine for smaller test samples.

2. Are you making heavy use of recursion? Some recursive forms may not
be optimized and make heavy use of the stack, breaking it. To make
sure you aren't accidentally getting into a run-away recursive
situation you can keep track of the depth and throw an error if it
gets too large.

i m using recursion at few places, but not heavy.

Also keep in mind that this situation can also occur with a set of
functions that call one another and get trapped in a never-ending
cycle, also possibly busting the stack.

3. Instrumenting/profiling your code will probably give insight. If
there's one thing I've learned, the pilot makes more errors than the
plane, and it's more productive to investigate there first.
When I say "instrument" I mean something as simple as keeping a
running log file or just stream to standard output with messages about
where the program is as it is running.

4. Some OSs allow the sysadmin to specify hard upper limits on the
amount of files one is allowed to open and the amount of memory that
may be consumed. Since you specify neither OS nor system limits,
you're on your own there.

5. If you compiled the Lisp yourself, you may want to think back
whether it passed all tests, or whether the tests were even run.

6. Is it possible you are calling an external C library when the error
occurs?

no, i m not calling any C lib.

7. If you think you've run out of main memory, is it possible to map/
reduce the problem in a lazy manner if you aren't already, or merge
results from smaller problem sets?

8. Reboot.

9. Is the problem repeatable on other hardware?


yes, it is.

10. Go to the bathroom and think about it some more. I do my best work
in the bathroom; it might help you, too.

Apart from these, I also tried these:-
1. I am calling GC explicitly.
2. I was passing heavy hash tables previously from one function to
other, i identified them and made them global.

Still...there is almost zero performance gain. :(

-Tushar
.



Relevant Pages

  • Re: Using C and Assembly code: 64Bit Calling convention
    ... compatible with its calling conventions. ... implementation of a function calling convention for a compilable high-level ... C99 Rationale specify the following: ... Binary Interface" and "System V Application Binary Interface x86-64 ...
    (comp.lang.asm.x86)
  • Re: Using C and Assembly code: 64Bit Calling convention
    ... compatible with its calling conventions. ... implementation of a function calling convention for a compilable high-level ... C99 Rationale specify the following: ... Binary Interface" and "System V Application Binary Interface x86-64 ...
    (comp.lang.asm.x86)
  • Re: Possible F77 Code Improvement ??
    ... the return variable SumKahan has the type realspecified (I ... With external procedures, the calling ... routine does *NOT* know anything about what the procedure actually looks ... you have to specify the type ...
    (comp.lang.fortran)
  • using LinePickup in TB20 - failed
    ... I assumed that I can ignore this one and specify NULL here. ... LinePickup, ... 4:47.37.139: Calling lineInitializeEx ... 4:48.2.756: lineOpen returned SUCCESS ...
    (microsoft.public.win32.programmer.tapi)
  • Re: Improve PageSetup code
    ... So for instance if all I want to do is to specify the right header then I ... Page.Setup in XL4. ... This is how I am calling on the Sub ... trying to limit the number of rows per page to 40, hence the TallPages ...
    (microsoft.public.excel.programming)