[klibc] unbreak vfork on cris architecture

Waldemar Brodkorb mail at waldemar-brodkorb.de
Tue Mar 22 12:15:37 PDT 2011


Hi,
On Mar 21, 2011, at 6:01 PM, Mike Frysinger wrote:

> On Mon, Mar 21, 2011 at 11:14 AM, Thorsten Glaser wrote:
>>>> your simple implementation is probably incorrect -- errno cannot be
>>>> referenced directly.
>> 
>> Mh. On the other hand, the manpage says:
>> 
>>     In a multithreaded application,  vfork()  borrows  only  the
>>     thread  of  control  that called vfork() in the parent; that
>>     is, the child contains only one thread. The use  of  vfork()
>>     in  multithreaded  applications,  however,  is unsafe due to
>>     race conditons that can cause the child  process  to  become
>>     deadlocked  and consequently block both the child and parent
>>     process from execution indefinitely.
> 
> which is irrelevant in the case of updating errno -- the vfork failed
> and thus no 2nd process is running
> 
>> But if that’s a concern… fix it
> 
> i have nothing to do with cris.  but the answer here is not "fix it"
> but rather "patch not merged".  no sweat off my back since i dont have
> any cris hardware.

I already asked about the problem here:
http://www.mail-archive.com/uclibc@uclibc.org/msg06089.html

Unfortunately it is your commit, which breaks it for the unpopular cris architecture:
-------------
commit 711ad9f92c1cf992c4a3d9f4f709bd692be7789c
Author: Mike Frysinger <vapier at gentoo.org>
Date:   Thu Jul 23 04:03:17 2009 -0400

    create real common vfork() function
    
    Rather than force people to always implement their own vfork(), have the
    default implementation be sane.
    
    For now, only the Blackfin port uses the new code.
-------------

> 
>> He found a problem and a WFM-style fix, which at
>> least improves the situation.
> 
> then file a bug in bugzilla so someone else will fix it eventually

So getting the info of my two mails into a bug report is the best way to get
a working uclibc for my two Foxboards? 

They are old, but still nice, f.e. as
a kerberos master. Just as a side note, after one of the suggested fixes, the
cris embedded system runs fine:
root at brom:/root # uptime
 20:11:01 up 40 days,  3:38, load average: 0.08, 0.03, 0.05
root at brom:/root # uname -a
Linux brom 2.6.37 #1 Tue Feb 1 01:28:39 CET 2011 cris GNU/Linux
root at brom:/root # ps axw|grep krb
  288 root     /usr/sbin/krb5kdc
  601 root     grep krb
root at brom:/root # ls /lib/libuClibc-0.9.32-rc2.so 
/lib/libuClibc-0.9.32-rc2.so

have fun
 Waldemar




More information about the klibc mailing list