epanded base image error with reboot loop - desktop

I am stuck in a loop and cannot find a way to get out of it, i.e. stop the failing installation of the container. No matter how I cleared after reboot I get the same error again and again:
"warning 'W_EXPANDED_BASE_IMAGE_EXISTS': An expanded base image by name 'BaseImage-15063'
 already exists"
and
"DesktopAppConverter : error 'E_EXPANDED_BASEIMG_INVALID': ExpandedBaseImage at
'C:\ProgramData\Microsoft\Windows\Images\BaseImage-15063' is not a container image"
I renamed the BaseImage folder to force the process to start cleanly but that did not help; it again failed.
Now I have several huge BaseImage folders.
How do I get rid of these image folder/files which did NOT disappear with any clear command.
Trying to get rid of them as administrator running cmd.exe does not work either: access denied.

Related

filesystem:error cannot remove: Input/output error

I'm trying to delete a font file using this way,
std::filesystem::remove(std::filesystem::path("C:\\Windows\\Fonts\\segmdl2.ttf"));
But this fails and throw an exception,
filesystem:error cannot remove: Input/output error
The exception is not helpful. What's the correct way to delete this kind of files?
Update,
I made an attempt to delete it from Powershell and it throw following error,
del C:\Windows\Fonts\segmdl2.ttf
del : Cannot remove item C:\Windows\Fonts\segmdl2.ttf: Access to the path 'C:\Windows\Fonts\segmdl2.ttf' is denied.
At line:1 char:1
+ del C:\Windows\Fonts\segmdl2.ttf
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\Fonts\segmdl2.ttf:FileInfo) [Remove-Item], UnauthorizedAcc
essException
+ FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand
I even tried to remove it directly from font folder, I'm getting an error that it can't be done because an another application already using the font.
But I was successfully able to delete it from the command prompt.
How does cmd do this?
I need to achieve same level for my app.
The error happened because I don't have permission to delete the file and in some cases it happened because the file already opened by another process.
To fix permission issue, I had to invoke the following commands from command promot,
takeown /f C:\Windows\Fonts /r /d y
icacls C:\Windows\Fonts /grant administrators:F /t
To fix the issue when the file owned by another processs, I've found an application called IOBitUnlocker that capable of doing this without closing the processs so I decided to dig more into it.
I've reverse engineered IOBitUnlocker. They are using a Kernel Mode Driver and uses KeStackAttachProcess to attach into the process that owns the file and unlock it.
I am lucky enough to find an article with complete code that describe how to use this API to unlock the file.
https://www.programmersought.com/article/96107379969/
This method superior because you don't have to close the applications or reboot your machine. Altho, you have to sign the kernel mode driver or disable the driver validation directly from your BIOS.

Invalid compressed data in zip

So as a class project I was trying to build a simple archive cracker. I was simply calling unzip through the shell (using popen) and iterating over a dynamically generated list of words.
Anyways, I setup a test archive with the password "hunter". Now I checked my program with easier passwords and I know it works. However for a lot of "long" passwords, the utility gives a weird error. So I tried, in the case of the above-mentioned archive, manually entering the following passwords:
"pass" - The password dialog reopened, indicating that it was an incorrect password.
"hunter" - The contents of the zip were decompressed in the target forlder.
"dacbe" - I get the error saying "Unable to expand test.zip into "Project" (Error 2 - No such file or directory) or if done via terminal, "Invalid compressed data to inflate".
So I thought maybe it was the utility at fault somehow I switched to Unarchiver, same issue with the same password string. Switched a different third party utility, same issue with the error being "Error on decrunching".
Why is this happening for certain passwords?
I am running macOS 10.12
Unzip has a deliberately weak filter on an entered password to check it for validity. Only one byte of decrypted data is checked, so there is a 1/256 chance of a random password passing that check and proceeding to decompress. As you have discovered, in that case the decompression will soon thereafter detect an erroneous password.

redhawk module service function usage example crashes

