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

com.facebook.react.JavaScript (17): EXC_BAD_ACCESS (code=1, address=0xcf9b17) from bytes[m_position++]; #640

Open
nikhilyadavvvv opened this issue Mar 1, 2024 · 2 comments

Comments

@nikhilyadavvvv
Copy link

Following part of the code throws this error

int8_t CodedInputData::readRawByte() {
if (m_position == m_size) {
auto msg = "reach end, m_position: " + to_string(m_position) + ", m_size: " + to_string(m_size);
throw out_of_range(msg);
}
auto *bytes = (int8_t *) m_ptr;
return bytes[m_position++];
}

@mrousavy
Copy link
Owner

mrousavy commented Mar 1, 2024

Please add more information or I'd have to close this issue. I need logs and reproduceable example.

@nikhilyadavvvv
Copy link
Author

nikhilyadavvvv commented Mar 1, 2024

static storage = new MMKV(); async cacheStream( sid: string, ops: any[], ) { const key = stream-${sid}; console.log('set', key); let storedData = DataStorage.storage.getString(key); let data = storedData ? JSON.parse(storedData) : []; data = [...data, ...ops]; DataStorage.storage.set(key, JSON.stringify(data)); return true; }

the length of ops can be huge. The storage works great in the case of 400K ops (the second largest I tested). But the largest ops array that I need to cache is larger than 5 million ops and in that case, I receive this error.
Is there a hard limit to how much data can be stored?
The error was thrown while testing on a real device (iPhone 15pro in my case) on simulators it works as intended.

Even if the issue cannot be fixed I am extremely grateful for your RN efforts and especially MMKV. (I really need MMKV for the system I am working with because the latency optimizations are extremely critical for the project)

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