Pi shutdown, restart - cannot move memory
Pages: 1 2
Richard Walker (2090) 416 posts |
Hi all Is this just me? I have seen past threads on this, but no solid answer. If I use the shutdown option, then press Restart, RISC OS will lock solid with ‘cannot move memory’. Seems to coincide with an RTC being fitted. My ROM and firmware are from some time last month, and on a Pi B+. Have I configured something wrongly, or is it a bug? |
Jon Abbott (1421) 2599 posts |
Instead of pressing Restart, drop to the command line and then go back into the desktop. Examine the list of running tasks, one of them more than likely has an issue in its shutdown or service handler code, in the case of Module tasks. If it’s definitely occurring when an RTC is fitted, try killing its software before a restart…probably a Module I would guess. ‘Cannot move memory’ is one of those ambiguous errors that could be caused by just about anything that blocks memory page movement, be it on purpose or a bug. I’ve managed to create it at shutdown in the past, by specifying the wrong Wimp version at Wimp_Initialise – I’ve no idea why that would trigger it! |
Richard Walker (2090) 416 posts |
Ah yes, I forgot to mention, sorry… If I do RMKill RTC before I do a shutdown, then I don’t get the problem. However, I had totally forgotten about the CLI still being available, and being able to re-enter the desktop, so I will have a poke around. Thanks. |
Jon Abbott (1421) 2599 posts |
Almost certainly a issue in the RTC Module then. Assuming this is the correct source code, it doesn’t have a Wimp task, so possibly an issue with the callback to Recalibrate or Recalibrate itself? |
Chris Mahoney (1684) 2100 posts |
There’s also this, although not having an RTC myself I can’t say whether this is the correct code or not :) Edit: The one I linked is in the Pi’s BCM2835Dev archive, but the one you linked isn’t. |
Richard Walker (2090) 416 posts |
Yes, according to https://www.riscosopen.org/viewer/view/Products/BCM2835Dev/modules?rev=1.27 then the module responsible is that one (RTC), so I suspect RTCAdjust is obsolete. Looks like the ‘new way’ is for the RTC module to talk to the HAL, so it is up to each HAL to provide an RTC interface. Makes sense, really. Questions: 1. Does anyone else get this error? |
Rick Murray (539) 13405 posts |
Yes, maybe. Pi1 with CJE RTC I would get this seemingly randomly on shutdown. Pi3 (ARMv7) with the same RTC transplanted, I do not recall seeing this yet, however I can probably count the number of controlled shutdowns on the fingers of one hand. It’s my development machine, it’s also a server, so I don’t tend to shut it down for much other than backing up the SD and thunderstorms, and we haven’t had many of those recently (thankfully). Now, uncontrolled shutdowns, that’s a different matter. :-) Perhaps we ought to have a list of stuff that is known to nastily kill Aemulor? Allow me to nominate AcornDTP and FCFS… |
Glen Walker (2585) 469 posts |
Yes I do but only since trying and failing to upgrade from 5.23 to 5.24. I’m running a Pi 2. Will keep you posted if the error continues after I successfully complete the upgrade! |
Glen Walker (2585) 469 posts |
Well I re-did the upgrade and the error went away…no idea what caused it but the whole system needed a good thrashing to get it back into a working state so I guess I must have fixed it when some of the files were replaced. |
Richard Walker (2090) 416 posts |
Interesting. Do you know your Pi firmware dates? |
Glen Walker (2585) 469 posts |
The stuff that got me working was downloaded from here on Monday night. I actually use an SSD connected via USB as the boot drive but I created a new SD card image using the official 5.24 release in the “Download” section of this site and then copied the appropriate files into !Boot on the USB SSD using the update tool in the HardDisc4 zip (I was going from 5.23 to 5.24). |
Chris Evans (457) 1614 posts |
So I think the crucial question (as it isn’t 100% repeatable for everyone) is: Has anyone had a “cannot move memory” error when doing a shutdown/restart on a Pi with RTC using 5.24 or 5.25? |
Richard Walker (2090) 416 posts |
Yes, me. Every time, unless I ‘RMKill RTC’ before I press the Restart button. I am using an early 5.25 (Colin’s USB test ROM). I will try updating to the latest Pi firmware and the latest RISC OS build. |
Richard Walker (2090) 416 posts |
I have updated my Pi 1 B+ to the latest firmware and RISC OS ROM. Firmware was from github, dated 9th July 2018. Coincidentally, my RISC OS 5.25 ROM is dated the same. Shutdown, then Restart results in a freeze with ‘cannot move memory’. If I RMKill RTC before I click restart (can even do it after the shutdown) then it doesn’t freeze. For reference, this is my RTC module: https://www.amazon.co.uk/SODIAL-DS3231-AT24C32-Precision-Arduino/dp/B00K67X496 |
Richard Walker (2090) 416 posts |
Browsing the RTC module source,https://www.riscosopen.org/viewer/view/bsd/RiscOS/Sources/HWSupport/RTC/c/rtclock?rev=1.2 I am assuming that pressing Restart will initiate a Service_Reset, so we end up in the first if block in rtclock_service() which is line 424. I could perhaps try disabling some bits to try and narrow it down. |
Jon Abbott (1421) 2599 posts |
Service_Reset is a throwback to RO3, I don’t believe it’s used in RO5, it may not even exist. It used to be called on a soft reset which didn’t clear memory, RO5 only uses hard resets as far as I know – unless there’s some edge case I’m unaware of. |
Jeffrey Lee (213) 6046 posts |
Service_Reset is still used on RISC OS 5 – it’s issued at the end of ROM initialisation. So under RISC OS 5, only ROM modules and podule modules will see it (and maybe territory modules which are loaded by the ROM?). On <3.5 I guess soft resets would have meant that all loaded modules would have seen it. But unless there’s something naughty issuing it on shutdown, it shouldn’t be the cause of any problems with shutdowns on the Pi. (The wiki refers to it as Service_PostReset – I think inherited from the terminology used in the StrongHelp manuals. I haven’t checked what the PRMs call it) |
David Pitt (3386) 1248 posts |
I have just had a "cannot move memory’ event on the RPi3B+ OS5.25 (09-Jul-18) RTC fitted on making a change to cmdline/txt and restarting. It was just a one off a second restart did do a restart. Just in case it is relevant RamFsSize had recently been configured to the maximum of 524288K, previously it had been configured as 128MB. I say this because I managed to get the same error from the Iyonix when forgot where I was and manually set a RamDisc larger than the 128MB RAM in the machine. |
David Pitt (3386) 1248 posts |
On my RPi3B+, OS5.25 (09-Jul-18), with the RTC fitted configuring ‘too big’ a RAM disc causes the “Memory cannot be moved” error on a restart. The biggest RAM disc that avoids the fault is about 426MB, the fault appears with 430MB. Remove the RTC and the issue goes away, a configured 512MB RAM disc is fine. P.S. The RTC gets very hot being above whatever the new, hot, chip with the Pi logo on it is. WiFi? |
Richard Walker (2090) 416 posts |
Interesting. I don’t use a RAM disk at all. I have located an old source tarball, and managed to build my own RTC module. Predictably, disabling those two lines in the service_reset area made no difference at all. Must be more to it. The RTC module must be doing something which causes the restart sequence to blow up (rather than there being something wrong with the RTC module reset sequence). |
David Pitt (3386) 1248 posts |
Disabling RAM disc here is OK, the fault does not occur. Odd!!!! |
David Pitt (3386) 1248 posts |
Not using “Set from the network” in “Time and date” Configuration evades the issue, “Set manually” that is.
So it seems, rmkilling it does avoid the restart error, but OTOH this is a Pi problem, it’s all good on the Titanium with its integral RTC. |
Jon Abbott (1421) 2599 posts |
Its starting to sound like a memory leak or bug in the OS to me. On the face of it the RTC Module doesn’t do anything that will block memory moves. |
John Sandgrounder (1650) 574 posts |
I am not at all sure if this post helps or not … … but I get the same error "cannot move memory " when I shut down and restart a Pi 2.1 when using Aemulor and EasySockets.I avoid it now by using NoError and F_Restart |
Richard Walker (2090) 416 posts |
OK, so I have ran some more tests. If I create a RAM disc, it makes no difference. However, if I disable the automatic date/time setup (the NetTime module) then I am able to press Restart without the freeze. If I re-enable NetTime and then try to Restart, the freeze is back. As an aside, I can always press CTRL-BREAK at the Restart screen, and it will restart fine. It is just pressing the button which barfs things. So… What does NetTime do to make a difference? What is the difference between the Restart button and CTRL-BREAK? |
Pages: 1 2