react-native-blob-util icon indicating copy to clipboard operation
react-native-blob-util copied to clipboard

Some iOS users crash with `SIGABRT: Failed to grow buffer `

Open afilp opened this issue 3 years ago • 7 comments

  • please provide the version of installed library and RN project.
      "react-native": "0.66.2",
    "react-native-blob-util": "^0.13.18",

We have reports from iOS users, that when they start uploading photos/videos (with a single endpoint call) the app crashes.

This is what we get in crash report:

SIGABRT: Failed to grow buffer

Any ideas if this is a bug (seems a low memory issues?) or we can change something for these crashes not to occur?

afilp avatar Feb 03 '22 15:02 afilp

Do you have a line of code for it? It is some kind of problem with the memory allocation, yes. But it could be a wrong length for the data or sth like that.

RonRadtke avatar Feb 04 '22 10:02 RonRadtke

Sorry @RonRadtke, the crash report did not give me the line number of the JS.

afilp avatar Feb 04 '22 18:02 afilp

If I see that error again I will let you know, meanwhile we get reported that users tried to upload for example 34 photos in a direct upload and it managed to download some and then crashed.

Will it help memory-wise to split the single large upload of all files into separate uploads? (one per 2 files for example?)

afilp avatar Feb 08 '22 21:02 afilp

@RonRadtke I have more info on on the line (63) now:

ReactNativeBlobUtilReqBuilder.m, line 63

See also screenshot:

image

I now upload each image and video separately but it appears that this may not be enough.

They are hi-res images, taken from iPhones.

afilp avatar Feb 16 '22 14:02 afilp

Same problem. We've tried some other libraries as well, which end up in the same exception. The problem is reproducible with large files (900MB) on iOS.

aramhovsepyan avatar Mar 02 '22 13:03 aramhovsepyan

I assume that the app can't allocate as much memory as it would have to and thus fails. So the only option would be some way of streaming the file in chunks I think.

RonRadtke avatar Mar 05 '22 16:03 RonRadtke

So the only option would be some way of streaming the file in chunks I think. - How can we do it?

azyd3 avatar Apr 14 '22 10:04 azyd3