GithubHelp home page GithubHelp logo

Comments (6)

evandrix avatar evandrix commented on July 4, 2024 2

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.

0x413x4 avatar 0x413x4 commented on July 4, 2024 1

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.

FunnyWolf avatar FunnyWolf commented on July 4, 2024 1

Worked fine :

  • Windows 10 1909
  • VS2019

from delete-self-poc.

LloydLabs avatar LloydLabs commented on July 4, 2024

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.

CaledoniaProject avatar CaledoniaProject commented on July 4, 2024

@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:

  1. I don't think optimization has anything to do with the hanging issue.
  2. 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.

LloydLabs avatar LloydLabs commented on July 4, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.