Comments (6)
i managed to reproduce the error, by simply compiling it manually, using cl.exe
directly e.g. cl.exe main.c
.
it prints [LOG] - attempting to rename file name
, as described, and empties the file.
so i decided to make a new C++ Console Application on MSVC 2019, the compilation exe output worked perfectly then.
looking at the full command line for compilation cl.exe main.c /permissive- /GS /GL /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl /Zc:inline /fp:precise /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oi /MT /FC /EHsc /nologo /diagnostics:column
, and removing parameters in various combinations, it seems like cl.exe main.c /Oi
is the bare minimal that works.
official documentation https://docs.microsoft.com/en-us/cpp/build/reference/oi-generate-intrinsic-functions?view=msvc-160
also, fixed 3 warnings by specifying the (W)ide variant of the Win32 API functions e.g. CreateFileW
, GetModuleFileNameW
and PathFileExistsW
.
from delete-self-poc.
Worked fine on the following:
- Windows 10 1909 - OS Build: 18363
- Windows 10 20H2 - OS Build: 19042
Compiled manually using cl.exe main.c
and then running main.exe
as admin.
from delete-self-poc.
Worked fine :
- Windows 10 1909
- VS2019
from delete-self-poc.
Is there any chance that the binaries could be shared, so I can identify the exact problem with the compiler. It's quite interesting, that under some optimisations it'll hang - others it'll not. This may also be a bug with MSVC, which could be even all the more interesting!
I've changed the function prefix to explicitly the wide-character variations - apologies, this was down to my project settings for VS2019 where UNICODE
was defined in the project settings.
from delete-self-poc.
@LloydLabs Attached binary. Just rename main.txt to main.exe.
It's compiled with VS2019 16.8.4 command line tools, aka cl main.c
, with latest master branch.
I think you should reopen it:
- I don't think optimization has anything to do with the hanging issue.
- What about the file size issue? Do right click on the main.exe after execution, and the size on disk is still 124KB.
from delete-self-poc.
I'm unsure, @CaledoniaProject, your issue seems isolated - and not able to be reproduced on other environments. I will re-open the issue, though. The fact you can right-click on the context menu, and choose properties, is an issue by itself. You shouldn't be able to do that to the file.
The root cause of your issue is that the file is not deleted in the first place. Which, as abovementioned, I'm sure is an isolated issue. Do you have any anti-virus or endpoint-detection system on your machine that may be interfering with this?
from delete-self-poc.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delete-self-poc.