Ubuntu Mate 18.04 LTS - issue with Atmel Toolchains

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Recently upgraded my main machine from Lucid Lynx (10.04 LTS... yes, ancient!) to Bionic Beaver (yes, it's a silly name... let's get over it quickly... ;-)

 

I seem to have an issue now when using any of the Atmel toolchains to build my projects:

2 joeymorin@stinky:~/c.src/AVR/blink_delay_ms$ make
avr-gcc -DF_CPU=16000000UL -I . -include blink_delay_ms.h -Os -mmcu=attiny85 -mrelax -fjump-tables  -maccumulate-args -fno-inline-small-functions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-tree-scev-cprop -fsplit-wide-types -mbranch-cost=3  -pedantic -H   -Wc++-compat -mstrict-X   -std=gnu11 -g -W -Wall -Wextra -Wunused -Wstrict-prototypes -Wundef -Werror -fno-exceptions -fdata-sections -ffunction-sections -save-temps -c -include fuses_and_lockbits.h blink_delay_ms.c
. /home/joeymorin/Software/AVR_toolchain/avr8-gnu-toolchain-linux_x86_64.3.5.4/avr/include/util/delay.h
.. /home/joeymorin/Software/AVR_toolchain/avr8-gnu-toolchain-linux_x86_64.3.5.4/avr/include/util/delay_basic.h
.. /home/joeymorin/Software/AVR_toolchain/avr8-gnu-toolchain-linux_x86_64.3.5.4/avr/include/math.h
Multiple include guards may be useful for:
./blink_delay_ms.h
./fuses_and_lockbits.h
as: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
avr-gcc: internal compiler error: Aborted (program as)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.atmel.com> for instructions.
Makefile:174: recipe for target 'blink_delay_ms' failed
make: *** [blink_delay_ms] Error 4

 

This seems to be related to:

https://forum.manjaro.org/t/stable-update-2018-05-07-kernels-mesa-glibc-php-nvidia-plasma5-firefox/46632/309

(use CTRL-F to find loadlocale)

Bertie 2018-05-16 13:57:51 UTC #316

I have a problem with the new glibc:
Programs from the avr-toolchain, such as avr-gcc, as, etc. exit with an error:

as: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.

Although my locale is correct, the variable LC_TIME does not seem to be imported correctly by glibc for my specific setting.

The temporary solution is:

$ export LANG=C 

in the current terminal session before running an affected program. (This will then be set for the duration of the terminal session) , or

$ LANG=C program     (for example $ LANG=C avr-gcc)

on a per program instance.

In 2015 I had a similar problem with glibc which affected the variable LC_COLLATE, with the same temporary solution. Seemed that only Arch based distros were affected. This remained for many months until it finally disappeared (fixed).

If you have this similar problem, do not try to downgrade glibc.

 

The solution proposed seems to do the trick, but I'm unclear on any side effects it may have.  In particular, what might be the implications of changing the value of LANG from it's default (en_CA.UTF-8 in my case) to 'C'?

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Changing locale can affect a number of things, like error messages; for instance, that's how you'd set things to request non-English error messages.

 

But it shouldn't affect the actual output of the assembler, and seems safe enough. What's the current value? ("echo $LANG" at a prompt.)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the_real_seebs wrote:
What's the current value? ("echo $LANG" at a prompt.)

joeymorin wrote:
In particular, what might be the implications of changing the value of LANG from it's default (en_CA.UTF-8 in my case) to 'C'?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm having the same issue - really annoying.

 

EDIT: a bug is opened on Launchpad

https://bugs.launchpad.net/ubunt...

 

Hope it's going to get fixed soon.

Last Edited: Tue. Jul 3, 2018 - 01:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Quick workaround is to set the LC_LANG environment variable to something invalid before invoking the toolchains (i.e just some random chars should do).
.
The reason is that glibc has changed its locale representation 'recently', but the linker built by us is statically linked. This causes the locale to fail to load. Setting it to something invalid causes it to fall back.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

Last Edited: Mon. Jul 23, 2018 - 04:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An update to Ubuntu Mate 18.04 LTS appears to have fixed the issue.

 

I had been using this to work around th problem:

$ alias | grep LANG
alias avr-gcc='LANG=C avr-gcc'

... but that is no longer necessary.  I don't know when it became so, but this morning I noticed an update come through for:

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1783326

... but I haven't dug deeper to determine if this is what fixed it.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wrote:
... but that is no longer necessary.
Well, I was wrong.  Apparently I'd added the work-around in two places

  1. ~/.bash_aliases
  2. ~/.profile

 

I'd only removed the work-around from the first, but not the second.  I noticed this today while editing .profile for a different reason.  Sure enough, removing it there reverted to the broken behaviour.

 

So this is still an outstanding issue.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No fix for this yet?  Back to CodeBlocks I go ...............

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I haven't checked in a while, and I'm not near a machine, but I expect so.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
Bionic Beaver (yes, it's a silly name... let's get over it quickly... ;-)
Nope. Bionic Beaver sound like fun to me. I want one too.

It must be better than an "Artful Aardvark".

 

"Bionic Beaver" also a pretty mild name if you consider some of those other Cocktails.

https://www.1001cocktails.com/recipes/mixed-drinks/200041/cocktail-bionic-beaver.html

 

There are a gazillion of those wordplays in the open source world, and some you probably have not even identified.

For example:

Have you ever thought Eclipse, which is an IDE made for Java from Sun?

 

And why are you calling your computer stinky?

 

As I only use the older AVR's I simply stick with whatever apt installs for me (Debian Buster here at the moment).

 

avr-gcc: internal compiler error: Aborted (program as)
Please submit a full bug report,
with preprocessed source if appropriate.
See < http://www.atmel.com > for instructions.

 

Have you downloaded that toolchain from Microchip's website?

Maybe revert to an older version temporarily or just juse apt if your AVR's are old enough.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

Last Edited: Sat. Jan 26, 2019 - 05:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paulvdh wrote:
And why are you calling your computer stinky?
Tradition.  It's a ThinkPad.  I long ago rechristened that line 'StinkPad', on account of a particularly lemony unit I had to deal with in my younger days as a front-line IT support monkey.

 

In truth, I very much like every other ThinkPad I've laid hands on.  But the name has stuck.

 

I have another ThinkPad named blinky, and a third named hinky.

 

The toolchain in question is the official Atmel toolchain.  The issue is:

meolsen wrote:
The reason is that glibc has changed its locale representation 'recently', but the linker built by us is statically linked. This causes the locale to fail to load. Setting it to something invalid causes it to fall back.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Sat. Jan 26, 2019 - 06:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
I haven't checked in a while, and I'm not near a machine, but I expect so.
I just checked.  Problem remains.  The export workaround still works.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
The export workaround still works
Hm.  Apparently, it also causes some problems.

 

Just spent about a half-hour tracking down why I couldn't open the "Software & Updates" dialogue.  Checking at the command line:

$ /usr/bin/python3 /usr/bin/software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 100, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 196, in __init__
    self.show_keys()
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 893, in show_keys
    for key in self.apt_key.list():
  File "/usr/lib/python3/dist-packages/softwareproperties/AptAuth.py", line 64, in list
    for line in p:
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1501: ordinal not in range(128)

 

Some Googling implicated the locale and the LANG environment variable.  Sure enough, when I remove 'export LANG=C' from ~/.profile and log in/out, problem disappears.

 

So I'm going keep that export out of my .profile, and go back to using an alias in my .bash_aliases file.  This will keep the change to LANG local to the shell.

alias make='LANG=C make'

Still pretty kludgey.

 

EDIT:  typo

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Jan 31, 2019 - 04:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am up and working with 18.04 and LANG=C.  I did have issues until I (apt) installed libc-avr.