My embedded linux app sometimes outputs the text like this:

root@variscite /mnt/nfs$ ./test

GPIO_IMX6_C: i=1 cannot open GPIO device file /sys/class/gpio/gð½Å¢ j¤Ôè Uêêª eú5¥Jõ¹¹2¥±zåͽ±Í?:e½½:e½Å¢j¤Ôè Uêêª 2¥±zåͽ±Í?:e½½:e½åj¤Ôè eú5¥Jõº¹¹½?zU¹:A%="? Uêêª 2¥±zåͽ±Í?:e½½:e½åj¤Ôè eú5¥Jõ¹¹½?zU¹:A%="? Uêêª 2¥±zåͽ±Í?:e½½:e½Å¢Âj¤ÔȪWKV.¤ËR-k®W«U¹:A%="? פ¬,]Z»Y1 DEBUG[0700]: Fan Control Board: Fan control Write byte ... call CreateServerSocket...9600

Set attrib

Any ideas, what could cause this?

  • Looks like something you are accessing is encrypted. – Kevdog777 Jan 16 '14 at 16:46
  • Could be that you are trying to print from a buffer that is not null terminated. For example a buffer that is not big enough to contain "cannot open GPIO device file /sys/class/gpio/g" – Kotte Jan 16 '14 at 16:48

Your application is printing some garbage. You can't do anything about that except fix the application.

Garbage characters could also be non-ASCII characters printed in the wrong locale, but given that the garbage occurs immediately after a legitimate-looking string and the application doesn't seem to be trying to print non-English text, an application bug is the most likely — quite possibly it's appending garbage to a string because some C code is missing the part where it should add the null terminator at the end of a string buffer.

If the application happens to print certain escape sequences, this could have lasting effects. Try tput reset or reset to reset the terminal to a default configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.