flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > IDE Development > if cancel compile, write failed on next compile

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4156
Location: https://pastebin.com/Vw7WXXf4
if cancel compile, write failed on next compile
win7:
fasmw1.71.17

compile a project, press enter key will cancel compile, and next compile will say, write failed.

maybe it means that the file handle is not free...?

_________________
Smile fool
Post 03 Apr 2014, 08:59
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
edfed,

Since Cancel means TerminateThread(), it could be so (though the window of opportunity is not so wide, you have to be [un]lucky enough).
Post 03 Apr 2014, 13:28
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1385
Location: Toronto, Canada
TerminateThread should never be used anywhere.
Post 03 Apr 2014, 14:04
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6435
Location: Kraków, Poland

baldr wrote:
Since Cancel means TerminateThread(), it could be so (though the window of opportunity is not so wide, you have to be [un]lucky enough).

Yes, it's exactly like that. It may be possible to fix this by modifying the code of "open", "create" and "close" in the fasm's interface API, so that they keep track of the handles and the main thread can then clean it up.


AsmGuru62 wrote:
TerminateThread should never be used anywhere.


Actually, in the case of fasm's thread, its only weak spots are the file access and allocation of main memory block. If some kind of mutex was introduced to prevent thread termination in these few vulnerable places, all the rest of fasm's code is safe to be terminated at any moment, simply because it uses no external functions and operates within its own data structures that are re-created from scratch inside that single memory block each time the thread is started, overwriting any possible leftover from the previous thread executions.

I did not put any safeties into those few weak spots simply because I belittled the chances of actually hitting the mark and landing in one of them when pressing "Cancel".
Post 03 Apr 2014, 20:43
View user's profile Send private message Visit poster's website Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 399
I don't know if this is related, but I once had a consistent problem with "Error: Write Failed" when I was on Win 8 and using multiple version of FASMW and even FASM. I had to wait for almost a minute to enable me to run my code after the "write failed" compilation. The workaround;

1. Compatibility: Lowered to WinXP SP 2
2. Enabled write/disk cache on the disk. Can't remember the exact steps but it was something on the Disk property's Policy.

Problems gone. I think this has nothing to do with FASM.
Post 04 Apr 2014, 20:11
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4156
Location: https://pastebin.com/Vw7WXXf4
i think this have something to do with the win32api used in fasmw.

i am currentlly a beginner in win32, cause i use msdn a lot in my job, and what i see is a blurry compatibility frontier between original and new win api designs...

mybe fasm for vista 7 and 8 should have a different code to do file operations.
Post 05 Apr 2014, 12:29
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.