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

[BUG] Crash on start (with or without camera connected) #67

Closed
olemartinorg opened this issue Nov 18, 2021 · 5 comments
Closed

[BUG] Crash on start (with or without camera connected) #67

olemartinorg opened this issue Nov 18, 2021 · 5 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@olemartinorg
Copy link

olemartinorg commented Nov 18, 2021

Information

  • Version: 3.0.3
  • libgphoto2 version: 2.5.27-1

When I tried this out today, on my Arch machine, it crashes node instantly when trying to get the first camera - even if there is a camera connected or not.

Example

const CameraList = require("@tsed/gphoto2-driver").CameraList;
new CameraList().load();

Output

$ node -e "const CameraList = require('@tsed/gphoto2-driver').CameraList; new CameraList().load();"
[2021-11-18T01:00:52.878] [DEBUG] [default] - Load library from libgphoto2
[2021-11-18T01:00:52.941] [DEBUG] [default] - Load port info list...


#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: 0x7ffc7817a880
 1: 0x55b4a805e4b3  [node]
 2: 0x55b4a8b4da88 V8_Fatal(char const*, ...) [node]
 3: 0x55b4a848bccc v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptr<v8::internal::BackingStore>) [node]
 4: 0x55b4a81efb4f v8::ArrayBuffer::GetBackingStore() [node]
 5: 0x55b4a7f98976 napi_get_typedarray_info [node]
 6: 0x7fe519bab430  [/home/me/node_modules/ref-struct-napi/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
 7: 0x7fe519bb0f5f Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*) [/home/mef/server/node_modules/ref-struct-napi/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
 8: 0x55b4a7f8f123  [node]
 9: 0x55b4a821ecde  [node]
10: 0x55b4a821f9bf v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x55b4a8a1c6b9  [node]
@olemartinorg olemartinorg added the bug Something isn't working label Nov 18, 2021
@Romakita
Copy link
Collaborator

@olemartinorg The plugin is only supported for nodejs v12. There is a know issue with v14 and higher version here: node-ffi-napi/ref-napi#47

If you downgrade your nodejs version to v12, it should works as expected.

I'm not an expert in C++ and nodejs so I'm not able to fix that. I can try to find another way to manipulate array pointer without using ref-array-napi, but... I'm not sure how I'll doing that. Any help is welcome :)

See you
Romain

@olemartinorg
Copy link
Author

Oh, thanks for the explanation! I'm also not familiar enough with C++ to figure that out. Do what you want with this issue, I found other ways around the problem.

@Romakita
Copy link
Collaborator

Oh ok? What is it?

@olemartinorg
Copy link
Author

I just call gphoto2 on the command line instead. It works well enough, and I've made workarounds for the things that are less than stellar.

@stale
Copy link

stale bot commented Feb 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Feb 11, 2022
@stale stale bot closed this as completed Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants