NO

Author Topic: Pelles - Console Crash - User Input  (Read 4803 times)

Armin

  • Guest
Pelles - Console Crash - User Input
« on: March 12, 2013, 06:44:57 PM »
After using Pelles IDE for about a month without any problems i stumbled upon this. ( using windows 7 pro)

When running a console application that reads user input ( getc,fgetc,getchar,scanf,fgets...) of any kind the program crashes after return key was pressed 58 times, in other words after 58 times the input was send( in total program lifespan) from console.
When i compile the >same< program and run it via running .exe everything is ok. No crash. Other IDEs work normally, this only occurs with Pelles.

Crash description: Debug shows nothing, only notification is the windows msgbox: Console Window Host has stopped working, after clicking close the program the program runs in the background with 100% cpu utilization and has to be forcefully closed. Note using console programs with other IDEs works normal.

Obviously this is some kind of weird interaction of pelles and windows.( .h and .lib files were not touched) ( it definitely isn't malware, windows defender or administrator access issue )
If anyone has any idea what could be causing that please let me know.

UPDATE: Reinstall of the same version(7.00.355) solved the problem. I'm still posting this, if anyone knows what happened please answer it may be useful for somebody,
(if admins disagree -> delete the post )



« Last Edit: March 12, 2013, 06:46:40 PM by Armin »

CommonTater

  • Guest
Re: Pelles - Console Crash - User Input
« Reply #1 on: March 12, 2013, 07:40:31 PM »
When running a console application that reads user input ( getc,fgetc,getchar,scanf,fgets...) of any kind the program crashes after return key was pressed 58 times, in other words after 58 times the input was send( in total program lifespan) from console.

Crash description: Debug shows nothing, only notification is the windows msgbox: Console Window Host has stopped working, after clicking close the program the program runs in the background with 100% cpu utilization and has to be forcefully closed. Note using console programs with other IDEs works normal.

This sounds strangely like an input buffer overflow to me. 
 

Armin

  • Guest
Re: Pelles - Console Crash - User Input
« Reply #2 on: March 12, 2013, 08:38:18 PM »
When running a console application that reads user input ( getc,fgetc,getchar,scanf,fgets...) of any kind the program crashes after return key was pressed 58 times, in other words after 58 times the input was send( in total program lifespan) from console.

Crash description: Debug shows nothing, only notification is the windows msgbox: Console Window Host has stopped working, after clicking close the program the program runs in the background with 100% cpu utilization and has to be forcefully closed. Note using console programs with other IDEs works normal.

This sounds strangely like an input buffer overflow to me.

Wouldn't that depend on input length. I this case it didn't.

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Pelles - Console Crash - User Input
« Reply #3 on: March 12, 2013, 09:12:45 PM »
Next best guess is a not properly initialized buffer or pointer into a buffer.

All in all pretty hard to tell unless you can reduce this problem to a sample program with reproducible results...

Ralf

CommonTater

  • Guest
Re: Pelles - Console Crash - User Input
« Reply #4 on: March 12, 2013, 09:43:17 PM »
Wouldn't that depend on input length. I this case it didn't.

Regardless of your input buffer size, if your program is not processing input immediately, it may still overflow the OS's keyboard buffer.   
 
A little reading might help...
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682010(v=vs.85).aspx
 
It is possible you've found some weird bug ... but as Ralf points out, unless you can reduce it to a predictable failure, there's no way to know for sure.
 

Armin

  • Guest
Re: Pelles - Console Crash - User Input
« Reply #5 on: March 12, 2013, 11:34:31 PM »
Thank you for you opinions,
Please note this only happens when program is launched via pelles execute (ctrl+f5 ) or debug (f5), not when the program is compiled by pelles and launched from OS. Also what is in the code does not matter as long you read console input. The problem persisted until pelles was reinstalled.
Armin
« Last Edit: March 12, 2013, 11:36:43 PM by Armin »