pussuw commented on PR #2159:
URL: https://github.com/apache/nuttx-apps/pull/2159#issuecomment-1782557658
With sched_lock() the address environment is freed
```
// Good, addrenv IS freed
[ 0.050000] [CPU0] addrenv_switch: Addrenv:0->0x8020d7b0, tcb:0x802048b0,
name:CPU0 IDLE
[ 0.100000] [CPU1] addrenv_switch: Addrenv:0->0x8020d7b0, tcb:0x8020d830,
name:/system/bin/init
NuttShell (NSH) NuttX-10.4.0
nsh> free
total used free largest nused nfree
Kmem: 2053120 17632 2035488 2034656 56 3
Page: 4194304 602112 3592192 3592192
nsh> hello
[ 3.980000] [CPU0] addrenv_switch: Addrenv:0x8020d7b0->0x8020dc90,
tcb:0x8020d830, name:/system/bin/init
[ 3.980000] [CPU0] addrenv_switch: Addrenv:0x8020dc90->0x8020d7b0,
tcb:0x8020d830, name:/system/bin/init
[ 3.980000] [CPU0] addrenv_switch: Addrenv:0x8020d7b0->0x8020dc90,
tcb:0x8020d830, name:/system/bin/init
[ 4.010000] [CPU0] addrenv_switch: Addrenv:0x8020dc90->0x8020d7b0,
tcb:0x8020d830, name:/system/bin/init
[ 4.010000] [CPU0] addrenv_switch: Addrenv:0x8020d7b0->0x8020dc90,
tcb:0x8020d830, name:/system/bin/init
[ 4.010000] [CPU0] addrenv_switch: Addrenv:0x8020dc90->0x8020d7b0,
tcb:0x8020d830, name:/system/bin/init
[ 4.020000] [CPU0] addrenv_switch: Addrenv:0x8020d7b0->0x8020dc90,
tcb:0x8020dd10, name:hello
nsh> [ 4.650000] [CPU0] addrenv_switch: Addrenv:0x8020dc90->0x8020d7b0,
tcb:0x8020d830, name:/system/bin/init
f[ 4.650000] [CPU1] addrenv_destroy: Destroy:0x8020dc90
ree
total used free largest nused nfree
Kmem: 2053120 17632 2035488 2034656 56 3
Page: 4194304 602112 3592192 3592192
nsh> hello
[ 10.780000] [CPU0] addrenv_switch: Addrenv:0x8020d7b0->0x8020dc90,
tcb:0x8020d830, name:/system/bin/init
[ 10.790000] [CPU0] addrenv_switch: Addrenv:0x8020dc90->0x8020d7b0,
tcb:0x8020d830, name:/system/bin/init
[ 10.790000] [CPU0] addrenv_switch: Addrenv:0x8020d7b0->0x8020dc90,
tcb:0x8020d830, name:/system/bin/init
[ 10.810000] [CPU0] addrenv_switch: Addrenv:0x8020dc90->0x8020d7b0,
tcb:0x8020d830, name:/system/bin/init
[ 10.810000] [CPU0] addrenv_switch: Addrenv:0x8020d7b0->0x8020dc90,
tcb:0x8020d830, name:/system/bin/init
[ 10.810000] [CPU0] addrenv_switch: Addrenv:0x8020dc90->0x8020d7b0,
tcb:0x8020d830, name:/system/bin/init
[ 10.810000] [CPU0] addrenv_switch: Addrenv:0x8020d7b0->0x8020dc90,
tcb:0x8020dd10, name:hello
nsh> [ 13.970000] [CPU0] addrenv_switch: Addrenv:0x8020dc90->0x8020d7b0,
tcb:0x8020d830, name:/system/bin/init
f[ 13.970000] [CPU1] addrenv_destroy: Destroy:0x8020dc90
ree
total used free largest nused nfree
Kmem: 2053120 17632 2035488 2034656 56 3
Page: 4194304 602112 3592192 3592192
nsh>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]