A file with link count 2 doesn't get both links updated
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Canonical System Image |
Critical
|
Barry Warsaw | ||
| | Ubuntu system image |
Critical
|
Barry Warsaw | ||
Bug Description
The Ubuntu Error Tracker has been receiving reports about a problem regarding click-apparmor. This problem was most recently seen with version 0.3.6, the problem page at https:/
Related branches
- Steve Langasek: Needs Fixing on 2015-05-30
- Caio Begotti (community): Approve on 2015-05-29
- Stéphane Graber: Pending requested 2015-05-29
- Ubuntu System Image team: Pending requested 2015-05-29
-
Diff: 433 lines (+254/-63)2 files modifiedlib/systemimage/diff.py (+89/-51)
lib/systemimage/tests/test_diff.py (+165/-12)
| Robert Schroll (rschroll) wrote : | #1 |
| Launchpad Janitor (janitor) wrote : | #2 |
Status changed to 'Confirmed' because the bug affects multiple users.
| Changed in click-apparmor (Ubuntu): | |
| status: | New → Confirmed |
| Jamie Strandboge (jdstrand) wrote : | #3 |
AFAICT, this is not a problem in click-apparmor, but instead python3.4. aa-clickhook is importing /usr/lib/
undefined symbol: _PyTraceback_Add
On up to date mako on devel-proposed, I cannot reproduce this:
$ sudo aa-clickhook -f # no error
$
$ nm -PoDC ./_ctypes.
./_ctypes.
$ system-image-cli -i
current build number: 172
device name: mako
channel: ubuntu-
alias: ubuntu-
last update: 2015-04-15 17:30:00
version version: 172
version ubuntu: 20150415
version device: 20150210
version custom: 20150415
| Steve Langasek (vorlon) wrote : | #4 |
Can someone with a device where this is reproducible please post the output of the following command, run against the /usr/bin/python3.4 image from the device?
objdump -T /usr/bin/python3.4 | grep _PyTraceback_Add
| Robert Schroll (rschroll) wrote : | #5 |
objdump doesn't exist on the device, so I copied the python3.4 binary over to my desktop. Running that command doesn't produce any output. (Just objdump -T alone does, so I assume it's working but producing nothing that grep matches.)
FWIW, it looks like the only use for ctypes in click.py is to import the nih_dbus_path() function. But you can just write it in python in about as many lines as it took to import it:
def encode_byte(b):
if ord(b'a') <= b <= ord(b'z') or ord(b'A') <= b <= ord(b'Z') or ord(b'0') <= b <= ord(b'9'):
return bytes([b])
return ('_%0.2x' % b).encode()
def my_dbus_path(x, *args):
return b'/'.join(
It probably doesn't fail in the same ways, but for a few tests with valid imports, it seems to work.
| Łukasz Zemczak (sil2100) wrote : | #6 |
On my BQ Aquaris device (krillin) I am unable to reproduce the issue. When looking for the symbol in the python3.4 executable here I see that it's here:
objdump -T python3.4 | grep _PyTraceback_Add
0003b421 g DF .text 000000a8 Base _PyTraceback_Add
So it's *very* interesting to know that the binary on your device does not have this symbol. Both should be the same since they're installed from the very same armhf binary package. Strange!
| Łukasz Zemczak (sil2100) wrote : | #7 |
Just so that there are no misunderstandings - I am running the ubuntu-touch/devel channel for that:
current build number: 2
device name: krillin
channel: devel
alias: ubuntu-touch/vivid
last update: 2015-04-15 22:33:51
version version: 2
version ubuntu: 20150413
version device: 20150326-f0c5ba5
version custom: 20150413
| Robert Schroll (rschroll) wrote : | #8 |
phablet@
current build number: 2
device name: flo
channel: devel
alias: ubuntu-touch/vivid
last update: 2015-04-15 03:04:31
version version: 2
version ubuntu: 20150413
version device: 20150210
version custom: 20150413
phablet@
42cc689fa8d2332
I upgraded this from r1. If you'd like, I can flash it anew and see if that changes things.
| Steve Langasek (vorlon) wrote : | #9 |
We've traced this down to a problem with the generation of the system-image delta at the time the image was promoted from the devel-proposed to the devel channel. The /usr/bin/python3.4 binary is missing from the delta, even though /usr/bin/python3.4m is present; as a result, anyone who was running version 1 of the image on the devel channel, and then upgraded, has the wrong (old) /usr/bin/python3.4 binary on their system.
This requires further investigation to understand both how the corruption of the delta happened, and how we can recover users on this channel who have applied the corrupted delta.
| Launchpad Janitor (janitor) wrote : | #10 |
Status changed to 'Confirmed' because the bug affects multiple users.
| Changed in python3.4 (Ubuntu): | |
| status: | New → Confirmed |
| Changed in ubuntu-system-image: | |
| status: | New → Triaged |
| importance: | Undecided → Critical |
| Changed in click-apparmor (Ubuntu): | |
| status: | Confirmed → Invalid |
| Changed in python3.4 (Ubuntu): | |
| status: | Confirmed → Invalid |
| no longer affects: | click-apparmor |
| John Quail (johnquail) wrote : | #11 |
I encounter a problem with a similar stack trace while trying to install a python 3 module named "secure-smtpd"
$ ./secure-
Traceback (most recent call last):
File "setup.py", line 3, in <module>
from setuptools import setup, find_packages
File "<virtualenv_
from setuptools.
File "<virtualenv_
from .dist import _get_unpatched
File "<virtualenv_
from setuptools import windows_support
File "<virtualenv_
import ctypes
File "/usr/lib/
from _ctypes import Union, Structure, Array
ImportError: <virtualenv_
$ objdump -T /usr/bin/python3.4 | grep _PyTraceback_Add
0000000000485136 g DF .text 00000000000000f4 Base _PyTraceback_Add
Let me know if you need additional information.
| John Quail (johnquail) wrote : | #12 |
$ objdump -T /usr/bin/python2 | grep _PyTraceback_Add
produces no result
| Dan Mordechay (danfromisrael) wrote : | #13 |
hi guys
this error just happened to me when trying to import basestring from setuptools.compat (that also uses ctype).
just note that it just happened today after upgrading ubuntu 14.10 to 15.04
(this code was working before)
i got the following exception:
File "/home/
from setuptools.compat import basestring
File "/home/
from setuptools.
File "/home/
from .dist import _get_unpatched
File "/home/
from setuptools import windows_support
File "/home/
import ctypes
File "/usr/lib/
from _ctypes import Union, Structure, Array
ImportError: /usr/lib/
hope it helps
Dan
| Steve Langasek (vorlon) wrote : | #14 |
Dan, the issue you describe is unrelated. Please file a separate bug for problems seen elsewhere than on the phone.
| no longer affects: | setuptools (Ubuntu) |
| Steve Langasek (vorlon) wrote : | #15 |
This is a critical infrastructure bug that should be considered a blocker for OTA-4, since the transition from OTA-3 to OTA-4 will include a delta that trips this bug.
| Changed in ubuntu-system-image: | |
| assignee: | nobody → Barry Warsaw (barry) |
| Changed in canonical-devices-system-image: | |
| milestone: | none → ww22-2015 |
| Pat McGowan (pat-mcgowan) wrote : | #16 |
This requires a server side
| Changed in canonical-devices-system-image: | |
| assignee: | nobody → Barry Warsaw (barry) |
| importance: | Undecided → Critical |
| status: | New → Confirmed |
| Barry Warsaw (barry) wrote : | #17 |
More information on comment #9:
<slangasek> because of bad handling of hardlinks in the delta generator
<slangasek> a minimal test case would be to generate a delta between two trees
where a file whose link count is 2 has been updated [15:23]
<slangasek> and verify that both of the link targets are included in the delta
(in a way that the upgrader can understand) [15:24]
| Changed in ubuntu-system-image: | |
| status: | Triaged → In Progress |
| tags: | added: server |
| summary: |
- /usr/bin/aa-clickhook:ImportError:/usr/bin/aa- - clickhook@14:/usr/lib/python3/dist- - packages/apparmor/click.py@15:/usr/lib/python3.4/ctypes/__init__.py@7 + A file with link count 2 doesn't get both links updated |
| no longer affects: | click-apparmor (Ubuntu) |
| no longer affects: | python3.4 (Ubuntu) |
| Barry Warsaw (barry) wrote : | #18 |
Okay, so we have two bugs here related to hardlinks. Here's the scenario:
In the source tarball:
'a' is a regular file with some contents
'b' is a hardlink to 'a'
In the target tarball:
'a' contains different contents, but 'b' still hardlinks to 'a'
Bug #1: If, in the target tarball, 'a' appears before 'b', we end up with a change set of [del-b, mod-a]. That's clearly not right since the target will lose the 'b' file.
Bug #2: If, in the target tarball 'b' appears before 'a', we end up with a change set of [mod-a]. That's not correct because 'a' will get a new inode when the target is unpacked, but 'b' will still be pointing at the old inode, i.e. at the wrong file.
In both cases, we want to modify 'a' and write a new 'b' that points to the new 'a'. I'm thinking maybe we want a new (internal) diff generation action of 'rep' == 'replace' for 'b', so we'd see a change set in both cases of [mod-a, rep-b]
| Barry Warsaw (barry) wrote : | #19 |
Hmm, reading generate_
| Steve Langasek (vorlon) wrote : | #20 |
FYI the problematic delta is still available on system-
old image (20141201): http://
new image (20150413): http://
delta: http://
Old tarball:
$ tar --wildcards -tvf /srv/system-
-rwxr-xr-x root/root 3120604 2014-11-14 19:14 system/
hrwxr-xr-x root/root 0 2014-11-14 19:14 system/
$
New tarball:
$ tar --wildcards -tvf /srv/system-
-rwxr-xr-x root/root 2887488 2015-03-27 02:51 system/
hrwxr-xr-x root/root 0 2015-03-27 02:51 system/
$
| Steve Langasek (vorlon) wrote : | #21 |
And in the unpacked delta:
$ grep usr/bin/python3.4 removed
system/
$
| Steve Langasek (vorlon) wrote : | #22 |
And the contents of the delta:
$ tar --wildcards -tvf /srv/system-
-rwxr-xr-x root/root 2887488 2015-03-27 02:51 system/
$
So system/
| Steve Langasek (vorlon) wrote : | #23 |
The fix has landed on the server, and I have confirmed on a test channel that it gives correct results when generating a delta between the current stable image and the current rc-proposed image:
$ ./bin/copy-image ubuntu-
$ ./bin/copy-image ubuntu-
$ tar tvf www/full/
-rwxr-xr-x root/root 2887488 2015-03-27 02:51 system/
hrwxr-xr-x root/root 0 2015-03-27 02:51 system/
$
Marking this issue resolved.
| Changed in ubuntu-system-image: | |
| status: | In Progress → Fix Released |
| Changed in canonical-devices-system-image: | |
| status: | Confirmed → Fix Released |
| Steve Langasek (vorlon) wrote : | #24 |
For users who encountered this issue on the vivid devel channel, if you haven't already (and you probably have), please re-flash with the current image to get the correct image contents.
| jumirugu1 (juanmiguel-rua) wrote : | #25 |
I've the same critical error but is thrown by Wand library. Currently I'm using django and a update has broken my python3.4. The result of command :
objdump -T /usr/bin/python3.4 | grep _PyTraceback_Add
is:
0000000000457e27 g DF .text 00000000000000cf Base _PyTraceback_Add
My currrent version of Ubuntu is :
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
| dmmmd (dmmmdfll) wrote : | #26 |
I did an apt-get upgrade on a Raspberry Pi running
Linux raspberry 3.18.0-25-rpi2 #26-Ubuntu SMP PREEMPT Sun Jul 5 06:46:34 UTC 2015 armv7l armv7l armv7l GNU/Linux
Now when I try to use IPython as a shell_plus in Django ./manage.py shell_plus --ipython I get the following error:
…
File "/home/
self.
AttributeError: 'InputHookManager' object has no attribute 'guihooks'
/manage.py shell_plus --plain functions as expected
I tried upgrading IPython but I could not because ctypes were missing. (I am assuming Python 3.4 is broken).
Django seems to be working as expected otherwise.
objdump -T /usr/bin/python3.4 | grep _PyTraceback_Add
0002912c g DF .text 0000008a Base _PyTraceback_Add
| dmmmd (dmmmdfll) wrote : | #27 |
Also of note, the python used inside of the virtualenv is Python 3.4.0 (default, Jun 19 2015, 14:24:27)
The /usr/bin/python3 is Python 3.4.3 (default, Oct 14 2015, 21:23:51)
| dmmmd (dmmmdfll) wrote : | #28 |
Inside of a Docker container the same Django app functions as expected when I run
./manage.py shell_plus --ipython
Linux 83b0b44f3023 3.16.0-51-generic #69~14.04.1-Ubuntu SMP Wed Oct 7 15:32:41 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Python 3.4.3
output of objdump -T /usr/bin/python3.4 | grep _PyTraceback_Add
000000000042c7cf g DF .text 00000000000000cf Base _PyTraceback_Add

This appears to be the problem I encountered after upgrading from devel r1 to devel r2. The full traceback follows:
Fatal error: /tmp/com. ubuntu. developer. rschroll. beru_1. 0.0_armhf. click failed to install. root:Signature check failed, but installing anyway as requested aa-clickhook" , line 14, in <module> python3/ dist-packages/ apparmor/ click.py" , line 15, in <module> python3. 4/ctypes/ __init_ _.py", line 7, in <module> python3. 4/lib-dynload/ _ctypes. cpython- 34m-arm- linux-gnueabihf .so: undefined symbol: _PyTraceback_Add exit(main( )) python3/ dist-packages/ click/commands/ install. py", line 66, in run python3/ dist-packages/ click/install. py", line 457, in install all_users, quiet=quiet) python3/ dist-packages/ click/install. py", line 441, in _unpack error-quark: Hook command '/usr/bin/ aa-clickhook' failed: Child process exited with code 1 (6)
WARNING:
Traceback (most recent call last):
File "/usr/bin/
from apparmor import click
File "/usr/lib/
import ctypes
File "/usr/lib/
from _ctypes import Union, Structure, Array
ImportError: /usr/lib/
Traceback (most recent call last):
File "/usr/bin/click", line 86, in <module>
sys.
File "/usr/bin/click", line 82, in main
return mod.run(args)
File "/usr/lib/
quiet=not options.verbose)
File "/usr/lib/
path, user=user, all_users=
File "/usr/lib/
user_name=None)
GLib.Error: click_hooks_