[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: m4 1.4.14 esyscmd problems on FreeBSD

From: Eric Blake
Subject: Re: m4 1.4.14 esyscmd problems on FreeBSD
Date: Mon, 01 Mar 2010 15:13:18 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090812 Thunderbird/ Mnenhy/

[adding bug-gnulib]

According to Johan van Selst on 3/1/2010 2:55 PM:
> Eric Blake wrote:
>> According to Johan van Selst on 3/1/2010 11:02 AM:
>>> Sure, it's now up on http://mud.stack.nl/~johans/193-ktrace.txt
>>> (output from the test in checks/193.esyscmd)
>> Actually, it looks like you posted the trace for 007.command_li
> Oops, I was rather hurried when posting this: it was 007.command_li
> indeed. There is now a new http://mud.stack.nl/~johans/193-ktrace.txt
> and http://mud.stack.nl/~johans/007-ktrace.txt (both with child tracing)
> for reference.
> This quickly identifies a problem:
>   2143 gm4      CALL  sigprocmask(SIG_BLOCK,0x545a20,0)
>   2143 gm4      RET   sigprocmask 0
>   2143 gm4      CALL  vfork
>   2144 gm4      RET   fork 0
>   2144 gm4      CALL  sched_setscheduler(0,<invalid=0>,0x800a0e918)
>   2144 gm4      RET   sched_setscheduler -1 errno 1 Operation not permitted
>   2144 gm4      CALL  exit(0x7f)
>   2143 gm4      RET   vfork 2144/0x860
>   2143 gm4      CALL  sigprocmask(SIG_UNBLOCK,0x545a20,0)
>   2143 gm4      RET   sigprocmask 0
> The issue seems to be with the seconds argument of sched_setscheduler()
> Quoting the FreeBSD <sched.h> there is no argument defined as 0 -
> Ref. http://cvsweb.freebsd.org/src/sys/sys/sched.h
>       /* POSIX 1003.1b Process Scheduling */
>       /*
>        * POSIX scheduling policies
>        */
>       #define SCHED_FIFO      1
>       #define SCHED_OTHER     2
>       #define SCHED_RR        3
>       struct sched_param {
>               int     sched_priority;
>       };
> On FreeBSD the default seems to be SCHED_OTHER (2); whereas on Linux
> this SCHED_OTHER is defined as 0. It may be that some code relies on
> this value being 0 and doesn't explicitly set it as SCHED_OTHER.
> But I haven't really analysed this code and should probably stop
> guessing and leave debugging to those more familiar with m4.

Thanks for the additional research.  Either Bruno's gnulib posix_spawnp
replacement (and thus the pipe module) triggers a FreeBSD failure, or you
have found a bug in FreeBSD posix_spawnp that we need to work around.
Johan, can you find the portion in config.log that shows whether the
native posix_spawn was deemed acceptable or buggy?  The gnulib version of
posix_spawnp only calls sched_setscheduler if something called
posix_spawnattr_setsched*, but I don't see that happening in the m4/gnulib
code base.

It may be possible to work around the failure, by priming the configure
cache.  For example, if the bug is that your posix_spawnp is broken, but
gnulib is not properly detecting that brokenness, then you could use
'./configure ac_cv_func_posix_spawnp=no' to force the gnulib replacement
to be compiled in.

Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]