Portage crashes with AttributeError @ line 294 in highlight_violations: if use and atom.use.tokens: AttributeError: 'NoneType' object has no attribute 'tokens' No idea why this happens, although I suspect an error in a package in my list of updates. This crash is exhibited on sys-apps/portage-2.2_rc75 and sys-apps/portage-2.2_rc74 and probably exists in previous versions. Simple fix to check that atom.use exists by amending file "/usr/lib64/portage/pym/_emerge/resolver/slot_collision.py", line 294 to read: if use and atom.use and atom.use.tokens: Reproducible: Always Steps to Reproduce: 1. Recklessly unmask some* xfce packages. 2. emerge -uDavN world 3. Kaboom. * Unmasked packages: =xfce-base/libxfce4util-4.7.2 =xfce-base/xfce4-panel-4.7.2 =xfce-base/exo-0.5.3 =xfce-extra/thunar-volman-0.5.1 =xfce-base/thunar-1.1.1 Actual Results: See additional info. Expected Results: (Obtained by applying above fix) emerge --color n -uDavN world These are the packages that would be merged, in order: Calculating dependencies ..... done! [ebuild R ] net-misc/iputils-20100418 USE="ipv6 ssl%* -SECURITY_HAZARD -doc -idn -static" 0 kB [ebuild U ] net-misc/wget-1.12-r2 [1.12] USE="ipv6 nls ssl -debug -idn -ntlm -static" 0 kB [ebuild U ] sys-fs/mdadm-3.1.4 [3.1.3] USE="-static" 0 kB [ebuild U ] sys-fs/lvm2-2.02.73-r1 [2.02.73] USE="lvm1 readline static (-clvm) (-cman) (-selinux)" 0 kB [ebuild N ] xfce-base/garcon-0.1.1 USE="-debug" 0 kB [ebuild U ] media-video/transcode-1.1.5-r2 [1.1.5-r1] USE="X a52 aac alsa dvd iconv jpeg mmx mp3 mpeg ogg sdl sse sse2 theora truetype vorbis x264 xml xvid -3dnow (-altivec) -dv -imagemagick -lzo -mjpeg -nuv -oss -postproc -quicktime -v4l2" 0 kB [ebuild U ] xfce-base/exo-0.5.3 [0.3.107] USE="python -debug (-hal%*) (-libnotify%*)" 0 kB [ebuild U ] xfce-base/xfce4-panel-4.7.2 [4.6.4] USE="-debug (-startup-notification%*)" 0 kB [ebuild U ] x11-wm/compiz-0.8.6-r1 [0.8.6] USE="cairo dbus gtk svg -fuse -gconf% -gnome -kde" 0 kB [ebuild U ] x11-libs/libcompizconfig-0.8.4-r2 [0.8.4-r1] 0 kB [ebuild U ] x11-plugins/compiz-plugins-main-0.8.6-r1 [0.8.6] USE="-gconf% (-gnome%)" 0 kB [ebuild U ] dev-python/compizconfig-python-0.8.4-r2 [0.8.4-r1] 0 kB [ebuild U ] x11-plugins/compiz-plugins-extra-0.8.6-r1 [0.8.6] USE="-gconf% (-gnome%)" 0 kB Total: 13 packages (11 upgrades, 1 new, 1 reinstall), Size of downloads: 0 kB !!! Multiple package instances within a single package slot have been pulled !!! into the dependency graph, resulting in a slot conflict: xfce-base/exo:0 (xfce-base/exo-0.3.107, installed) pulled in by <xfce-base/exo-0.5 required by (xfce-extra/xfce4-places-plugin-1.2.0, installed) =xfce-base/exo-0.3* required by (xfce-base/xfdesktop-4.6.2, installed) >=xfce-base/exo-0.3.8[hal] required by (xfce-extra/thunar-volman-0.3.80, installed) (and 4 more with the same problems) (xfce-base/exo-0.5.3, ebuild scheduled for merge) pulled in by >=xfce-base/exo-0.5.1 required by (xfce-base/xfce4-panel-4.7.2, ebuild scheduled for merge) It may be possible to solve this problem by using package.mask to prevent one of those packages from being selected. However, it is also possible that conflicting dependencies exist such that they are impossible to satisfy simultaneously. If such a conflict exists in the dependencies of two different packages, then those packages can not be installed simultaneously. You may want to try a larger value of the --backtrack option, such as --backtrack=30, in order to see if that will solve this conflict automatically. For more information, see MASKED PACKAGES section in the emerge man page or refer to the Gentoo Handbook. !!! The following installed packages are masked: - games-emulation/xmame-0.106 (masked by: package.mask) /usr/portage/profiles/package.mask: # Michael Sterrett <mr_bones_@gentoo.org> (17 Aug 2010) # Mask for removal 20100916 # Development has moved to games-emulation/sdlmame; # use that package instead. For more information, see the MASKED PACKAGES section in the emerge man page or refer to the Gentoo Handbook. emerge --color n -uDavN world These are the packages that would be merged, in order: Calculating dependencies ....... done! [ebuild R ] net-misc/iputils-20100418 USE="ipv6 ssl%* -SECURITY_HAZARD -doc -idn -static" 0 kB [ebuild U ] net-misc/wget-1.12-r2 [1.12] USE="ipv6 nls ssl -debug -idn -ntlm -static" 0 kB [ebuild U ] sys-fs/mdadm-3.1.4 [3.1.3] USE="-static" 0 kB [ebuild U ] sys-fs/lvm2-2.02.73-r1 [2.02.73] USE="lvm1 readline static (-clvm) (-cman) (-selinux)" 0 kB [ebuild N ] xfce-base/garcon-0.1.1 USE="-debug" 0 kB [ebuild U ] media-video/transcode-1.1.5-r2 [1.1.5-r1] USE="X a52 aac alsa dvd iconv jpeg mmx mp3 mpeg ogg sdl sse sse2 theora truetype vorbis x264 xml xvid -3dnow (-altivec) -dv -imagemagick -lzo -mjpeg -nuv -oss -postproc -quicktime -v4l2" 0 kB [ebuild U ] xfce-base/exo-0.5.3 [0.3.107] USE="python -debug (-hal%*) (-libnotify%*)" 0 kB [ebuild U ] xfce-base/xfce4-panel-4.7.2 [4.6.4] USE="-debug (-startup-notification%*)" 0 kB [ebuild U ] x11-wm/compiz-0.8.6-r1 [0.8.6] USE="cairo dbus gtk svg -fuse -gconf% -gnome -kde" 0 kB [ebuild U ] x11-libs/libcompizconfig-0.8.4-r2 [0.8.4-r1] 0 kB [ebuild U ] x11-plugins/compiz-plugins-main-0.8.6-r1 [0.8.6] USE="-gconf% (-gnome%)" 0 kB [ebuild U ] dev-python/compizconfig-python-0.8.4-r2 [0.8.4-r1] 0 kB [ebuild U ] x11-plugins/compiz-plugins-extra-0.8.6-r1 [0.8.6] USE="-gconf% (-gnome%)" 0 kB Total: 13 packages (11 upgrades, 1 new, 1 reinstall), Size of downloads: 0 kB Traceback (most recent call last): File "/usr/bin/emerge", line 43, in <module> retval = emerge_main() File "/usr/lib64/portage/pym/_emerge/main.py", line 1672, in emerge_main myopts, myaction, myfiles, spinner) File "/usr/lib64/portage/pym/_emerge/actions.py", line 293, in action_build mydepgraph.display_problems() File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 5152, in display_problems self._display_problems() File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 5173, in _display_problems self._show_slot_collision_notice() File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 474, in _show_slot_collision_notice self._dynamic_config._slot_conflict_handler = slot_conflict_handler(self) File "/usr/lib64/portage/pym/_emerge/resolver/slot_collision.py", line 121, in __init__ self._prepare_conflict_msg_and_check_for_specificity() File "/usr/lib64/portage/pym/_emerge/resolver/slot_collision.py", line 332, in _prepare_conflict_msg_and_check_for_specificity atom_str = highlight_violations(atom.unevaluated_atom, version_violated, use) File "/usr/lib64/portage/pym/_emerge/resolver/slot_collision.py", line 294, in highlight_violations if use and atom.use.tokens: AttributeError: 'NoneType' object has no attribute 'tokens'
Created attachment 246121 [details, diff] Applies check that atom.use is not None
(In reply to comment #1) > Created an attachment (id=246121) [details] > Applies check that atom.use is not None > This patch just hides the real problem. Please add --debug to your options and attach the part after "Starting slot conflict handler".
Created attachment 246181 [details, diff] fix invalid highlight_violations() use argument If not perfect, I suspect this may be close to the correct fix. It's in git here: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5a8a4443dcc22bf0755c031ced4cef66b2cf370
(In reply to comment #2) > (In reply to comment #1) > > Created an attachment (id=246121) [details] [details] > > Applies check that atom.use is not None > > > > This patch just hides the real problem. > > Please add --debug to your options and attach the part after "Starting slot > conflict handler". > With --debug I get the same output after "Starting slot conflict handler". I get a _lot_ more output before hand. I can attach if necessary. The atoms in question are: =xfce-base/exo-0.3.107 =xfce-base/exo-0.5.3
(In reply to comment #3) > Created an attachment (id=246181) [details] > fix invalid highlight_violations() use argument > > If not perfect, I suspect this may be close to the correct fix. It's in git > here: > > http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5a8a4443dcc22bf0755c031ced4cef66b2cf370 > I can confirm this patch returns the correct/expected response.
It's cleaned up here, but behaves the same as the previous patch: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a3222ee052dd924a275c4d1c8ae3c44dc684e57
(In reply to comment #6) > It's cleaned up here, but behaves the same as the previous patch: There was another bug. It used to compare ppkg with x, but it must compare parent with x.
This is fixed in 2.1.9.1 and 2.2_rc76.