So I am building a redhawk module and trying to just pass data through it as a test. After putting their example of how to work with input and output ports into the serviceFunction() I am able to build the module with no errors (I changed variable names to match my ports). When I put the module on the white board and link it up it's fine but as soon as I start the module it crashes. I added a line to write the incoming stream id to the console and that will hit the console 10 to 20 times before the crash (it correctly writes the id of the signal generator that is providing the signal). If I plot the output port nothing is plotted before the crash (when I say crash I mean that the module just disappears from the white board, the ide is still up and running).
The service function is:
int freqModFrTest_i::serviceFunction()
{
bulkio::InFloatPort::dataTransfer *tmp = dataFloatIn->getPacket(bulkio::Const::BLOCKING);
if (not tmp) { // No data is available
return NOOP;
}
else
{
std::cout<<tmp->streamID<<std::endl;
std::vector<float> outputData;
outputData.resize(tmp->dataBuffer.size());
for (unsigned int i=0; i<tmp->dataBuffer.size(); i++) {
outputData[i] = (float)tmp->dataBuffer[i];
}
// NOTE: You must make at least one valid pushSRI call
if (tmp->sriChanged) {
ComplexOut->pushSRI(tmp->SRI);
}
ComplexOut->pushPacket(outputData, tmp->T, tmp->EOS, tmp->streamID);
delete tmp; // IMPORTANT: MUST RELEASE THE RECEIVED DATA BLOCK
return NORMAL;
}
}
Has anyone had a similar issue or any ideas on what would be causing this?
Additional Info:
Following the sugestion by pwolfram I built a sig generator and this component into a waveform. When launching it from a domain I got the error:
2016-01-14 07:41:50,430 ERROR DCE:aa1a189e-0b5b-4968-9150-5fc3d501dadc{1}:1030 -
Child process 3772 terminated with signal 11
when trying to restart the component (as it just stoped rather then disapering) I get the following error:
Error while executing callable. Caused by org.omg.CORBA.TRANSIENT:
Retries exceeded, couldn't reconnect to 10.62.7.21:56857
Retries exceeded, couldn't reconnect to 10.62.7.21:56857
In REDHAWK 2.0.0 I created a component with the same name (freqModFrTest) and port names (dataFloatIn and ComplexOut) and used your service function verbatim. I did not however get any issues.
Here are a few things to try:
Clean and rebuild the component. The Sandbox (what you referred to as the whiteboard) will run the binary that has been built. It is possible that you've modified the code and have an older version of the binary on disk. Right click on the project and select "clean project". Then right click and select "Build Project" this will make sure that the binary matches your source code.
Run the component in debug mode. If you double click on the SPD file, under the "overview" tab there is "Debug a component in the sandbox". This will launch the component in the chalkboard within a debugging context. You can set breakpoints and walk through the code line by line. If you set no breakpoints though the IDE will stop execution when a fatal error occurs. If there is an issue (like invalid memory access) the IDE will prompt you to enter debug mode and it should point out the line in code where the issue is.
If those options fail, you can enable core dumps and use GDB to see where in the code the issue is occurring. There are lots of tutorials online for GDB but the gist is that before launching the IDE, you'll want to type "ulimit -c unlimited" then from the same terminal, launch the IDE. Now when your component dies, it will produce a core file.
Hopefully one of these gets you going down the right path.

Assertion Failed Error while compiling Bitcoin-QT application in QT framework?

I am facing error while compiling bitcoin-qt application, I didn't understand what is the problem in main.cpp.
The error:
/main.cpp:2985: bool InitBlockIndex(): Assertion `block.hashMerkleRoot
== uint256("0x7c0b21983dc5a17daeef4b6b936375b0a59f3414af7a1bf248d98209447a494b")'
failed.
The program has unexpectedly finished.
what is the problem? Please give some advice to resolve this problem.
Have you tried this solution?
https://bitcoin.stackexchange.com/questions/21303/creating-genesis-block
The first time you run the compiled code (daemon or qt), it will say
"assertion failed". Just exit the program, go to config dir (under
AppData/Roaming), open the debug.log, get the hash after
"block.GetHash() = ", copy and paste it to the beginnig of main.cpp,
hashGenesisBlock. Also get the merkle root in the same log file, paste
it to the ... position in the following code, in LoadBlockIndex()
assert(block.hashMerkleRoot == uint256("0x...")); recompile the code,
and genesis block created!
BTW, don't forget to change "txNew.vout[0].nValue = " to the coin per
block you defined, it doesn't matter to leave as 50, just be
consistent with your coin per block (do this before adjust the hash
and m-root, otherwise they will be changed again).
check https://bitcointalk.org/index.php?topic=225690.0 for complete
info
It's for an altcoin, but it seems you've some problem with the genesis block.

C++ execute temp file as bash script

I have a program that needs to run a program we'll call externalProg in parallel on our linux (CentOS) cluster - or rather, it needs to run many instances of externalProg, each on different cores. Each "thread" creates 3 files based on a few parameters - the inputs to externalProg, a command file to tell externalProg how to execute my file, and a bash script to set up the environment (calls a setup script provided by the manufacturer) and actually call externalProg with my inputs.
Since this needs to be parallel with an unknown number of concurrent threads and I don't want to risk overwriting another thread's files, I am creating temp files using
mkstemp("PREFIX_XXXXXX")
for these input files. After the external program runs, I extract the relevant data and store it, and close the temp files (therefore deleting them).
We'll call the files created (Which actually have a name based on the template above)
tmpInputs - Inputs to externalProg
tmpCommand - Input that tells externalProg how to execute tmpInputs
tmpBash - bash script to set up and call externalProg with my inputs
The file tmpBash looks something like
source /path/to/setup/script # Sets up environment variables
externalProg < /path/to/tmpCommand
where tmpCommand is just a simple text file.
The problem I'm having is actually executing the bash script. Within my program, I call
ostringstream launchcmd;
launchcmd << "bash " << path_to_tmpBash
system(launchcmd.str().c_str());
But nothing happens. No error, no warning, no 'file not found' or permission denied or anything. I have verified that the files are being created and have the correct content. The rest of the code after system() is executed successfully (Though it fails since externalProg wasn't run).
Strangely, if I go back to the terminal and type
bash /path/to/tmpBash
then externalProg is executed successfully. I have also cout'd the launchcmd string, copy and pasted that in to the terminal, which also works successfully. For some reason, this only fails when called within my program.
After a bit of experimentation, I've determined that system() calls /bin/sh on our cluster. If I change launchcmd to look like
/path/to/tmpBash
(So that the full command should look like /bin/sh /path/to/tmpBash), I get a permission denied error, which is no surprise. The problem is that I can't chmod +x the tmpBash file while it's still open, and if I close the file, it gets deleted - so I'm not sure how to address that.
Is there something obviously wrong I'm doing, or does system() have some nuance that I'm missing?
edit: I wanted to add that I can successfully call things like
system("echo $PATH")
and get the expected results (in this case, my default $PATH).
Two separate ideas:
Change your SHELL environment variable to be /bin/bash, then call system(),
or:
Use execve directly `execve('/bin/bash', ['/path/to/tmpBash'], environ)