GNU bug report logs - #51925
[Trunk][macOS] "vfork" is deprecated

Previous Next

Package: emacs;

Reported by: Jacob Faibussowitsch <jacob.fai <at> gmail.com>

Date: Wed, 17 Nov 2021 17:51:01 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51925 in the body.
You can then email your comments to 51925 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Wed, 17 Nov 2021 17:51:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jacob Faibussowitsch <jacob.fai <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 17 Nov 2021 17:51:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [Trunk][macOS] "vfork" is deprecated
Date: Wed, 17 Nov 2021 11:50:46 -0600
[Message part 1 (text/plain, inline)]
Hello Emacs Devs,

I have recently been getting the following warnings building emacs on macOS Big Sur v11.6.1 with clang:

sysdep.c:667:11: warning: 'vfork' is deprecated: Use posix_spawn or fork [-Wdeprecated-declarations]
    pid = vfork ();
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:604:1: note: 'vfork' has been explicitly marked deprecated here
__deprecated_msg("Use posix_spawn or fork")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:208:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.

callproc.c:1478:11: warning: 'vfork' is deprecated: Use posix_spawn or fork [-Wdeprecated-declarations]
    pid = vfork ();
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:604:1: note: 'vfork' has been explicitly marked deprecated here
__deprecated_msg("Use posix_spawn or fork")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:208:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.

————————————————————————————————————————————————

This is by no means breaking or disrupting anything on my end (at least that I can tell), but I did notice in some commit messages a few weeks that someone was attempting to replace vfork with posix_spawn specifically on macOS, so maybe my system is some unhandled corner-case?

commit cc4edea872ca653f3e0631ce50e47b5260c6773a
Author: Philipp Stephani <phst <at> google.com>
Date:   Wed Dec 30 14:42:01 2020 +0100

    Use posix_spawn if possible.

    posix_spawn is less error-prone than vfork + execve, and can make
    better use of system-specific enhancements like 'clone' on Linux.  Use
    it if we don't need to configure a pseudoterminal.

    Backported from commit a60053f8368e058229721f1bf1567c2b1676b239.
    Unlike that commit, only define USABLE_POSIX_SPAWN on macOS, because
    there posix_spawn is much faster than vfork.

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Wed, 17 Nov 2021 17:59:01 GMT) Full text and rfc822 format available.

Message #8 received at 51925 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
Cc: 51925 <at> debbugs.gnu.org
Subject: Re: bug#51925: [Trunk][macOS] "vfork" is deprecated
Date: Wed, 17 Nov 2021 19:58:05 +0200
> From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
> Date: Wed, 17 Nov 2021 11:50:46 -0600
> 
> This is by no means breaking or disrupting anything on my end (at least that I can tell), but I did notice in
> some commit messages a few weeks that someone was attempting to replace vfork with posix_spawn
> specifically on macOS, so maybe my system is some unhandled corner-case?

That change is already on master.  If your build of a recent master
branch doesn't use the posix_spawn code, the first place to look is in
config.log, where you should try to find the reason(s) why the
configure script decided your system doesn't have posix_spawn.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Wed, 17 Nov 2021 18:03:01 GMT) Full text and rfc822 format available.

Message #11 received at 51925 <at> debbugs.gnu.org (full text, mbox):

From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 51925 <at> debbugs.gnu.org
Subject: Re: bug#51925: [Trunk][macOS] "vfork" is deprecated
Date: Wed, 17 Nov 2021 12:02:25 -0600
[Message part 1 (text/plain, inline)]
Checking my config.log gives:

configure:20626: checking for posix_spawn
configure:20626: clang -o conftest -O3 -march=native -mtune=native -flto=thin -flto-jobs=5 -std=gnu\
17 -Wno-unused-command-line-argument -Wno-unknown-pragmas     conftest.c  -lpng -ljpeg >&5
configure:20626: $? = 0
configure:20626: result: yes
configure:20632: checking for posix_spawn_file_actions_addchdir
configure:20632: clang -o conftest -O3 -march=native -mtune=native -flto=thin -flto-jobs=5 -std=gnu\
17 -Wno-unused-command-line-argument -Wno-unknown-pragmas     conftest.c  -lpng -ljpeg >&5
undef: _posix_spawn_file_actions_addchdir
Undefined symbols for architecture x86_64:
  "_posix_spawn_file_actions_addchdir", referenced from:
      _main in 0.x86_64.thinlto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

And the final set of defines for configure includes the following:

...
#define HAVE_POSIX_SPAWN 1
#define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP 1
#define HAVE_POSIX_SPAWNATTR_SETFLAGS 1
#define HAVE_DECL_POSIX_SPAWN_SETSID 1
...
configure: exit 0

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

