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

samples/ffi/http not work.NativeCallable.listener not work #55711

Open
mochunshuang opened this issue May 14, 2024 · 5 comments
Open

samples/ffi/http not work.NativeCallable.listener not work #55711

mochunshuang opened this issue May 14, 2024 · 5 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. library-ffi P3 A lower priority bug or feature request triaged Issue has been triaged by sub team

Comments

@mochunshuang
Copy link

i find c side callback error just when in new thread.
i think my code wrong but may be not.

i pull this project add test samples/ffi/http example
crash as same.

window10 desktop,dart3.19.this console output:
flutter: Sending GET request...
Lost connection to device.

@lrhn lrhn added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. library-ffi labels May 14, 2024
@mkustermann
Copy link
Member

/cc @liamappelbe

@liamappelbe
Copy link
Contributor

@mochunshuang Can you give us more information?

  • What command did you run to run the example?
  • Did you build the fake_http.dll library successfully?
  • It sounds like you're running it using flutter. Can you post your flutter doctor -v output?
  • Since it printed "Lost connection to device.", does that mean you're running the example on a mobile device? What device is ir running on?
  • Do you have a stack trace for the crash?

@liamappelbe liamappelbe added the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label May 15, 2024
@mochunshuang
Copy link
Author

@liamappelbe dart get crush and flutter no.Here is the response to your question:

Did you build the fake_http.dll library successfully?
successfully.
CMakeLists.txt
add_library(fake_http SHARED fake_http.cc ) set_target_properties( fake_http PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF )
image

What command did you run to run the example?
vscode-idea or dart .\http.dart
image
image
image
image

It sounds like you're running it using flutter. Can you post your flutter doctor -v output?
image

Since it printed "Lost connection to device.", does that mean you're running the example on a mobile device? What device is ir running on?
no mobile device.
image

Do you have a stack trace for the crash?
no crash
image

@mochunshuang
Copy link
Author

@liamappelbe
Win10 operating system. I am using the highest version SDK. Can the Windows operating system use the Win11 SDK?
image

@mochunshuang
Copy link
Author

@liamappelbe crush by the line: calloc.free(responsePointer); After commenting out all this line of code, it can run, but it will cause a memory leak;ffi2.1.2;
image

@aam aam added the triaged Issue has been triaged by sub team label May 15, 2024
@aam aam added the P3 A lower priority bug or feature request label May 15, 2024
@github-actions github-actions bot removed the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. library-ffi P3 A lower priority bug or feature request triaged Issue has been triaged by sub team
Projects
None yet
Development

No branches or pull requests

5 participants