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

NVSTORE deinit function doesn't free memory #8513

Closed
jeromecoutant opened this Issue Oct 23, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@jeromecoutant
Copy link
Contributor

jeromecoutant commented Oct 23, 2018

Description

Got this test failed during ST CI tests :

Target Toolchain Test_ID/TestSuite Test_Description/TestCase Status
NUCLEO_F070RB ARM features-storage-nvstore-tests-nvstore-functionality NVStore: Multiple thread test ERROR
NUCLEO_F072RB ARM features-storage-nvstore-tests-nvstore-functionality NVStore: Multiple thread test ERROR

Console log:

[1540096136.96][CONN][RXD] >>> Running case #3: 'NVStore: Multiple thread test'...
[1540096137.01][CONN][INF] found KV pair in stream: {{__testcase_start;NVStore: Multiple thread test}}, queued...
[1540096144.03][CONN][RXD]
[1540096144.03][CONN][RXD]
[1540096144.06][CONN][RXD] ++ MbedOS Error Info ++
[1540096144.11][CONN][RXD] Error Status: 0x8001011F Code: 287 Module: 1
[1540096144.15][CONN][RXD] Error Message: Operator new[] out of memory
[1540096144.15][CONN][RXD]
[1540096144.17][CONN][RXD] Location: 0x800A5CB
[1540096144.20][CONN][RXD] Error Value: 0x104
[1540096144.29][CONN][RXD] Current Thread: Id: 0x20001F20 Entry: 0x800BB91 StackSize: 0xC00 StackMem: 0x20001320 SP: 0x20001CE0
[1540096144.39][CONN][RXD] For more info, visit: https://armmbed.github.io/mbedos-error/?error=0x8001011F
[1540096144.40][CONN][RXD] -- MbedOS Error Info --

Analysis

It seems that issue comes there :

ret = nvstore.deinit();
TEST_ASSERT_EQUAL(NVSTORE_SUCCESS, ret);
ret = nvstore.init(); ==> Operator new[] out of memory

It seems that the deinit function doesn't deallocate the memory,
as in the next init, some memory is missing ?

@geky @davidsaada

Issue request type

[ ] Question
[ ] Enhancement
[x] Bug

@ciarmcom

This comment has been minimized.

Copy link
Member

ciarmcom commented Oct 23, 2018

@ciarmcom ciarmcom added the mirrored label Oct 23, 2018

@davidsaada

This comment has been minimized.

Copy link
Contributor

davidsaada commented Dec 6, 2018

@jeromecoutant Working on it now. Seems like deinit is not the problem, but will need to make sure.

@davidsaada

This comment has been minimized.

Copy link
Contributor

davidsaada commented Jan 7, 2019

@jeromecoutant Is this reproduced?

@jeromecoutant

This comment has been minimized.

Copy link
Contributor Author

jeromecoutant commented Jan 18, 2019

Hi

Found some new information:

In my mbed_app.json, got:
"macros": ["MBED_ALL_STATS_ENABLED" ],
Result is:

Total Static RAM memory (data + bss): 10948(+0) bytes

[1547817403.87][CONN][RXD] >>> Running case #3: 'NVStore: Multiple thread test'...
[1547817404.12][CONN][RXD] Not enough heap space to run test. Test skipped

I changed to
"macros": [],
Result is:

Total Static RAM memory (data + bss): 10236(+0) bytes

[1547817055.99][CONN][RXD] >>> Running case #3: 'NVStore: Multiple thread test'...
[1547817056.22][CONN][RXD] ++ MbedOS Error Info ++
[1547817056.27][CONN][RXD] Error Status: 0x8001011F Code: 287 Module: 1
[1547817056.28][CONN][RXD] Error Message: Operator new[] out of memory
@davidsaada

This comment has been minimized.

Copy link
Contributor

davidsaada commented Jan 21, 2019

Thanks @jeromecoutant managed to reproduce it (by simulating a memory restricted board). Trying to find the root cause now.

@davidsaada

This comment has been minimized.

Copy link
Contributor

davidsaada commented Jan 21, 2019

@jeromecoutant Please check whether #9445 resolves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.