pkgsrc-Users archive

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

Re: Fix pkg_install on macOS Monterey





On 11/3/21 8:23 PM, Jason Bacon wrote:
On 11/3/21 05:49, Jonathan Perkin wrote:
So, Apple's crappy virtual memory system strikes again, and the problem we're running into is that the +INSTALL and +DEINSTALL scripts executed during upgrade of pkg_install fail because they're using fork() when the original file system image of pkg_add and pkg_delete are either missing or changed, as we're in the process of replacing them.

At least that's the best theory I'm working on right now, given the inability to do any proper debugging on this OS, and goes some way to explain why it's an intermittent failure.

I have a diff to switch the calls of these script to use system() instead:

   https://gist.github.com/jperkin/6e66a8753ec8039b298cac7b57f2a7de

and have verified that this "fixes" the issue in my limited testing, but I'm expecting some objections to this change (I don't like it either).

To those of you who object, please come up with some alternative solutions.  The only ones I can think of are really really bad.

Cheers,


I think I hit this error as well.  I manually worked around it by extracting pkg_add from from packages/All/pkg_install*.tgz and then using it to reinstall the same tgz.  Didn't get around to investigating the cause.

I like the posix_spawn() solution. I see that it has been added conditionally. If we're still supporting platforms that don't have posix_spawn(), I wonder if just replacing vfork() (fast but dangerous) with fork() (slower but portable) would be fine. I suspect the overhead saved by vfork() is miniscule compared to other tasks performed by pkg_install, but I could be overlooking something.

Home | Main Index | Thread Index | Old Index