Coder Social home page Coder Social logo

Maximum call stack size exceeded about mincer HOT 14 CLOSED

js-kyle avatar js-kyle commented on September 1, 2024
Maximum call stack size exceeded

from mincer.

Comments (14)

ixti avatar ixti commented on September 1, 2024

Thanks for your report. Please, provide a minimal setup needed to reproduce an error (you can send me a zipball with assets and minimal mincer initilization that reproduces this error) so I could fix the problem quickly.

from mincer.

ixti avatar ixti commented on September 1, 2024

I believe that the problem could be resolved with one of the latest commits (there were some bugs in directive processor), if so, please close the ticket. If not, please, provide a minimal setup so I could reproduce an error (you may send it on my e-mail if it contains sensitive information)

from mincer.

vjpr avatar vjpr commented on September 1, 2024

Just updated to latest commit. Now I get Segmentation fault: 11.

Before it was just Served asset /application.js?body=1 - 500 Error compiling asset: Maximum call stack size exceeded (in /Users/v/dev/x/node/app/assets/javascripts/info.coffee) (585ms)

info.coffee is the last file I require.

I'll try create a project to reproduce the error.

from mincer.

vjpr avatar vjpr commented on September 1, 2024

Adding this line Mincer.unregisterPostProcessor 'application/javascript', Mincer.SafetyColons gets rid of the seg fault but still causes the max call stack error. However I don't think its related to SafetyColons, anything that decreases stack size could fix.

I'm using node 8.6. I'll try 8.8 now.

from mincer.

vjpr avatar vjpr commented on September 1, 2024

To fix we need to clear the stack using process.nextTick. I changed mincer/context.js#329 to process.nextTick(function(){callback(err, result);}); and it resolved it. Not sure if this is the best place for it performance-wise though.

from mincer.

puzrin avatar puzrin commented on September 1, 2024

Such dirty magic can not be accepted to upstream. Using nextTick() is very bad practice in most cases. Please, try to make minimalistic example, that will help to reproduce your problem.

from mincer.

vjpr avatar vjpr commented on September 1, 2024

I wouldn't say its that dirty. The problem is with async.forEachSeries.
There's a few people with similar issues from using async:

caolan/async#38

caolan/async#75

http://mwebhack.blogspot.com.au/2012/06/careful-with-synchronous-operations-in.html

To reproduce I expect a project with a lot (100+) files will cause it.

On Tue, Sep 11, 2012 at 3:50 PM, Vitaly Puzrin [email protected]:

Such dirty magic can not be accepted to upstream. Using nextTick() is very
bad practice in most cases. Please, try to make minimalistic example, that
will help to reproduce your problem.


Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-8447810.

from mincer.

vjpr avatar vjpr commented on September 1, 2024

Okay to reproduce:

In examples:

npm install coffee-script
cd assets/javascripts`
for i in {1..200}; do touch test$i.coffee; done

Note: Try increase the number of files if you don't get the error.

Then add //= require_tree . to assets/javascripts/app.js

node server.js

RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded

from mincer.

puzrin avatar puzrin commented on September 1, 2024

In your example //= require_tree . is recursive. It's evident. May be, mincer should better detect such situation, but basically, it's your bug.

from mincer.

vjpr avatar vjpr commented on September 1, 2024

Create a new directory with the test files called test.

Change directive to //= require_tree test

Error still there. require_directory is the same.

On Tue, Sep 11, 2012 at 4:14 PM, Vitaly Puzrin [email protected]:

In your example require_tree is recursive. It's evident. May be, mincer
should better detect such situation, but basically, it's your bug.


Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-8448142.

from mincer.

puzrin avatar puzrin commented on September 1, 2024

Yeah, i just did the same :) . 200 files are problem, 10 files are ok.

Now, back to real life. Is bug in your project caused by large number of included coffescripts, or by recursive require_tree (or smthng else)? We just need to clarify, where to dig first.

from mincer.

vjpr avatar vjpr commented on September 1, 2024

Large number of coffeescripts. The example was just for demonstration
purposes. My experience with this bug as detailed above points to the
problem being related to the number of files.

On Tue, Sep 11, 2012 at 4:29 PM, Vitaly Puzrin [email protected]:

Yeah, i just did the same :) . 200 files are problem, 10 files are ok.

Now, back to real life. Is bug in your project caused by large number of
coffescripts, or by reqursive require_tree ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-8448377.

from mincer.

vjpr avatar vjpr commented on September 1, 2024
 285 text files.
 283 unique files.
 328 files ignored.

http://cloc.sourceforge.net v 1.56 T=2.0 s (103.5 files/s, 41156.0 lines/s)

Language files blank comment

code

Javascript 76 9375 11218
40905
CSS 9 1519 102
9926
CoffeeScript 113 1505 1314
6321
SQL 8 5 7
111
YAML 1 0 0

4

SUM: 207 12404 12641

57267

On Tue, Sep 11, 2012 at 5:01 PM, Vaughan Rouesnel [email protected]:

Large number of coffeescripts. The example was just for demonstration
purposes. My experience with this bug as detailed above points to the
problem being related to the number of files.

On Tue, Sep 11, 2012 at 4:29 PM, Vitaly Puzrin [email protected]:

Yeah, i just did the same :) . 200 files are problem, 10 files are ok.

Now, back to real life. Is bug in your project caused by large number of
coffescripts, or by reqursive require_tree ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-8448377.

from mincer.

ixti avatar ixti commented on September 1, 2024

I'll try to fix it asap

from mincer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.