1

This ColdFusion will compile and run. And later causes a GC Limit.

<cfset theCount = 0++>

Results

{"status":500,"error":"Internal Server Error","message":"GC overhead limit exceeded","timeStamp":1570564484803,"path":null}

What is going on?

Ref: This code came from a comment on: count total records for each user

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
  • Submitted bug: https://tracker.adobe.com/#/view/CF-4205375 – James A Mohler Oct 08 '19 at 20:07
  • Out of curiosity, how large was the list you were looping over? – TRose Oct 08 '19 at 22:18
  • I am not looping over anything. I looked at the code on other question, and I wondered if it would work. I got unexpected results. – James A Mohler Oct 08 '19 at 22:25
  • If the code is meant to iterate, and it's not inside a finite loop, would it not stand to reason that it would just count up forever and crash the page? I don't understand why you'd just paste it anywhere and expect it to work. I'm having a brainfart. – TRose Oct 08 '19 at 22:26
  • I think I was confused. I think the code was intended to be pseudocode and it just happen to compile and run as is. I am thinking it is my misunderstanding and Adobe's bug. – James A Mohler Oct 08 '19 at 22:37
  • 1
    Yeah, if I were actually creating something like that it'd have to be `` and then inside the loop, `#theCount++#` - so it was actually my mistake for writing it that way. For what it's worth my CF2018 server acknowledges that it's a syntax error and it does not run. No GC message. So still a very interesting find. – TRose Oct 08 '19 at 22:40

1 Answers1

1

I don't think there is much interesting in this. It is a run time bug, but it should have been a compile time error. Hopefully Adobe will fix it.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72