If a package being built dies during pkg_setup() phase, and it is situated in a repository path to which contains special characters (including ${PORTDIR}), portage fails to report the 'specific snippet of code' at which the package died. The reason for this is passing ${BASH_SOURCE[1]} unquoted to sed. I'm attaching a patch to fix the issue.
Created attachment 228137 [details, diff] Patch fixing the issue
Created attachment 228925 [details, diff] git-am format patch
Thanks, it's in git now: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c83340553c020146d3081cc86bb51966e036a6d4
Created attachment 229007 [details, diff] Patch to fix BASH_SOURCE quoting in call stack Here's a patch for a similar issue in 'call stack' display code.
(In reply to comment #4) > Created an attachment (id=229007) [details] > Patch to fix BASH_SOURCE quoting in call stack Thanks, it's in git now: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=044253371b2fefb348f30e0fba81efd2267b1390
*** Bug 316899 has been marked as a duplicate of this bug. ***
This is fixed in 2.1.9.