Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Memory fault from (APPLY 'APPEND LIST)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Benjamin Lambert  
View profile  
 More options Oct 19 2012, 4:31 pm
From: Benjamin Lambert <benlamb...@cmu.edu>
Date: Fri, 19 Oct 2012 16:31:46 -0400
Local: Fri, Oct 19 2012 4:31 pm
Subject: [Sbcl-help] Memory fault from (APPLY 'APPEND LIST)
Hi there,

I've been a bit puzzled the last few days about a memory fault I've been getting.  It turns out to be the control stack getting exhausted, but the error I have been getting is simply a "memory fault".  I thought I should share this, in case it's possible to print that the error is a control stack problem, rather than the more vague "memory fault" error.

It took me a while of adding numerous print-outs to my code to find the error, but it turned out to be coming from this form, which appends a list of lists:
(apply 'append list-of-lists)

Before I discovered that it was a control stack size issue (which SBCL on my Mac is now showing), I tried this instead, which doesn't cause the error:
(apply 'concatenate 'list list-of-lists)

The list of lists is length 100,000.  So, it's easy to reproduce this with (or increase the 100,000 to be big enough to fill the control stack):
(apply 'append (make-list 100000 :initial-element '()))

It makes sense that this would exhaust the stack.  (I am aware of how to increase the stack size with --control-stack-size).

On Linux (and sometimes on Mac), I get the error:
CORRUPTION WARNING in SBCL pid 16130(tid 140737353885424):
Memory fault at f293d040 (pc=0x100050d041, sp=0x7ffff293d040)
The integrity of this image is possibly compromised.
Exiting.

Previously, I was getting the same error on Mac, but now I'm getting a control stack exhausted error:
fatal error encountered in SBCL pid 91825:
Control stack exhausted

This is SBCL 1.0.55 on Mac, and 1.1.0 on Linux (x86-64).

So, I suppose my questions are:

1)  Does it make sense that APPEND exhausts the stack, but CONCATENATE doesn't?

2)  Is it possible to catch the error and report it as "control stack exhausted" rather than simply as a "memory fault"?

Thanks,
Ben

Benjamin Lambert
Ph.D. Student of Computer Science
Carnegie Mellon University
www.cs.cmu.edu/~belamber

--------------------------------------------------------------------------- ---
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Sbcl-help mailing list
Sbcl-h...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stas Boukarev  
View profile  
 More options Oct 19 2012, 5:46 pm
From: Stas Boukarev <stass...@gmail.com>
Date: Sat, 20 Oct 2012 01:45:17 +0400
Local: Fri, Oct 19 2012 5:45 pm
Subject: Re: [Sbcl-help] Memory fault from (APPLY 'APPEND LIST)

You shouldn't ever use APPLY on an arbitrary number of arguments. Use
reduce instead:

(reduce #'append list-of-lists :from-end t)

(from-end helps minimize consing, because append always has to copy the
first list, that way the first list doesn't become larger with each
iteration)

--
With best regards, Stas.

--------------------------------------------------------------------------- ---
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Sbcl-help mailing list
Sbcl-h...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stas Boukarev  
View profile  
 More options Oct 19 2012, 5:52 pm
From: Stas Boukarev <stass...@gmail.com>
Date: Sat, 20 Oct 2012 01:52:08 +0400
Local: Fri, Oct 19 2012 5:52 pm
Subject: Re: [Sbcl-help] Memory fault from (APPLY 'APPEND LIST)

And as to the error you're seeing, there's a bug ticket:
https://bugs.launchpad.net/sbcl/+bug/484143
--
With best regards, Stas.

--------------------------------------------------------------------------- ---
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Sbcl-help mailing list
Sbcl-h...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benjamin Lambert  
View profile  
 More options Oct 20 2012, 12:32 am
From: Benjamin Lambert <benlamb...@cmu.edu>
Date: Sat, 20 Oct 2012 00:31:22 -0400
Local: Sat, Oct 20 2012 12:31 am
Subject: Re: [Sbcl-help] Memory fault from (APPLY 'APPEND LIST)

>> 2)  Is it possible to catch the error and report it as "control stack exhausted" rather than simply as a "memory fault"?
> And as to the error you're seeing, there's a bug ticket:
> https://bugs.launchpad.net/sbcl/+bug/484143

Ahh, I see.  Thanks Stas.  And thanks especially about the tip to use REDUCE rather than APPLY!  Now why didn't I think of that...  duh.

Best,
Ben

> --
> With best regards, Stas.

--------------------------------------------------------------------------- ---
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Sbcl-help mailing list
Sbcl-h...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Faré  
View profile  
 More options Oct 20 2012, 9:32 am
From: Faré <fah...@gmail.com>
Date: Sat, 20 Oct 2012 09:30:13 -0400
Local: Sat, Oct 20 2012 9:30 am
Subject: Re: [Sbcl-help] Memory fault from (APPLY 'APPEND LIST)
On Sat, Oct 20, 2012 at 12:31 AM, Benjamin Lambert <benlamb...@cmu.edu> wrote:
>>> 2)  Is it possible to catch the error and report it as "control stack exhausted" rather than simply as a "memory fault"?
>> And as to the error you're seeing, there's a bug ticket:
>> https://bugs.launchpad.net/sbcl/+bug/484143

> Ahh, I see.  Thanks Stas.  And thanks especially about the tip to use REDUCE rather than APPLY!  Now why didn't I think of that...  duh.

Because you didn't read the Google Common Lisp Style Guide.
https://google-styleguide.googlecode.com/svn/trunk/lispguide.xml

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
The penalty for laughing in a courtroom is six months in jail; if it
were not for this penalty, the jury would never hear the evidence.
                — H. L. Mencken

--------------------------------------------------------------------------- ---
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Sbcl-help mailing list
Sbcl-h...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »