Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204299 - sys-libs/glibc-2.6-1: locale-gen looses status information when generating multiple locales in parallel.
Summary: sys-libs/glibc-2.6-1: locale-gen looses status information when generating mu...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High trivial (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-04 17:39 UTC by jean de schacht
Modified: 2008-03-23 13:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for reported problem (locale-gen.patch,11.19 KB, patch)
2008-01-04 17:45 UTC, jean de schacht
Details | Diff
Patch for the problem (locale-gen.patch,477 bytes, patch)
2008-01-04 20:42 UTC, jean de schacht
Details | Diff
The final patch (locale-gen.patch,450 bytes, patch)
2008-01-05 14:29 UTC, jean de schacht
Details | Diff
More details (buginfo,1.25 KB, text/plain)
2008-01-05 14:33 UTC, jean de schacht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jean de schacht 2008-01-04 17:39:42 UTC
Here's how to reproduce it:
1. set up /etc/locale.gen to generate 2 locales.
2. as root run bash -vx /usr/sbin/locale-gen -j 5 &> locale-gen.log
Now search the logfile backward for 'wait'.
You will find a wait without arguments. So status info for the 2 jobs that run localedef in the background is lost!
Comment 1 jean de schacht 2008-01-04 17:45:18 UTC
Created attachment 140093 [details, diff]
patch for reported problem

After patching locale-gen and running the commands again you will find 2 waits for specific pids, and the status information for both subprocesses is handled correctly.
Comment 2 SpanKY gentoo-dev 2008-01-04 19:52:53 UTC
Comment on attachment 140093 [details, diff]
patch for reported problem

that isnt a patch ...
Comment 3 jean de schacht 2008-01-04 20:42:33 UTC
Created attachment 140127 [details, diff]
Patch for the problem

Sorry. Here's the patch.
Comment 4 jean de schacht 2008-01-05 14:29:54 UTC
Created attachment 140185 [details, diff]
The final patch
Comment 5 jean de schacht 2008-01-05 14:33:03 UTC
Created attachment 140186 [details]
More details
Comment 6 jean de schacht 2008-01-06 15:48:56 UTC
Comment on attachment 140186 [details]
More details

><HTML><HEAD/><BODY><PRE>Here's some more info:
>
>On entering the codeblock at line 349, the situation is as follows:
>
>All requested locale generations have been launched in background.  At
>most min(JOBS_MAX, JOB_COUNT) are either still running in the
>background or have finished running in the background but have
>not been waited upon to check their terminating status.
>
>   JOB_IDX = ((cnt mod JOBS_MAX)) 
>
>where cnt is total number of  locations to generate.
>
>There are 2 possibilities:
>
>case 
>     cnt &gt;= JOBS_MAX
>         we must wait on every job in the JOBS array, starting with the
>	 oldest entry and working are way back to the youngest.
>	 That is, starting from JOB_IDX and working our way back in 
>	 round-robin fashion until JOB_COUNT drops to 0.
>
>     cnt &lt; JOBS_MAX
>     	 we should start from index 0 in the JOBS array until JOB_COUNT 
>	 drops to 0. We can revert to the above algo if we catch entries
>	 outsid the boundary of the JOBS array.
>
>-------------------
>
>As is, I can run locale-gen from a non-root user account and it will give
>me a return code of 0, though it hasn't generated a single locale, because it
>doesn't have sufficient permissions.
>
>The problem only occurs when JOBS_MAX &gt; 1, which is probably the reason why 
>the bug hasn't been reported before.
>
>Hope this helps...
></PRE></BODY></HTML>
Comment 7 SpanKY gentoo-dev 2008-03-23 13:17:28 UTC
i dont think your changes would have really fixed things properly ... ive committed this instead:
http://sources.gentoo.org/gentoo/src/patchsets/glibc/extra/locale/locale-gen?r1=1.25&r2=1.26