使用系统突然开始失败的perl调用

发布于 2025-02-04 11:52:36 字数 661 浏览 2 评论 0原文

本周,我的标准Perl [草莓Perl 5,版本32,Subversion 1(v5.32.1)为MSWIN32-X64-Multi-Thread]构建的脚本开始失败。我将其跟踪到失败的背景操作。

调查表明,所有系统类型的呼叫,反向,QX,管道打开,都失败了。我尝试构建Perl的调试版本,甚至失败,因为构建过程使用Miniperl,这也有相同的问题。

.. \ miniperl.exe -i .. \ lib .. \ make_ext.pl“ make = nmake -nologo” -dir = .. \ cpan -dir = .. \ dist -dist -dist -dist -dir -dir = .. \ ext- -nonxs
不能产生“ cmd.exe”:\ make_ext.pl line 580.
no这样的文件或目录 无法产生“ cmd.exe”:\ make_ext.pl line582。 不成功的make(dist/if):code = 65280 at .. \ make_ext.pl line 584.

我尝试定义Perl5shell(通往CMD的完整路径,PWSH代替CMD),关闭恶意软件保护,这是我想到的一切。

因此,实际问题: 有人建议我如何找到这个问题吗?它在星期四工作,此后没有系统更新[OS版本10.0.22000]。

This week one of my standard perl [Strawberry perl 5, version 32, subversion 1 (v5.32.1) built for MSWin32-x64-multi-thread] scripts started failing. I tracked it down to a failing backtick operation.

Investigation showed that all the system-type calls, backtick, qx, pipe open, are failing. I tried building a debug version of perl, and even that fails, as the build process uses miniperl, which has the same problem.

..\miniperl.exe -I..\lib ..\make_ext.pl "MAKE=nmake -nologo" --dir=..\cpan --dir=..\dist --dir=..\ext --nonxs
Can't spawn "cmd.exe": No such file or directory at ..\make_ext.pl line 580.
Can't spawn "cmd.exe": No such file or directory at ..\make_ext.pl line 582.
Unsuccessful make(dist/if): code=65280 at ..\make_ext.pl line 584.

I tried defining PERL5SHELL (full path to cmd, pwsh in place of cmd), turning off malware protection, everything I could think of reverting.

So, the actual question:
Does anyone have a suggestion for how I can track this down? It was working on Thursday, and there have been no system updates since then [OS version 10.0.22000].

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

手长情犹 2025-02-11 11:52:36

从几周前开始,我遇到了同样的问题。我使用ActiveState Perl,所以我尝试安装草莓Perl,但与草莓遇到了同样的问题。我还看到了创建零长度的文件。这是在多台机器上发生的。一个是Winver 1909,另一个是21H2。
解决方法是将完整的路径用于要运行的程序。
您还可以在程序前插入到cmd.exe的完整路径。尝试一下:

$temp = `$ENV{COMSPEC} /c date /T`;
print "\$temp = $temp";

我一直认为这是由于W10安全更新所致,但我真的不知道原因。我要编写一个名为backticks()的子,我可以使用这样的方法:

print Backticks('date /T');

sub backticks将返回$ enksspec}/c @_ 。
这是一个黑客,但是在这一点上,我不知道该怎么办。

I ran into the same problem starting a couple of weeks ago. I use ActiveState perl, so I tried installing Strawberry perl, but got the same problem w/ Strawberry. I also saw the zero length files getting created. This is happening on multiple machines. One is Winver 1909 and the other is 21H2.
A workaround is to use the full path for the program you want to run.
You can also insert the full path to cmd.exe ahead of the program. Try this:

$temp = `$ENV{COMSPEC} /c date /T`;
print "\$temp = $temp";

I've been assuming this was due to a W10 security update, but I really do not know the cause. I am going to write a sub called Backticks() that I could use like this:

print Backticks('date /T');

sub Backticks would return $ENV{COMSPEC} /c @_.
This is a hack, but at this point I do not know what else to do.

听你说爱我 2025-02-11 11:52:36

使用Malwarebytes Beta(4.5.10.200)版本为我解决了此问题。

Using the Malwarebytes beta (4.5.10.200) version fixes this problem for me.

裂开嘴轻声笑有多痛 2025-02-11 11:52:36

从大约10天前开始,我遇到了同样的问题。我认为这与路径有关,但似乎还可以。问题是在两台机器上:Win10和Win11。我几天前才购买的Win11 PC,安装草莓并进行了测试。我调用系统(..)时相同的错误。
我发现的短期解决方案是从C:\ Windows \ System32复制cmd.exe到脚本运行的目录。这不是一个好的解决方案,但它使我度过一天。我怀疑这是过去几周Windows进行的一些安全更新。

更新6/15/22:我可以确认Malwarebytes beta(4.5.10.200)版本修复了此问题。但是,在安装恶意软件之前,我在Win11 PC上遇到了这个问题。也许这是Windows安全性的问题?

I ran into the same problem starting about 10 days ago. I thought it had to do with path, but it appears ok. Problem is on 2 machines: Win10 and Win11. The Win11 PC I just purchased a couple of days ago, install strawberry and tested. Same error when I call system(..).
Short term solution I found is to copy cmd.exe from c:\windows\system32 into the directory where the script is running. Not a good solution, but it gets me through the day. I suspect it's some security update made in windows in the past couple of weeks.

Update 6/15/22: I can confirm that Malwarebytes beta (4.5.10.200) version fixes this. However, I had this problem on my Win11 PC before installing Malwarebytes. Maybe it's a problem with Windows Security?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文