> On Nov 17, 2021, at 11:58, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
>> Date: Wed, 17 Nov 2021 11:50:46 -0600
>> 
>> This is by no means breaking or disrupting anything on my end (at least that I can tell), but I did notice in
>> some commit messages a few weeks that someone was attempting to replace vfork with posix_spawn
>> specifically on macOS, so maybe my system is some unhandled corner-case?
> 
> That change is already on master.  If your build of a recent master
> branch doesn't use the posix_spawn code, the first place to look is in
> config.log, where you should try to find the reason(s) why the
> configure script decided your system doesn't have posix_spawn.
> 
> Thanks.

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Wed, 17 Nov 2021 18:09:02 GMT) Full text and rfc822 format available.

Message #14 received at 51925 <at> debbugs.gnu.org (full text, mbox):

From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 51925 <at> debbugs.gnu.org
Subject: Re: bug#51925: [Trunk][macOS] "vfork" is deprecated
Date: Wed, 17 Nov 2021 12:08:23 -0600
[Message part 1 (text/plain, inline)]
Forgot to attach the config.log…

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)


> On Nov 17, 2021, at 12:02, Jacob Faibussowitsch <jacob.fai <at> gmail.com> wrote:
> 
> Checking my config.log gives:
> 
> configure:20626: checking for posix_spawn
> configure:20626: clang -o conftest -O3 -march=native -mtune=native -flto=thin -flto-jobs=5 -std=gnu\
> 17 -Wno-unused-command-line-argument -Wno-unknown-pragmas     conftest.c  -lpng -ljpeg >&5
> configure:20626: $? = 0
> configure:20626: result: yes
> configure:20632: checking for posix_spawn_file_actions_addchdir
> configure:20632: clang -o conftest -O3 -march=native -mtune=native -flto=thin -flto-jobs=5 -std=gnu\
> 17 -Wno-unused-command-line-argument -Wno-unknown-pragmas     conftest.c  -lpng -ljpeg >&5
> undef: _posix_spawn_file_actions_addchdir
> Undefined symbols for architecture x86_64:
>   "_posix_spawn_file_actions_addchdir", referenced from:
>       _main in 0.x86_64.thinlto.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> And the final set of defines for configure includes the following:
> 
> ...
> #define HAVE_POSIX_SPAWN 1
> #define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP 1
> #define HAVE_POSIX_SPAWNATTR_SETFLAGS 1
> #define HAVE_DECL_POSIX_SPAWN_SETSID 1
> ...
> configure: exit 0
> 
> Best regards,
> 
> Jacob Faibussowitsch
> (Jacob Fai - booss - oh - vitch)
> 
>> On Nov 17, 2021, at 11:58, Eli Zaretskii <eliz <at> gnu.org <mailto:eliz <at> gnu.org>> wrote:
>> 
>>> From: Jacob Faibussowitsch <jacob.fai <at> gmail.com <mailto:jacob.fai <at> gmail.com>>
>>> Date: Wed, 17 Nov 2021 11:50:46 -0600
>>> 
>>> This is by no means breaking or disrupting anything on my end (at least that I can tell), but I did notice in
>>> some commit messages a few weeks that someone was attempting to replace vfork with posix_spawn
>>> specifically on macOS, so maybe my system is some unhandled corner-case?
>> 
>> That change is already on master.  If your build of a recent master
>> branch doesn't use the posix_spawn code, the first place to look is in
>> config.log, where you should try to find the reason(s) why the
>> configure script decided your system doesn't have posix_spawn.
>> 
>> Thanks.
> 

[Message part 2 (text/html, inline)]
[config.log (application/octet-stream, attachment)]
[Message part 4 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Wed, 17 Nov 2021 18:26:01 GMT) Full text and rfc822 format available.

Message #17 received at 51925 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
Cc: 51925 <at> debbugs.gnu.org
Subject: Re: bug#51925: [Trunk][macOS] "vfork" is deprecated
Date: Wed, 17 Nov 2021 20:25:13 +0200
> From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
> Date: Wed, 17 Nov 2021 12:02:25 -0600
> Cc: 51925 <at> debbugs.gnu.org
> 
> configure:20632: checking for posix_spawn_file_actions_addchdir
> configure:20632: clang -o conftest -O3 -march=native -mtune=native -flto=thin -flto-jobs=5 -std=gnu\
> 17 -Wno-unused-command-line-argument -Wno-unknown-pragmas     conftest.c  -lpng -ljpeg >&5
> undef: _posix_spawn_file_actions_addchdir
> Undefined symbols for architecture x86_64:
>   "_posix_spawn_file_actions_addchdir", referenced from:
>       _main in 0.x86_64.thinlto.o
> ld: symbol(s) not found for architecture x86_64

So your system lacks posix_spawn_file_actions_addchdir.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Wed, 17 Nov 2021 20:18:02 GMT) Full text and rfc822 format available.

Message #20 received at 51925 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
Cc: eliz <at> gnu.org, 51925 <at> debbugs.gnu.org
Subject: Re: bug#51925: [Trunk][macOS] "vfork" is deprecated
Date: Wed, 17 Nov 2021 23:16:55 +0300
(resending with Eli & list in CC)

On 17/11/2021 13:34 -0600, Jacob Faibussowitsch wrote:

