Strange error on Android: Consumer closed input channel or an error occurred. Channel is unrecoverably broken and will be disposed!

Hi !

I have got the following (very simple) code in my app:

CCLabelTTF *playLabel = CCLabelTTF::labelWithString("Play", CCSizeMake(166.0f, 60.0f),CCTextAlignmentCenter, "MarkerFelt.ttf",  50);
CCMenuItemLabel * playItem = CCMenuItemLabel::itemWithLabel(playLabel, this, menu_selector(IntroMenu::playClic));

When I click on this button, it works perfectly well:

  • when I run the app on a iDevice
  • on an Android device if I use Cocos2d-x SDK.10 and NDK r7b

But the app crashes when I click on the button if I run on Android device with Cocos2d-x SDK.11 (and NDK r7b).

Just get the following messages in LogCat:

02-28 22:35:49.060: E/InputDispatcher(290): channel '41b45750 com.ag.games.js/com.ag.games.js.TestsDemo (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
02-28 22:35:49.060: E/InputDispatcher(290): channel '41b45750 com.ag.games.js/com.ag.games.js.TestsDemo (server)' ~ Channel is unrecoverably broken and will be disposed!

Any idea from where this bug comes ?

Thanks !

I have same error on screen touch with HelloWorld example. Same config as above.

You are right ! The crash also happens on helloworld sample… Nevertheless, it is not just when you touch the screen but when you touch the button at the bottom right corner of the screen (red crosses with the image named CloseSelected.png) that the app crashes. This button has a similar code to the code I gave in my initial post. And this bug has been reported here: http://www.cocos2d-x.org/boards/10/topics/8618

Anybody from the cocos2d-x team can tell us what is happening? Thanks

Well I’m testing on the emulator (2.3.3) as well as android x86 virtual machine (2.3.7) and it happens every time I touch (click) the screen.

Hum…actually, I think that I concluded a little bit too fast concerning the case of the helloworld sample. Indeed, I forgot that the goal of this button is to close the app :). So, it launches the menuCloseCallback method where it is written “CCDirector::sharedDirector()->end();”… Consequently, it is normal that the app closes and also probably normal that the messages “Consumer closed input channel or an error occurred. ~ Channel is unrecoverably broken and will be disposed!” appear in the LogCat…

I replaced the code in menuCloseCallback method by just CCLog(“HelloWorld::menuCloseCallback”); and I can see that the method can be called several times without crashing the app.

Are you sure that you really have a crash ? Or is it the normal behaviour ?

To conclude:

Thanks to tell us if you really have a crash and if it happens when you click anywhere on the screen.

Upon further investigation with git version it turned out that error occurs only on emulator while clicking close button. On x86 vm everything goes well.

I have same error on screen touch anywhere. Same config as above(Cocos2d-x SDK.11 and NDK r7b).

03-04 10:58:07.851: E/InputDispatcher(61): channel '406ce330 com.cgc.xzdd/com.cgc.xzdd.XZDD (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
03-04 10:58:07.851: E/InputDispatcher(61): channel '406ce330 com.cgc.xzdd/com.cgc.xzdd.XZDD (server)' ~ Channel is unrecoverably broken and will be disposed!

If change to Cocos2d-x SDK.10 and NDK r7b, the problem still exists.

Git version doesn’t test yet.

I test with HelloWorld sample, if Cocos2d-x SDK.11 and NDK r7b, also crash,
but with Cocos2d-x SDK.11 and NDK r6b, it is normal.
For my game code, crash problem always exist, even it cann’t go into the game UI, once you open it will exit automatically.

03-04 21:27:07.225: I/DEBUG(8257):     451da904  805900d8  /data/data/com.cgc.xzdd/lib/libcocos2d.so
03-04 21:27:07.225: I/DEBUG(8257):     451da908  805900d8  /data/data/com.cgc.xzdd/lib/libcocos2d.so
03-04 21:27:07.225: I/DEBUG(8257):     451da90c  00000000  
03-04 21:27:07.225: I/DEBUG(8257):     451da910  00000000  
03-04 21:27:07.225: I/DEBUG(8257):     451da914  804e7b61  /data/data/com.cgc.xzdd/lib/libcocos2d.so
03-04 21:27:07.757: D/dalvikvm(2103): GC_CONCURRENT freed 1054K, 47% free 7142K/13319K, external 0K/0K, paused 8ms+21ms
03-04 21:27:08.835: D/dalvikvm(2103): GC_EXPLICIT freed 58K, 47% free 7096K/13319K, external 0K/0K, paused 100ms
03-04 21:27:09.202: I/BootReceiver(2103): Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
03-04 21:27:09.218: E/InputDispatcher(2103): channel '40b83c20 com.cgc.xzdd/com.cgc.xzdd.ChinaGameXZDD (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
03-04 21:27:09.218: E/InputDispatcher(2103): channel '40b83c20 com.cgc.xzdd/com.cgc.xzdd.ChinaGameXZDD (server)' ~ Channel is unrecoverably broken and will be disposed!
03-04 21:27:09.218: D/Zygote(1900): Process 8344 terminated by signal (11)
03-04 21:27:09.233: I/WindowManager(2103): WIN DEATH: Window{40a2ee48 com.cgc.xzdd/com.cgc.xzdd.ChinaGameXZDD paused=false}
03-04 21:27:09.241: I/ActivityManager(2103): Process com.cgc.xzdd (pid 8344) has died.
03-04 21:27:09.249: I/WindowManager(2103): WIN DEATH: Window{40b83c20 com.cgc.xzdd/com.cgc.xzdd.ChinaGameXZDD paused=false}
03-04 21:27:09.264: I/WindowManager(2103): WIN DEATH: Window{40c3b628 SurfaceView paused=false}
03-04 21:27:09.358: D/dalvikvm(2103): GC_CONCURRENT freed 824K, 45% free 7380K/13319K, external 0K/0K, paused 4ms+7ms
03-04 21:27:09.374: I/WindowManager(2103): WIN DEATH: Window{40b90308 com.cgc.xzdd/com.cgc.xzdd.ChinaGameXZDD paused=false}
03-04 21:27:09.413: I/WindowManager(2103): Setting rotation to 0, animFlags=1
03-04 21:27:09.436: I/ActivityManager(2103): Config changed: { scale=1.0 fontSize=2 themeChanged=0 themeChangedFlags=0 imsi=460/2 loc=zh_CN touch=3 keys=1/1/2 nav=1/2 orien=1 layout=34 uiMode=17 seq=106}

Please help me!

fixed, because I made mistake the image resource name.