AdditionAgentRAM - an unused piece of memory?

  • 32 Replies
  • 5923 Views
*

Offline reyalp

  • ******
  • 10905
Re: AdditionAgentRAM - an unused piece of memory?
« Reply #30 on: 29 / November / 2013, 21:33:25 »
Advertisements
In trunk changeset 3253 I replaced with old suba size_total and alloc_total with fields equivalent to the dryos meminfo values, and also added allocated_count.

The old suba values were not very meaningful, and were not used elsewhere in the suba code. alloc_total, free_total and size_total were counters over the lifetime of the suba pool, so for example alloc_total represented the total number of bytes ever allocated, regardless of whether they were freed.

Aside from possibly providing useful diagnostics, this makes the "combined" meminfo fields more meaningful.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 3464
Re: AdditionAgentRAM - an unused piece of memory?
« Reply #31 on: 28 / December / 2016, 12:14:38 »
Issue:

Executing a Canon Basic script can cause memory corruption and camera crash when CHDK is loaded.

Affected cameras:

Ports that use the memory area named "AdditionAgentRAM" (short: ARAM).
To find out whether a particular port is affected, see whether OPT_ARAM_MALLOC is defined in the port's makefile.inc file (platform/camera/makefile.inc or platform/camera/sub/xxx/makefile.inc).
Alternatively, use the "Module Inspector" utility in the CHDK menu: Miscellaneous stuff -> Modules -> Module Inspector, and look for a line starting with "ARAM:".


original post follows

This "unused piece of memory" caused me a bit of a nasty surprise*. While trying to find out why the new port I'm working on dies with various signs of memory corruption, I accidentally found out that Canon Basic does use the AdditionAgent area.
On this particular model (D6, r57), ARAM between +0x10000 and +0x1ef8f is erased and apparently used by CBasic.
It could be that earlier camera generations are also affected...

*Of course, I was loading the CHDK core to ARAM and wanted to run a memory dumper CBasic script. Camera was stable until I pressed SET to run the script. Took me several days to recognize...

edit:
post restructured to provide better explanation for readers redirected from wikia
« Last Edit: 18 / February / 2017, 07:40:51 by srsa_4c »

*

Offline reyalp

  • ******
  • 10905
Re: AdditionAgentRAM - an unused piece of memory?
« Reply #32 on: 28 / December / 2016, 17:58:13 »
Quote
It could be that earlier camera generations are also affected...
Seems likely. On D10 for example, the LoadScript eventproc goes calls the same function that the ARAM addresss comes from.

I guess this only happens when a script is run, not just from having the script disk flag and extend.m present. Still, perhaps a good reason not to enable ARAM on cameras that don't otherwise need it (which I have been doing up to now)
Don't forget what the H stands for.

 

Related Topics