RangeError: Maximum call stack size exceeded

389 views
Skip to first unread message

klrumpf

unread,
Dec 5, 2013, 1:44:44 PM12/5/13
to zap...@googlegroups.com
HI,

I currently have all the stuff for the website in one big zappa coffeescript file with views in line, developing on 2 GB RAM

PROD# uname -r
3.2.0-4-amd64

I'm not runing an infinite loop or anything like that that I am aware of.

What's the most intelligent workaround for this? Any way to increase the stack for compile time?

Seems to be connected with (hidden) input fields in the view, got worse with csrf use.

How do I call views in the /views folder instead of @view... inline?

Thanks and a nice evening


****************

nodemon xyz.coffee ....

RangeError: Maximum call stack size exceeded
    at Call.exports.Call.Call.compileNode (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:949:27)
    at Call.exports.Base.Base.compileToFragments (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:83:21)
    at Block.exports.Block.Block.compileNode (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:366:28)
    at Block.exports.Block.Block.compileWithDeclarations (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:459:19)
    at Block.exports.Block.Block.compileRoot (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:431:24)
    at Block.exports.Block.Block.compileToFragments (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:348:21)
    at exports.compile.compile (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:35:61)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:100:16)
    at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:171:29)
    at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:143:18
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)
5 Dec 18:12:50 - [nodemon] app crashed - waiting for file changes before starting...


*********

with /usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:949:27 ...

