Help with IR Receive Raw Code on ESP8266

When I run this code on an Arduino, there isn’t any issue at all, but not on the esp8266. On the Arduino, I could repeatedly receive long IR codes, one after another(one button press after another), without any issue. However on the esp8266, upon receiving usually the 3rd or 4th IR code, it crashes.

/*
Author: AnalysIR
Revision: 1.0

This code is provided to overcome an issue with Arduino IR libraries
It allows you to capture raw timings for signals longer than 255 marks & spaces.
Typical use case is for long Air conditioner signals.

You can use the output to plug back into IRremote, to resend the signal.

This Software was written by AnalysIR.

Usage: Free to use, subject to conditions posted on blog below.
Please credit AnalysIR and provide a link to our website/blog, where possible.

Copyright AnalysIR 2014

Please refer to the blog posting for conditions associated with use.
http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/

Connections:
IR Receiver      ESP8266
V+          ->  +5v
GND          ->  GND
Signal Out   ->  Digital Pin 14
(If using a 3V Arduino, you may connect V+ to +3V)
*/


//you may increase this value on Arduinos with greater than 2k SRAM
#define maxLen 500
#define receiverPin 14

volatile  unsigned int irBuffer[maxLen]; //stores timings - volatile because changed by ISR
volatile unsigned int x = 0; //Pointer thru irBuffer - volatile because changed by ISR

void setup() {
  Serial.begin(115200); //change BAUD rate as required
  attachInterrupt(receiverPin, rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
}

void loop() {
  // put your main code here, to run repeatedly:

  Serial.println("Press the button on the remote now - once only");
  delay(5000); // pause 5 secs
  if (x) { //if a signal is captured

    Serial.println();
    Serial.print("Raw: ("); //dump raw header format - for library
    Serial.print((x - 1));
    Serial.print(") ");
    detachInterrupt(receiverPin);//stop interrupts & capture until finshed here
    for (int i = 1; i < x; i++) { //now dump the times
      if (!(i & 0x1)) Serial.print("-");
      Serial.print(irBuffer[i] - irBuffer[i - 1]);
      Serial.print(", ");
    }
    x = 0;
    Serial.println();
    Serial.println();

    attachInterrupt(receiverPin, rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal
  }

}

void rxIR_Interrupt_Handler() {
  if (x > maxLen) return; //ignore if irBuffer is already full
  irBuffer[x++] = micros(); //just continually record the time-stamp of signal transitions

}

The esp8266 esp-12 is being externally powered by my bench power supply at 3.3v. The error details are inconsistent, for example from the sample below, it says “rst cause:4, boot mode:(1,6)”, but sometimes the rst cause is 2, and boot mode could be some other number. But from what it looks, is it a stack overflow/collision?

Exception (0):
epc1=0x40201bec epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys 
sp: 3ffffc30 end: 3fffffb0 offset: 01a0

>>>stack>>>
3ffffdd0:  40106b4c 00000020 00000019 000000f8  
3ffffde0:  ffffffff 00000020 00000001 00000000  
3ffffdf0:  00000000 40103d13 00000000 00000022  
3ffffe00:  3fffc200 40106b14 3fffc258 4000050c  
3ffffe10:  40004378 00000030 00000018 ffffffff  
3ffffe20:  60000200 00000008 24042403 80000000  
3ffffe30:  20000000 3fff0da0 80000000 200fc120  
3ffffe40:  80000000 3fffc6fc 3ffe8d9c 3fff0da4  
3ffffe50:  000001d4 000fc120 60000600 00000030  
3ffffe60:  00000119 40102b7d 00040000 40201c15  
3ffffe70:  40106bb0 00080000 00000000 40106b9a  
3ffffe80:  ffffffff 00000020 00000000 4000050c  
3ffffe90:  00000000 00000000 0000001f 4010103d  
3ffffea0:  4000050c 40106b14 3fffc258 4000050c  
3ffffeb0:  40000f68 00000030 0000001a ffffffff  
3ffffec0:  40000f58 00000000 00000020 00000000  
3ffffed0:  3fff0484 4021ab60 00000000 00000001  
3ffffee0:  ffffffff 3ffe9224 3ffe8d9c 3fffdab0  
3ffffef0:  00000000 3fffdcb0 3ffe8958 00000030  
3fffff00:  00000000 400042db 00000064 60000600  
3fffff10:  40004b31 3fff0c84 000002f4 000fc000  
3fffff20:  40101f6e 3ffe8930 3ffe90d0 40106fec  
3fffff30:  4021a62d 3ffe90d0 3ffe8930 2f101586  
3fffff40:  3fff0c84 00001000 4021aac6 00000008  
3fffff50:  40102360 00000000 4021ab73 3ffe9184  
3fffff60:  3ffe8930 01b531de 3ffe8930 60000600  
3fffff70:  402030d9 3ffe9184 3ffe8930 2f100466  
3fffff80:  4020311e 3fffdab0 00000000 3fffdcb0  
3fffff90:  3ffe8940 00000000 40000f65 3fffdab0  
3fffffa0:  40000f49 0001fbae 3fffdab0 40000f49  
<<<stack<<<

 ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset

 ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset

Hoping to get some insight.

Hoping to get some insight.

The esp8266 is NOT an Arduino. Not everything that the Arduino can do is expected to work the same on the esp8266. You should be asking about the not-really-an-Arduino on a more appropriate forum.