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

memory allocation failed #54

Closed
Ladbaby opened this issue Oct 24, 2023 · 9 comments
Closed

memory allocation failed #54

Ladbaby opened this issue Oct 24, 2023 · 9 comments

Comments

@Ladbaby
Copy link

Ladbaby commented Oct 24, 2023

First of all, Thanks for making this amazing app, I absolutely love it!

The problem occurred when I try to transfer from Android 13 to Ubuntu 22.04 LTS, a 818 MB .mp4 video file, the Linux app crashed after the Android had connected to the hotspot:

$ flying-carpet                                 
memory allocation of 3511553999805349888 bytes failed
[1]    30333 IOT instruction  flying-carpet

Version information:

  • Android: v7.1 from Google Play
  • Linux: v7.1 AppImage version

In fact, the .deb version of Linux client also suffered from the same issue.

Also, I tried a 9.8MB .jpg file, which is smaller, and it succeeded.

PS: I also met the same problem as in #51. Although I'm a Windows user most of the time, it would be great if FlyingCarpet can also work flawlessly under Linux (like it does under Windows)

@spieglt
Copy link
Owner

spieglt commented Oct 24, 2023

Thanks for the kind words! Very unfortunate to see an allocation error like that though.... Can you possibly send me the exact size in bytes of the .mp4 so I can reproduce? This and #51 are next on my list.

@Ladbaby
Copy link
Author

Ladbaby commented Oct 25, 2023

It's 817597378 bytes in size (info from wc -c). Glad to hear the progress on fixing them :)

@spieglt
Copy link
Owner

spieglt commented Oct 25, 2023

I'm not able to replicate so far. Could you please send the output of the both sides when it crashes? Does changing the filename to file.mp4 change the behavior?

@Ladbaby
Copy link
Author

Ladbaby commented Oct 26, 2023

Oh it's the file name that caused the error! Sorry for my misleading

I tried several file names, maybe it's caused by non-ASCII characters:

  • 文字 2023.mp4: original file name, failed
  • 文字.mp4: only the non-ASCII characters, failed with the same error above
  • 2023.mp4: succeeded
  • 2023 12.mp4: a name contains a space, succeeded
  • file.mp4: succeeded

As for the output, the Linux client crashed and leave the above memory allocation failed error in the terminal, and the Android client's last output is Transfer error: Connection reset

There's one more special case when the file name is only 1 non-ASCII character 我.mp4 (the original file name contains 2), the Linux client's GUI didn't crash, and the output is:

Starting hotspot flyingCarpet_458d
Waiting for connection...
Connection accepted
=========================
Receiving file 1 of 1.
Filename: 我.m
File size: 8085087231.04GB

the file size is wrong, also the filename is missing the p4 at the tail. The output from the terminal is also different:

thread 'tokio-runtime-worker' panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:524:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The Android client output the same Transfer error: Connection reset error in this case

@spieglt
Copy link
Owner

spieglt commented Oct 26, 2023

Not misleading at all, very grateful for you uncovering the bug. I found the problem, I wasn't handling the size of non-ASCII strings properly on Android. I'll fix it and get an updated Android version out soon. I should probably also move to a more mature transfer protocol at some point. Thanks again!

@Ladbaby
Copy link
Author

Ladbaby commented Oct 26, 2023

My pleasure, looking forward to the update!

@spieglt
Copy link
Owner

spieglt commented Oct 27, 2023

Version 7.2 is available on the releases page and should be on the Play Store soon. Please let me know if this fixes the filename issue, thanks!

@Ladbaby
Copy link
Author

Ladbaby commented Oct 27, 2023

Have tried the Version 7.2 of Android client, and I'm pretty sure it fixes the filename issue (even tried filename with emoji 文字🌍.mp4). Thanks for your active maintenance👍

@spieglt
Copy link
Owner

spieglt commented Oct 27, 2023

Closing this since the other issue is being tracked in #51.

@spieglt spieglt closed this as completed Oct 27, 2023
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

2 participants