946         if (argIndex) {
 947           compiledArgs.push(this.makeCode(", "));
 948         }
 949         compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEV
     EL_LIST));
 950       }
 951       fragments = [];
 952       if (this.isSuper) {




*********
PROD# lshw

    description: Computer
    product: D2461-C1 ()
    vendor: FUJITSU SIEMENS
    width: 64 bits
    capabilities: smbios-2.4 dmi-2.4 vsyscall32
    configuration: boot=normal uuid=00000000-0000-0000-0000-0019992307A1
  *-core
       description: Motherboard
       product: D2461-C1
       vendor: FUJITSU SIEMENS
       physical id: 0
       version: S26361-D2461-C1
       serial: 27352871
     *-firmware
          description: BIOS
          vendor: FUJITSU SIEMENS // Phoenix Technologies Ltd.
          physical id: 0
          version: 6.00 R1.14.2461.C1
          date: 05/22/2007
          size: 102KiB
          capacity: 448KiB
          capabilities: pci pnp upgrade shadowing escd cdboot bootselect int13floppynec int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer int10video acpi usb ls120boot zipboot biosbootspecification
     *-cpu
          description: CPU
          product: AMD Athlon(tm) 64 X2 Dual Core Processor 4400+
          vendor: Advanced Micro Devices [AMD]
          physical id: 4
          bus info: cpu@0
          version: AMD
          slot: Socket AM2
          size: 2300MHz
          capacity: 2300MHz
          width: 64 bits
          clock: 133MHz
          capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp x86-64 3dnowext 3dnow rep_good nopl extd_apicid pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch lbrv cpufreq
        *-cache:0
             description: L1 cache
             physical id: 5
             slot: L1 Cache
             size: 64KiB
             capacity: 64KiB
             capabilities: asynchronous internal write-back
        *-cache:1
             description: L2 cache
             physical id: 6
             slot: L2 Cache
             size: 1MiB
             capabilities: synchronous internal write-through unified
     *-memory:0
          description: System Memory
          physical id: 20
          slot: System board or motherboard
          size: 2GiB
        *-bank:0
             description: DIMM DDR2 Synchronous 133 MHz (7,5 ns)
             physical id: 0
             slot: Slot-1
             size: 512MiB
             width: 64 bits
             clock: 133MHz (7.5ns)
        *-bank:1
             description: DIMM DDR2 Synchronous 133 MHz (7,5 ns)
             physical id: 1
             slot: Slot-2
             size: 512MiB
             width: 64 bits
             clock: 133MHz (7.5ns)
        *-bank:2
             description: DIMM DDR2 Synchronous 133 MHz (7,5 ns)
             physical id: 2
             slot: Slot-3
             size: 512MiB
             width: 64 bits
             clock: 133MHz (7.5ns)
        *-bank:3
             description: DIMM DDR2 Synchronous 133 MHz (7,5 ns)
             physical id: 3
             slot: Slot-4
             size: 512MiB
             width: 64 bits
             clock: 133MHz (7.5ns)
     *-memory:1 UNCLAIMED
          description: RAM memory
          product: C51 Host Bridge
          vendor: NVIDIA Corporation
          physical id: 1
          bus info: pci@0000:00:00.0
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          capabilities: ht bus_master cap_list
          configuration: latency=0
     *-memory:2 UNCLAIMED
          description: RAM memory
          product: C51 Memory Controller 0
          vendor: NVIDIA Corporation
          physical id: 0.1
          bus info: pci@0000:00:00.1
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          configuration: latency=0
     *-memory:3 UNCLAIMED
          description: RAM memory
          product: C51 Memory Controller 1
          vendor: NVIDIA Corporation
          physical id: 0.2
          bus info: pci@0000:00:00.2
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          configuration: latency=0
     *-memory:4 UNCLAIMED
          description: RAM memory
          product: C51 Memory Controller 5
          vendor: NVIDIA Corporation
          physical id: 0.3
          bus info: pci@0000:00:00.3
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          configuration: latency=0
     *-memory:5 UNCLAIMED
          description: RAM memory
          product: C51 Memory Controller 4
          vendor: NVIDIA Corporation
          physical id: 0.4
          bus info: pci@0000:00:00.4
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          capabilities: bus_master
          configuration: latency=0
     *-memory:6 UNCLAIMED
          description: RAM memory
          product: C51 Host Bridge
          vendor: NVIDIA Corporation
          physical id: 0.5
          bus info: pci@0000:00:00.5
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          capabilities: bus_master cap_list
          configuration: latency=0
     *-memory:7 UNCLAIMED
          description: RAM memory
          product: C51 Memory Controller 3
          vendor: NVIDIA Corporation
          physical id: 0.6
          bus info: pci@0000:00:00.6
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          configuration: latency=0
     *-memory:8 UNCLAIMED
          description: RAM memory
          product: C51 Memory Controller 2
          vendor: NVIDIA Corporation
          physical id: 0.7
          bus info: pci@0000:00:00.7
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          configuration: latency=0
     *-pci:0
          description: PCI bridge
          product: C51 PCI Express Bridge
          vendor: NVIDIA Corporation
          physical id: 2
          bus info: pci@0000:00:02.0
          version: a1
          width: 32 bits
          clock: 33MHz
          capabilities: pci pm msi ht pciexpress normal_decode bus_master cap_list
          configuration: driver=pcieport
          resources: irq:40
     *-pci:1
          description: PCI bridge
          product: C51 PCI Express Bridge
          vendor: NVIDIA Corporation
          physical id: 3
          bus info: pci@0000:00:03.0
          version: a1
          width: 32 bits
          clock: 33MHz
          capabilities: pci pm msi ht pciexpress normal_decode bus_master cap_list
          configuration: driver=pcieport
          resources: irq:41
     *-display
          description: VGA compatible controller
          product: C51 [GeForce 6150 LE]
          vendor: NVIDIA Corporation
          physical id: 5
          bus info: pci@0000:00:05.0
          version: a2
          width: 64 bits
          clock: 66MHz
          capabilities: pm msi vga_controller bus_master cap_list rom
          configuration: driver=nouveau latency=0
          resources: irq:19 memory:f1000000-f1ffffff memory:e0000000-efffffff memory:f0000000-f0ffffff memory:80000000-8001ffff
     *-memory:9 UNCLAIMED
          description: RAM memory
          product: MCP51 Host Bridge
          vendor: NVIDIA Corporation
          physical id: 9
          bus info: pci@0000:00:09.0
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          capabilities: ht bus_master cap_list
          configuration: latency=0
     *-isa
          description: ISA bridge
          product: MCP51 LPC Bridge
          vendor: NVIDIA Corporation
          physical id: a
          bus info: pci@0000:00:0a.0
          version: a3
          width: 32 bits
          clock: 66MHz
          capabilities: isa bus_master
          configuration: latency=0
          resources: ioport:8800(size=128)
     *-serial
          description: SMBus
          product: MCP51 SMBus
          vendor: NVIDIA Corporation
          physical id: a.1
          bus info: pci@0000:00:0a.1
          version: a3
          width: 32 bits
          clock: 66MHz
          capabilities: pm cap_list
          configuration: driver=nForce2_smbus latency=0
          resources: irq:10 ioport:88c0(size=64) ioport:8880(size=64)
     *-usb:0
          description: USB controller
          product: MCP51 USB Controller
          vendor: NVIDIA Corporation
          physical id: b
          bus info: pci@0000:00:0b.0
          version: a3
          width: 32 bits
          clock: 66MHz
          capabilities: pm ohci bus_master cap_list
          configuration: driver=ohci_hcd latency=0 maxlatency=1 mingnt=3
          resources: irq:23 memory:f2200000-f2200fff
     *-usb:1
          description: USB controller
          product: MCP51 USB Controller
          vendor: NVIDIA Corporation
          physical id: b.1
          bus info: pci@0000:00:0b.1
          version: a3
          width: 32 bits
          clock: 66MHz
          capabilities: debug pm ehci bus_master cap_list
          configuration: driver=ehci_hcd latency=0 maxlatency=1 mingnt=3
          resources: irq:22 memory:f2203000-f22030ff
     *-ide:0
          description: IDE interface
          product: MCP51 IDE
          vendor: NVIDIA Corporation
          physical id: d
          bus info: pci@0000:00:0d.0
          version: f1
          width: 32 bits
          clock: 66MHz
          capabilities: ide pm bus_master cap_list
          configuration: driver=pata_amd latency=0 maxlatency=1 mingnt=3
          resources: irq:0 ioport:1f0(size=8) ioport:3f6 ioport:170(size=8) ioport:376 ioport:8c00(size=16)
     *-ide:1
          description: IDE interface
          product: MCP51 Serial ATA Controller
          vendor: NVIDIA Corporation
          physical id: e
          bus info: pci@0000:00:0e.0
          logical name: scsi0
          logical name: scsi1
          version: f1
          width: 32 bits
          clock: 66MHz
          capabilities: ide pm msi ht bus_master cap_list emulated
          configuration: driver=sata_nv latency=0 maxlatency=1 mingnt=3
          resources: irq:20 ioport:8c30(size=8) ioport:8c24(size=4) ioport:8c28(size=8) ioport:8c20(size=4) ioport:8c10(size=16) memory:f2201000-f2201fff
        *-disk:0
             description: ATA Disk
             product: ST3250310AS
             vendor: Seagate
             physical id: 0
             bus info: scsi@0:0.0.0
             logical name: /dev/sda
             version: 3.AA
             serial: 9RY2NXEK
             size: 232GiB (250GB)
             capabilities: partitioned partitioned:dos
             configuration: ansiversion=5 sectorsize=512 signature=71c666cf
           *-volume:0
                description: EXT3 volume
                vendor: Linux
                physical id: 1
                bus info: scsi@0:0.0.0,1
                logical name: /dev/sda1
                version: 1.0
                serial: c17b8447-ef7a-49e0-9680-1494e007a456
                size: 3820MiB
                capacity: 3820MiB
                capabilities: primary multi journaled extended_attributes large_files recover ext3 ext2 initialized
                configuration: created=2011-01-16 15:56:03 filesystem=ext3 label=root modified=2013-11-08 09:45:06 mounted=2013-11-16 10:18:35 state=clean
           *-volume:1
                description: Linux swap volume
                physical id: 2
                bus info: scsi@0:0.0.0,2
                logical name: /dev/sda2
                version: 1
                serial: 6185fef2-0e65-474d-bd94-588886fede4b
                size: 1913MiB
                capacity: 1913MiB
                capabilities: primary nofs swap initialized
                configuration: filesystem=swap pagesize=4096
           *-volume:2
                description: Linux raid autodetect partition
                physical id: 3
                bus info: scsi@0:0.0.0,3
                logical name: /dev/sda3
                serial: QNWLwU-Gtae-wGz2-M377-0r7p-wgfI-GIP7f1
                size: 227GiB
                capacity: 227GiB
                capabilities: primary multi lvm2
        *-disk:1
             description: ATA Disk
             product: ST3250310AS
             vendor: Seagate
             physical id: 1
             bus info: scsi@1:0.0.0
             logical name: /dev/sdb
             version: 3.AA
             serial: 9RY2K53H
             size: 232GiB (250GB)
             capabilities: partitioned partitioned:dos
             configuration: ansiversion=5 sectorsize=512 signature=abb19cfd
           *-volume:0
                description: EXT3 volume
                vendor: Linux
                physical id: 1
                bus info: scsi@1:0.0.0,1
                logical name: /dev/sdb1
                version: 1.0
                serial: c17b8447-ef7a-49e0-9680-1494e007a456
                size: 3820MiB
                capacity: 3820MiB
                capabilities: primary multi journaled extended_attributes large_files recover ext3 ext2 initialized
                configuration: created=2011-01-16 15:56:03 filesystem=ext3 label=root modified=2013-11-08 09:45:06 mounted=2013-11-16 10:18:35 state=clean
           *-volume:1
                description: Linux swap volume
                physical id: 2
                bus info: scsi@1:0.0.0,2
                logical name: /dev/sdb2
                version: 1
                serial: bc032870-60b8-4840-b8f6-bead3b1dce5b
                size: 1913MiB
                capacity: 1913MiB
                capabilities: primary nofs swap initialized
                configuration: filesystem=swap pagesize=4096
           *-volume:2
                description: Linux raid autodetect partition
                physical id: 3
                bus info: scsi@1:0.0.0,3
                logical name: /dev/sdb3
                serial: QNWLwU-Gtae-wGz2-M377-0r7p-wgfI-GIP7f1
                size: 227GiB
                capacity: 227GiB
                capabilities: primary multi lvm2
     *-pci:2
          description: PCI bridge
          product: MCP51 PCI Bridge
          vendor: NVIDIA Corporation
          physical id: 10
          bus info: pci@0000:00:10.0
          version: a2
          width: 32 bits
          clock: 66MHz
          capabilities: pci ht subtractive_decode bus_master cap_list
     *-network
          description: Ethernet interface
          product: MCP51 Ethernet Controller
          vendor: NVIDIA Corporation
          physical id: 14
          bus info: pci@0000:00:14.0
          logical name: eth0
          version: a3
          serial: 00:19:99:23:07:a1
          size: 100Mbit/s
          capacity: 1Gbit/s
          width: 32 bits
          clock: 66MHz
          capabilities: pm bus_master cap_list ethernet physical mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
          configuration: autonegotiation=on broadcast=yes driver=forcedeth driverversion=0.64 duplex=full ip=87.106.225.50 latency=0 link=yes maxlatency=20 mingnt=1 multicast=yes port=MII speed=100Mbit/s
          resources: irq:21 memory:f2202000-f2202fff ioport:8c38(size=8)
     *-pci:3
          description: Host bridge
          product: K8 [Athlon64/Opteron] HyperTransport Technology Configuration
          vendor: Advanced Micro Devices [AMD]
          physical id: 100
          bus info: pci@0000:00:18.0
          version: 00
          width: 32 bits
          clock: 33MHz
     *-pci:4
          description: Host bridge
          product: K8 [Athlon64/Opteron] Address Map
          vendor: Advanced Micro Devices [AMD]
          physical id: 101
          bus info: pci@0000:00:18.1
          version: 00
          width: 32 bits
          clock: 33MHz
     *-pci:5
          description: Host bridge
          product: K8 [Athlon64/Opteron] DRAM Controller
          vendor: Advanced Micro Devices [AMD]
          physical id: 102
          bus info: pci@0000:00:18.2
          version: 00
          width: 32 bits
          clock: 33MHz
     *-pci:6
          description: Host bridge
          product: K8 [Athlon64/Opteron] Miscellaneous Control
          vendor: Advanced Micro Devices [AMD]
          physical id: 103
          bus info: pci@0000:00:18.3
          version: 00
          width: 32 bits
          clock: 33MHz
          configuration: driver=k8temp
          resources: irq:0



step...@shimaore.net

unread,
Dec 5, 2013, 3:22:28 PM12/5/13
to zap...@googlegroups.com
> How do I call views in the /views folder instead of @view... inline?

Save them as 'views/<view-name>.coffee' I'd expect.

> RangeError: Maximum call stack size exceeded<br>
> 5 Dec 18:12:50 - [nodemon] app crashed - waiting for file changes before starting...

Couple questions:

- does this happen when you do:

coffee -c xyz.coffee

(this could indicate a limitation with the coffeescript parser)

- does this happen when you split your large coffee file into smaller
chunks and use:

@include 'chunk1.coffee'

to load the chunks?

S.

--
St�phane Alnet -- Telecom Artisan. OpenSource Advocate.
Development and integration for FreeSwitch, OpenSIPS, CouchDB, Node.js.
Mobile: +33643482771 - http://shimaore.net/ - https://github.com/shimaore/

klrumpf

unread,
Dec 5, 2013, 3:31:04 PM12/5/13
to zap...@googlegroups.com


- does this happen when you do:

    coffee -c xyz.coffee

No, compile goes through it seems , it happens just when I do the whole shebang for ex with "nodemon budeso.coffee" etc,
it is unimpressed if I increase --max-stack-size etc

if I unplug a couple of @views or "#" out some hidden input it gets by again


      @include 'chunk1.coffee'

  to load the chunks?

Will try that and come back, cheers

Body Wrappers Angelo Luzio Europe and Australia
New: The Energy Dance Catalogue 2013-2014 at www.BodyWrappers.net



On 05/12/13 21:22, step...@shimaore.net wrote:

step...@shimaore.net

unread,
Dec 5, 2013, 3:38:40 PM12/5/13
to zap...@googlegroups.com
> if I unplug a couple of @views or "#" out some hidden input it
> gets by again

Really weird. I mean, the 'stack size' symptom would indicate too deep a
recursion or something like that. Can you trim down and give us an
example that still exhibits the issues, for example with a simple

@get '/': ->
@render 'test'

@view 'test': ->
input type:'hidden', name:'foo', value:'bar'

that crashes?


Also I meant to ask you whether the issue happened when using 'coffee'
instead of 'nodemon' (to isolate any nodemon-specific handling).

klrumpf

unread,
Dec 5, 2013, 4:09:27 PM12/5/13
to zap...@googlegroups.com
Thanks, Stephane, it also happens with 'coffee' exactly the same.

The whole application is quite big because it requires a very boilerplatish
approach, uploading big excel files with data, loading them into mysql,
(node-mysql) and presenting the results with coffeecup and offering editing
functionality etc which is where the many (different) views & inputs come from.

So a small example will not produce the error, the whole thing has just hit
some size limit. Apart from that it is all very stable, part already ran in presentations
at the customers location and another smaller version has been up for a year.
A very nice tool, Zappa.

I'll put together a brief example of the general way these routines are build, maybe
I'm doing something stupid somewhere,  but I can't see any runaway recursion, using
the same patterns everywhere. I also cleaned up some global routines I'm not
using but that should not much affect compile time?

Have a nice evening!   Karl

On 05/12/13 21:38, step...@shimaore.net wrote:

klrumpf

unread,
Dec 5, 2013, 5:53:51 PM12/5/13
to zap...@googlegroups.com
Hi again,

looks like increasing --stack_size (from the V8 options) instead of --max-stack-size solves it

stumbled over this.  https://code.google.com/p/v8/issues/detail?id=2896


PROD$ nodemon --nodejs --stack_size=2000 main.coffee
5 Dec 23:37:20 - [nodemon] v0.7.10
5 Dec 23:37:20 - [nodemon] to restart at any time, enter `rs`
5 Dec 23:37:20 - [nodemon] watching: /home/userpt18z97/proj10
5 Dec 23:37:20 - [nodemon] starting `coffee --nodejs --stack_size=2000 main.coffee`
Port          :  3034
NODE_ENV      :  development
Zappa version :  0.4.22
Node Version  :  0.10.21
Last change   :  04-12-2013
LANG          :  es_ES.UTF-8  (must be es_ES.UTF-8)
OS            :  linux
WARNING       :  TESTING = TRUE !!
Express server listening on port 3034 in development mode
Zappa 0.4.22 "You can't do that on stage anymore" orchestrating the show

VS

PROD$ nodemon main.coffee
5 Dec 23:49:40 - [nodemon] v0.7.10
5 Dec 23:49:40 - [nodemon] to restart at any time, enter `rs`
5 Dec 23:49:40 - [nodemon] watching: /home/userpt18z97/proj10
5 Dec 23:49:40 - [nodemon] starting `coffee main.coffee`

RangeError: Maximum call stack size exceeded
    at Call.exports.Call.Call.compileNode (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:949:27)
    at Call.exports.Base.Base.compileToFragments (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:83:21)
    at Block.exports.Block.Block.compileNode (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:366:28)
    at Block.exports.Block.Block.compileWithDeclarations (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:459:19)
    at Block.exports.Block.Block.compileRoot (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:431:24)
    at Block.exports.Block.Block.compileToFragments (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:348:21)
    at exports.compile.compile (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:35:61)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:100:16)
    at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:171:29)
    at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:143:18
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)
5 Dec 23:50:13 - [nodemon] app crashed - waiting for file changes before starting...

Thanks again, Karl


On 05/12/13 21:38, step...@shimaore.net wrote:
Reply all
Reply to author
Forward
0 new messages