Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.10.1 compile error: ‘AccessorSignature’ is not a member of ‘v8’ #6040

Open
MarioKlebsch opened this issue Jun 7, 2023 · 1 comment

Comments

@MarioKlebsch
Copy link

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

  1. Unpack chronograf-1.10.1.tar.gz
  2. cd chronograf-1.10.1
  3. make

After several C++ warnings, I get a compile error:

  x86_64-pc-linux-gnu-g++ -o Release/obj.target/binding/src/binding.o ../src/binding.cpp '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DBUILDING_NODE_EXTENSION' -I/home/mario/.cache/node-gyp/20.2.0/include/node -I/home/mario/.cache/node-gyp/20.2.0/src -I/home/mario/.cache/node-gyp/20.2.0/deps/openssl/config -I/home/mario/.cache/node-gyp/20.2.0/deps/openssl/openssl/include -I/home/mario/.cache/node-gyp/20.2.0/deps/uv/include -I/home/mario/.cache/node-gyp/20.2.0/deps/zlib -I/home/mario/.cache/node-gyp/20.2.0/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++17 -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c
In file included from ../../nan/nan.h:178,
                 from ../src/binding.cpp:1:
../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                       ^~~~~~~~~~~~~~~~~
../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                                        ^
../../nan/nan.h: In function ‘bool Nan::IdleNotification(int)’:
../../nan/nan.h:684:63: warning: ‘bool v8::Isolate::IdleNotificationDeadline(double)’ is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
  684 |     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  685 |         idle_time_in_ms * 0.001);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~                               
In file included from /home/mario/.cache/node-gyp/20.2.0/include/node/v8-initialization.h:13,
                 from /home/mario/.cache/node-gyp/20.2.0/include/node/v8.h:34,
                 from /home/mario/.cache/node-gyp/20.2.0/include/node/node.h:73,
                 from ../../nan/nan.h:58:
/home/mario/.cache/node-gyp/20.2.0/include/node/v8-isolate.h:1293:8: note: declared here
 1293 |   bool IdleNotificationDeadline(double deadline_in_seconds);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’:
../../nan/nan.h:2544:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)’
 2544 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2545 |       name
      |       ~~~~         
 2546 |     , getter_
      |     ~~~~~~~~~      
 2547 |     , setter_
      |     ~~~~~~~~~      
 2548 |     , obj
      |     ~~~~~          
 2549 |     , settings
      |     ~~~~~~~~~~     
 2550 |     , attribute
      |     ~~~~~~~~~~~    
 2551 |     , signature);
      |     ~~~~~~~~~~~~   
In file included from /home/mario/.cache/node-gyp/20.2.0/include/node/v8-function.h:15,
                 from /home/mario/.cache/node-gyp/20.2.0/include/node/v8.h:33:
/home/mario/.cache/node-gyp/20.2.0/include/node/v8-template.h:809:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  809 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/mario/.cache/node-gyp/20.2.0/include/node/v8-template.h:814:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  814 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mario/.cache/node-gyp/20.2.0/include/node/v8-template.h:816:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  816 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/mario/.cache/node-gyp/20.2.0/include/node/v8-template.h:821:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  821 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cpp:284:80: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
  284 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
      |                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cpp:320:80: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
  320 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
      |                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/binding.cpp: At global scope:
/home/mario/.cache/node-gyp/20.2.0/include/node/node.h:1156:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
 1156 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mario/.cache/node-gyp/20.2.0/include/node/node.h:1190:3: note: in expansion of macro ‘NODE_MODULE_X’
 1190 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
  358 | NODE_MODULE(binding, RegisterModule);
      | ^~~~~~~~~~~

Expected behavior:
Compile without error.

Actual behavior:
Compilation Aborte with error.

Environment info:

  • Chronograf version: 1.10.1
  • Other relevant environment details: Linux, Gentoo,x86_64-pc-linux-gnu-g++ (Gentoo 12.2.1_p20230428-r1 p2) 12.2.1 20230428
@MarioKlebsch
Copy link
Author

I found this patch: nodejs/nan#942 (comment)

But I am unable to apply it to the source code.
I found the changed files after compilation failed with an error and I changed them as given in the path, but when I re-execute make, the changes are reverted and compilation fails on the same error. :-(

It seems, that the build process gets the file containing the cause of this error, from the internet on each invocation of make.

Unfortunately, I was unable to locate the setting, that causes the malicious file to be loaded and to change it to load a fixed replacement. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant