Raspberry Pi shutdown destroys file system - crash

I trying to write a small c program witch reads out an GPIO pin to shutdown the pi externally. The triggering of the signal is working well. The program is started by LXDE as autostart application. If the program detects the shutdown signal it's performing:
sync();
system("halt");
Why does this program damage my ext4 file system after a couple of reboots. There is no fixed number of reboots necessary to damage the system. I don't see any difference by writing halt to command line. I'm using the newest version of the firmware(last update today) and also the kernel is up to date(last update today).
Does anybody have an good idea about it?

This app is a good idea, i wonder nothing like this is already existing...
I think the problem is the "halt" command.
You shuold use the explicit command "shutdown -h now" instead.
For further reading see Anthony Lawrence

Related

Expo run from WSL causes my internet to drop out

A react native expo app run within WSL, is the cause of a very annoying bug.
A few minutes after starting the Expo project, the internet on the windows laptop stops working.
I found this command fixes it:
Restart-Service LxssManager - when run from Powershell
However, this happens many times a day and means I have to restart the Expo project every time.
Related to: https://askubuntu.com/questions/1203412/wsl-causing-my-internet-to-not-work
Equally crazily, the fingerprint sensor on my laptop stops working and works again after that command is run.
I suspect the issue is somehow related to a very short (2-5 minute) timeout related to the react native app.
If anyone is able to point in any direction, I would love any help.
Maybe it's Expo or maybe I have some kind of local app code error. But I wouldn't know where to even start or test a bug like that.
Here is a basic run-through of what happens.
Start Expo app in WSL
Work, for an indefinite time
If PC activity pauses for longer than 3 min, the error happens. No internet, no fingerprint sensor.
Run the PowerShell command, restart the app. All is good again.
This is a known bug in WSL. Microsoft has solved this bug in build 18890. https://github.com/MicrosoftDocs/WSL/blob/live/WSL/release-notes.md#build-18890
It happens when a process in WSL creates and closes a large number of non-blocking TCP sockets, and after that some ephemeral TCP ports are leaked, eventually exhausting all ephemeral ports in both the host and the WSL.
You can try upgrading your system to version 2004 or 20H2 and see if this problem persists.

Close qemu from a process in xv6

I started learning xv6 recently and was trying to implement a shutdown mechanism in xv6 and i was able to kill all the process running gracefully and wait for some of them to finish and then terminate them. But i am not able to close qemu from the shutdown process.
Could someone suggest how to close qemu from a a xv6 process?
I googled and found out someone used 'outb' and 'outw' commands but both of them don't work.
I don't know if I fully understood your question, but to close the xv6 process running with qemu I use the key combination CTRL + A--> C
It then should show you the (qemu) terminal line that you can close with the command "q".
I am running xv6 in ubuntu OS, for me to close qemu following command worked "control+a, release both keys and type x".
In QEMU, "exit the QEMU process" happens when the guest powers down the emulated hardware. So your guest OS 'shutdown' needs to work by doing the correct hardware operations to power down. (How that is done depends on what hardware QEMU is emulating -- for instance some Arm boards don't have any mechanism for software controlled powerdown at all. Check the documentation for the relevant hardware.)

Raspberry Pi Raspbian Mono Program Shutoff

I am currently running a VB application through mono on Raspbian. After a bit of troubleshooting the program boots and appears to be running quite well. However if left to itself for a few minutes the VB application just shuts off. This program runs excellently on the windows pc for any duration. Barring this being an issue with the VB code itself is there any major PI related issues that I may have missed in setting up mono? I set up mono the usual way and am launching via "sudo mono app.exe" in terminal.
Thank you for any insight you may provide into this!
UPDATE: mono just FINALLY threw out an errot to me System.OutOfMemoryException : Not enough memory to complete operation [GDI+ status: out of memory]
UPDATE2: Memory leak, its a code related issue.
Hi to anyone else that runs into this issue. For us it was a memory leak.

Problems with Octave on Windows 8: crashes after any error

I have installed (and re-installed) Octave 3 times on Windows 8, and I still can't get it right. The first and most obvious problem is that the prompt is missing; the screen only shows the flashing underscore that follows the prompt. This is not a major problem since the system properly responds to commands.
The major problem is that Octave crashes whenever it encounters a syntax error, instead of politely giving a diagnostic. This makes for extremely tedious software development.
Is there a way around this problem, or do we just have to wait for one side or the other to come up with an accommodation?
I encountered the same problem. I solved it by this:
create a shortcut to octave.exe, then right click->property-> change the "target" to something like:
C:\Program Files\Octave\Octave3.6.*_gcc*.*.*\bin\octave.exe -i --line-editing
Then it won't exit if u have syntax errors.
I don't understand the meaning of the parameters yet.
reference:
http://exciton.eo.yzu.edu.tw/~lab/?p=1121
Type octave --help can check the meaning of parameters.
-i also --interactvie, to force Octave interactive behavior.
Maybe Octave run at non-interactive mode at default, that means prompt should not be shown and it should terminate immediately when encountered error when reading a file.
I don't know if this will solve your problem, or if this is too bloated of a solution for you, but I use Octave on Windows 7 through Cygwin without any problems.
If you can't get Octave to run on Windows 8, you may consider running Octave through Linux via computer virtualization technology (virtual computer). Two, off the top of my head that you could use are VirtualBox by Oracle or VMWare Player
Once you have it installed, you can go to any number of sites that have pre-built Linux images that you can download and then run inside of Windows 8.X. Do a Google search of for 'Virtualbox images' or as 'VMWare appliances'. You can then download and use that to run the lastest version of Octave. I hope that helps.
Cheers,

avrdude xmega256a3 can't program usersig?

I use avrdude on osx to do development for an xmega256a3. It's wonderful, it lets me flash my target just fine. However, when I try to use it to program the usersig block, it doesn't work so well. I was initially excited by some early success with it, but found subsequent flashes weren't working.
Through testing, I determined that if my usersig file was for all 0's, it worked fine. But all FF's didn't work. Given what little I know about flash, these leads me to believe that I'm either missing an option or avrdude isn't doing a complete job for what it needs to do here.
The command I'm using is
avrdude -p atxmega256a3 -P usb -c avrispmkii -e -U usersig:w:mySig.hex
Using AVR Studio 4 on a Windows box, I am able to program any of these files to the usersig flash block.
My question boils down to is this possible? if so what option/incantation am I missing? Or am I out of luck for programming usersig for this processor with avrdude?
(I'm using version 5.11.1 from the CrossPack guys)
It turns out that old versions of avrdude indeed did not support this. It requires a page erase of usersig, and that was not supported until version 6, which is due out soon. I've tested with svn builds of it, and with a two line patch submitted to day, it does the job.