执行时无法解析遇到的羊群错误

发布于 2025-02-13 04:32:09 字数 951 浏览 0 评论 0 原文

在调用Perl解释器并调用Perl Subroutine的CPP中执行自动单元测试时遇到以下错误 这是代码段: -

sub perlflock {
my $xsptr = shift;
my $self = shift;
my ($file, $use_locking) = @_;
logcroak "not a reference" unless ref($self);
logcroak "wrong argument number" unless @_ == 2;    # No @foo in arglist
local *FILE;
if ($use_locking) {
    open(FILE, ">>", $file) || logcroak "can't write into $file: $!";
    unless (1) {
        logcarp
          "Storable::lock_store: fcntl/flock emulation broken on $^O";
        return undef;
    }
    flock(FILE, LOCK_SH | LOCK_NB) ||
      logcroak "can't get exclusive lock on $file: $!";
    truncate FILE, 0;
    # Unlocking will happen when FILE is closed
} else {
    open(FILE, ">", $file) || logcroak "can't create $file: $!";
}

frl-plugin:perlscript:error:被操作蒙版捕获的“羊群”,at/usr/lib64/perl5/vendor_perl/storable.pm第271行。 汇编失败了,请访问/usr/share/perl5/vendor_perl/const/fast.pm第15行。 汇编失败了。 开始失败 - 编译流产。

encountered below error when executing the automated unit testing in cpp that invoked the perl interpreter and calls the perl subroutine
this is the code snippet :-

sub perlflock {
my $xsptr = shift;
my $self = shift;
my ($file, $use_locking) = @_;
logcroak "not a reference" unless ref($self);
logcroak "wrong argument number" unless @_ == 2;    # No @foo in arglist
local *FILE;
if ($use_locking) {
    open(FILE, ">>", $file) || logcroak "can't write into $file: $!";
    unless (1) {
        logcarp
          "Storable::lock_store: fcntl/flock emulation broken on $^O";
        return undef;
    }
    flock(FILE, LOCK_SH | LOCK_NB) ||
      logcroak "can't get exclusive lock on $file: $!";
    truncate FILE, 0;
    # Unlocking will happen when FILE is closed
} else {
    open(FILE, ">", $file) || logcroak "can't create $file: $!";
}

frl-plugin:perlscript: ERROR: 'flock' trapped by operation mask at /usr/lib64/perl5/vendor_perl/Storable.pm line 271.
Compilation failed in require at /usr/share/perl5/vendor_perl/Const/Fast.pm line 15.
Compilation failed in require.
BEGIN failed--compilation aborted.

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

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

发布评论

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

评论(1

真心难拥有 2025-02-20 04:32:09

This error is the result of using flock from inside a Safe compartment for which the flock operator hasn't been added as permitted operation.

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