On 21 January 2012 10:08, Zygmunt Krynicki zygmunt.krynicki@linaro.org wrote:
On Fri, Jan 20, 2012 at 10:40 PM, Matt Waddel matt.waddel@linaro.org wrote:
I: create linaro user Can't set $0 with prctl(): Bad address at /usr/sbin/adduser line 86.
Here is the perl code around line 86 in adduser:
my %config; # configuration hash
my @defaults = ("/etc/adduser.conf"); my $nogroup_id = getgrnam("nogroup") || 65534; $0 =~ s+.*/++; <<<<<<<<< Line 86 >>>>>>>>>>>
This line attempts to set $0 to the substitution of a regular expression, it takes $_ as an argument and replaces the value matched by a regular expression .*/ with an empty string.
Isn't it substituting on $0, not $_? (it's using =~).
I don't pretend to understand the error message, it just seems to me that $0 is the implicit variable that contains the entire string when using regular expressions ($1... and so on are subsequent matches) and that $0 in that context might be read only.
$0 here is the process name, and Perl is trying to set it using prctl(PR_SET_NAME, ...). [Google says it's done that only since Perl 5.14.] I think you're running under QEMU at this point, and QEMU doesn't support PR_SET_NAME. (It does do something with prctl but it basically just feeds all the arguments across, and since for PR_SET_NAME one of them is a pointer this doesn't work since qemu guest pointers are not host pointers).
In other words, looks like a qemu bug :-)
(I think having a basic utility like adduser fiddle with its own process name is a bit cheesy though.)
-- PMM