recodedesign node.js 运行时获取权限错误?

问题描述 投票:0回答:1

出于某种原因,我需要重新设计 node.js。

我尝试用我自己的 mac appId 和命令重新设计 node.js

codesign --deep --timestamp --options runtime -f -s 'Developer ID Application: xxxxxxxx' ~/Library/Keychains/login.keychain-db  node
.

一切看起来都很好,我可以用命令看到节点的签名

codesign -d -vvvv node

但是当我用

node -p 'process'
运行 recodesign node.js 时,我得到了这个错误:

#
# Fatal error in , line 0
# Check failed: reservation_.SetPermissions(unprotect_start, unprotect_size, FLAG_write_code_using_rwx ? PageAllocator::kReadWriteExecute : PageAllocator::kReadWrite).
#
#
#
#FailureMessage Object: 0x7ff7bc3c2a50
 1: 0x103c7c5e2 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/usr/local/lib/gsf/bin/node]
 2: 0x104d68133 V8_Fatal(char const*, ...) [/usr/local/lib/gsf/bin/node]
 3: 0x103fbb4d4 v8::internal::MemoryChunk::SetCodeModificationPermissions() [/usr/local/lib/gsf/bin/node]
 4: 0x103f38f89 v8::internal::Heap::UnprotectAndRegisterMemoryChunk(v8::internal::MemoryChunk*, v8::internal::UnprotectMemoryOrigin) [/usr/local/lib/gsf/bin/node]
 5: 0x103f0c8ac v8::internal::Heap::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/lib/gsf/bin/node]
 6: 0x103f3ed01 v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/lib/gsf/bin/node]
 7: 0x103f0b810 v8::internal::Factory::CodeBuilder::AllocateCode(bool) [/usr/local/lib/gsf/bin/node]
 8: 0x103f0afa9 v8::internal::Factory::CodeBuilder::BuildInternal(bool) [/usr/local/lib/gsf/bin/node]
 9: 0x103de1ea3 v8::internal::baseline::BaselineCompiler::Build(v8::internal::Isolate*) [/usr/local/lib/gsf/bin/node]
10: 0x103df4063 v8::internal::GenerateBaselineCode(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SharedFunctionInfo>) [/usr/local/lib/gsf/bin/node]
11: 0x103e2e1c7 v8::internal::Compiler::CompileSharedWithBaseline(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SharedFunctionInfo>, v8::internal::Compiler::ClearExceptionFlag, v8::internal::IsCompiledScope*) [/usr/local/lib/gsf/bin/node]
12: 0x103e2e553 v8::internal::Compiler::CompileBaseline(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Compiler::ClearExceptionFlag, v8::internal::IsCompiledScope*) [/usr/local/lib/gsf/bin/node]
13: 0x103dde048 v8::internal::baseline::BaselineBatchCompiler::CompileBatch(v8::internal::Handle<v8::internal::JSFunction>) [/usr/local/lib/gsf/bin/node]
14: 0x103dddf87 v8::internal::baseline::BaselineBatchCompiler::EnqueueFunction(v8::internal::Handle<v8::internal::JSFunction>) [/usr/local/lib/gsf/bin/node]
15: 0x1042f0861 v8::internal::(anonymous namespace)::BytecodeBudgetInterruptFromBytecode(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>) [/usr/local/lib/gsf/bin/node]
16: 0x1042ef453 v8::internal::Runtime_BytecodeBudgetInterruptFromBytecode(int, unsigned long*, v8::internal::Isolate*) [/usr/local/lib/gsf/bin/node]
17: 0x1046adff9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/lib/gsf/bin/node]

下面是我的重新设计脚本:


# download node.js
curl https://nodejs.org/dist/v17.8.0/node-v17.8.0-darwin-arm64.tar.xz -o node-v17.8.0-darwin-arm64.tar.xz

tar -xJf node-v17.8.0-darwin-arm64.tar.xz

cd node-v17.8.0-darwin-arm64/bin

codesign --deep --timestamp --options runtime -f -s 'Developer ID Application: xxxxxxx Company Limited (xxxxxxxxx)' ~/Library/Keychains/login.keychain-db  node

codesign -d -vvvv node

导致错误的原因是什么?

如何解决这个错误?

谢谢

node.js macos codesign
1个回答
0
投票

我用 blow 命令重新设计了 node.js,它看起来工作正常。

codesign --deep --timestamp --preserve-metadata=entitlements --options runtime -f -s 'Developer ID Application: xxxxxxxx' --entitlements node.entitlements ~/Library/Keychains/login.keychain-db node

--preserve-metadata=entitlements
是关键。

为什么有人投票

This question does not show any research effort; it is unclear or not useful
。我研究了这个问题很长时间。如果你觉得这个问题没用,那你为什么不知道如何解决这个问题?

这些自以为是的家伙真烦人

© www.soinside.com 2019 - 2024. All rights reserved.