Inconsistent Stack Height 1 != 0 NULL

Posted June 17, 2008 at 8:44 AM by Ben Nadel

Tags: ColdFusion

Yesterday, I got a ColdFusion error that I had never seen before:

java.lang.VerifyError (class: cftest212ecfm1626437113, method: runPage signature: ()Ljava/lang/Object;) Inconsistent stack height 1 != 0 null

That's certainly an error that sounds really bad. But, after some tag-context debugging, it came down to a silly commenting mistake. I had something like this:

  • <!--- Pick a random number. --->
  • <cfswitch expression="#RandRange( 1, 2 )#">
  •  
  • <cfcase value="1">
  • <cfset WriteOutput( 1 ) />
  • </cfcase>
  •  
  • <cfcase value="2">
  • <cfset WriteOutput( 2 ) />
  • </cfcase>
  •  
  • <cfdefaultcase>
  •  
  • <cfswitch expression="#RandRange( 3, 4 )#">
  • <!---
  • I'll figure out these cases later. For now,
  • just leave in the top-level switch.
  • --->
  • </cfswitch>
  •  
  • </cfdefaultcase>
  •  
  • </cfswitch>

I had a CFSwitch statement inside of the CFDefaultCase of an outer CFSwitch statement. I had meant to comment out the nested CFSwitch statement, but accidentally, I commented out the nested CFCase statements only, leaving in the nested CFSwitch tag. My scenario was one of nesting, but if you have any ColdFusion CFSwitch tag that does not have any CFCase tags, you will get a similar error. For example, if I had a page that only had a CFSwitch statement, I get this error:

java.lang.VerifyError (class: cftest212ecfm1626437113, method: runPage signature: ()Ljava/lang/Object;) Inconsistent stack height 1 != 2

As you can see, this time it's (1 != 2) rather than (1 != 0), but other than that, it's the same error.



Reader Comments

Jun 17, 2008 at 9:29 AM // reply »
12 Comments

Hmmm, tried to reproduce it but couldnt. I am on CF 7 and just added a CFSWITCH statement without any cfcase. Got no errors.


Jun 17, 2008 at 9:30 AM // reply »
14 Comments

In FlexBuilder empty switch statement (without any case) gives:

An internal build error has occurred. Right-click for more information.

Without pointing out where the error exactly is. Nice :)


Jun 17, 2008 at 9:34 AM // reply »
10,743 Comments

@Anuj,

I am on ColdFusion 8.0.1. Maybe this is a new debugging message in CF8.


Jun 17, 2008 at 11:53 AM // reply »
12 Comments

@Ben, tried on CF8. No errors! You sure you got nothing else on the page that could have caused this error?


Jun 17, 2008 at 11:55 AM // reply »
10,743 Comments

@Anuj,

It must cause some errors!?!? There is no way in ColdFusion to have a CFSwitch statement that has nothing inside of it.... as far as I know.

There is nothing else on the page. I was able to reproduce in two pages.


Jun 17, 2008 at 12:25 PM // reply »
12 Comments

Right. I got the error this time but I had to wrap my code in a cftry/catch block. Then I got this Error 500 which you stated. As soon as I removed my cftry block, I only got an empty page. I didnt try to investigate why I got the empty page when I should be getting the error but yes, we cant have a cfswitch without a cfcase, point noted. :) thanks.


Jun 17, 2008 at 12:27 PM // reply »
10,743 Comments

@Anuj,

I guess CF8 just changes the error that is thrown or something.


Jun 17, 2008 at 12:29 PM // reply »
14 Comments

@Anuj: does it mean in yor case syntactic error may be just catched?


Jun 17, 2008 at 12:36 PM // reply »
14 Comments

No, obviosly no. Sorry... I see now where the problem is.


Don
Oct 8, 2009 at 3:20 PM // reply »
57 Comments

WOW! This time I just came right to your site. I had pretty much figured it out but checked anyway with a search for that error. Sure enuff, you had the exact same answer I had pretty much guessed at.
I am doing a project on MX 7 and I was just trying out a menu switch. I have 2 switches inside of cfif/else blocks. I just put cases in 1 of the switches and wanted to see how it looked and worked. I got that error.
Being the brainiac that I am, I guessed that it was the empty switch. So I put in a default case but that didn't help so I did my search here, found I was right, and refreshed again and it worked.
whew.


Oct 31, 2009 at 5:38 PM // reply »
10,743 Comments

@Don,

Empty cases are fun... as are empty SQL statements - another thing that gets interesting with lots of conditional logic.


Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
InVision App - Prototyping Made Beautiful With Prototyping Tools Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 16, 2012 at 8:18 PM
Best Of ColdFusion 10 Contest Entry - HTML Email Utility
Just found this, looks good! I'm trying to run it on local, it's the 64bit version and I'm experiencing horrible lag. On average the generate.cfm processes the content change in 60-90 seconds. I've ... read »
May 16, 2012 at 6:40 PM
Maintaining Sessions Across Multiple ColdFusion CFHttp Requests
I am trying to integrate this CFHTTPsession into an application that will log into zeekrewards.com to post ads and I am not having any luck. The code works perfectly for logging into other websites, ... read »
May 16, 2012 at 2:44 PM
Creating A Sometimes-Fixed-Position Element With jQuery
Thank you, very useful technique! Worked like a charm. ... read »
May 16, 2012 at 1:58 PM
Movies As A Religious Experience
Acting can, in a way, ruin the movie-goer's experience. I used to be able to get so caught up in movies and their plots, and totally engaged. But lately, I haven't been able to as much with a lot o ... read »
May 16, 2012 at 1:52 PM
The Science Of Optimal Post-Exercise Nutrition
children of this age eat very less vegetables so u can opt for salads they will like it also carrot ,cucumber,onion and as far as pulses are concerned u can boil them ,give him along with mashed rice ... read »
May 16, 2012 at 1:34 PM
Strange ColdFusion JRUN Stack Overflow Error
Hey, Recently I updated my jrun4 using the latest updater 7 and now i am having memory issues :(:(:( any help is appreciated ... read »
May 16, 2012 at 9:56 AM
ColdFusion 10 Beta, Apache Tomcat, And Symbolic Links On Mac OSX
Hi, Now that ColdFusion 10 is out I have stumbled over this as well and I cannot figure out the proper solution. We're running virtual hosts via Apache2; the ColdFusion-applications store their fil ... read »
May 15, 2012 at 6:03 PM
Movies As A Religious Experience
@Ben, I don't know whether you'd consider this a religious observation, but it seems to me, in a sense, movies multiply how many lives we get to have. Each movie is like a little extra life we get ... read »