>> Did you try "make bootstrap"?
>
> Yes, I’ve been getting the warning for a few weeks now, and it
> persists through bootstrap builds. Any other config files/logs I can
> send to help diagnose this?
>

Then I'd ensure that Command Line Tools are properly installed.

Either run 'xcode-select --install', or, if you want a clean install, 1)
delete /Library/Developer/CommandLineTools, 2) download dmg from here
https://developer.apple.com/download/all and install it.

Filipp




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Thu, 18 Nov 2021 15:51:01 GMT) Full text and rfc822 format available.

Message #23 received at 51925 <at> debbugs.gnu.org (full text, mbox):

From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: eliz <at> gnu.org, 51925 <at> debbugs.gnu.org
Subject: Re: bug#51925: [Trunk][macOS] "vfork" is deprecated
Date: Thu, 18 Nov 2021 09:50:27 -0600
[Message part 1 (text/plain, inline)]
I have had these installed for ages, but as it turns out my Xcode path was still pointing to /Applications/Xcode.app/Contents/Developer -_-.

Switching to CLT I now don’t get warnings about vfork() when building emacs anymore, but have now gotten the following warning:

nproc.c:321:21: warning: passing 'const int [2]' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        if (sysctl (mib[i], ARRAY_SIZE (mib[i]), &nprocs, &len, NULL, 0) == 0
                    ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/sysctl.h:770:21: note: passing argument to parameter here
int     sysctl(int *, u_int, void *, size_t *, void *, size_t);
                    ^
1 warning generated.

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

> On Nov 17, 2021, at 14:16, Filipp Gunbin <fgunbin <at> fastmail.fm> wrote:
> 
> (resending with Eli & list in CC)
> 
> On 17/11/2021 13:34 -0600, Jacob Faibussowitsch wrote:
> 
>>> Did you try "make bootstrap"?
>> 
>> Yes, I’ve been getting the warning for a few weeks now, and it
>> persists through bootstrap builds. Any other config files/logs I can
>> send to help diagnose this?
>> 
> 
> Then I'd ensure that Command Line Tools are properly installed.
> 
> Either run 'xcode-select --install', or, if you want a clean install, 1)
> delete /Library/Developer/CommandLineTools, 2) download dmg from here
> https://developer.apple.com/download/all and install it.
> 
> Filipp

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Thu, 18 Nov 2021 17:10:02 GMT) Full text and rfc822 format available.

Message #26 received at 51925 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
Cc: eliz <at> gnu.org, 51925 <at> debbugs.gnu.org
Subject: Re: bug#51925: [Trunk][macOS] "vfork" is deprecated
Date: Thu, 18 Nov 2021 20:09:19 +0300
On 18/11/2021 09:50 -0600, Jacob Faibussowitsch wrote:

> I have had these installed for ages, but as it turns out my Xcode path
> was still pointing to /Applications/Xcode.app/Contents/Developer -_-.

CLT are enough for a working toolchain (XCode itself is not necessary).

I was talking about ensuring "proper" installation just in case
something's wrong with CLT (for example, who knows what macOS update is
doing?).  But good that you found the reason.

> Switching to CLT I now don’t get warnings about vfork() when building emacs anymore, but have now gotten the following warning:
>
> nproc.c:321:21: warning: passing 'const int [2]' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
>         if (sysctl (mib[i], ARRAY_SIZE (mib[i]), &nprocs, &len, NULL, 0) == 0
>                     ^~~~~~
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/sysctl.h:770:21: note: passing argument to parameter here
> int     sysctl(int *, u_int, void *, size_t *, void *, size_t);
>                     ^

I have them too, someone has to fix it.

Filipp




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51925; Package emacs. (Tue, 20 Sep 2022 15:21:01 GMT) Full text and rfc822 format available.

Message #29 received at 51925 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
Cc: eliz <at> gnu.org, 51925 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#51925: [Trunk][macOS] "vfork" is deprecated
Date: Tue, 20 Sep 2022 17:20:40 +0200
Jacob Faibussowitsch <jacob.fai <at> gmail.com> writes:

> Switching to CLT I now don’t get warnings about vfork() when building emacs
> anymore,

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

So I guess this means that the originally reported problem is gone, and:

> but have now gotten the following warning:
>
> nproc.c:321:21: warning: passing 'const int [2]' to parameter of type 'int *' discards
> qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
>         if (sysctl (mib[i], ARRAY_SIZE (mib[i]), &nprocs, &len, NULL, 0) == 0
>                     ^~~~~~
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/sysctl.h:770:21:
> note: passing argument to parameter here
> int     sysctl(int *, u_int, void *, size_t *, void *, size_t);
>                     ^
> 1 warning generated.

I'm not able to reproduce this problem either on the current Macos, so
I'm closing this bug report.




bug closed, send any further explanations to 51925 <at> debbugs.gnu.org and Jacob Faibussowitsch <jacob.fai <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 20 Sep 2022 15:21:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 19 Oct 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.