flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Possible bug in FASMW.EXE when opening large files?

Author
Thread Post new topic Reply to topic
mathaic



Joined: 18 Feb 2024
Posts: 7
mathaic 19 Feb 2024, 18:01
On Windows 10, specifically when I open the example, OPENGL.ASM in FASMW.EXE it just auto closes down.
Post 19 Feb 2024, 18:01
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1637
Location: Toronto, Canada
AsmGuru62 19 Feb 2024, 22:47
The size of OPENGL.ASM is 19Kb and I just opened it in FASMW.
Do you have a different OPENGL.ASM file?
Post 19 Feb 2024, 22:47
View user's profile Send private message Send e-mail Reply with quote
mathaic



Joined: 18 Feb 2024
Posts: 7
mathaic 20 Feb 2024, 00:50
AsmGuru62 wrote:
The size of OPENGL.ASM is 19Kb and I just opened it in FASMW.
Do you have a different OPENGL.ASM file?


Specifically I tried:

C:\Users\mathaic\Desktop\fasm\EXAMPLES\OPENGL\OPENGL.ASM

C:\Users\mathaic\Desktop\fasm\EXAMPLES\WIN64\OPENGL\OPENGL.ASM

When just opening both not even running them or compiling FASMW.EXE just closes.

My PC spec is:

- AMD Ryzen 7 1700X Eight-Core Processor - 3.40 GHz
- Windows 10 Home 22H2 19045.4046 Windows Feature Experience Pack 1000.19053.1000.0
Post 20 Feb 2024, 00:50
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 984
Location: Russia
macomics 20 Feb 2024, 01:14
1) Try to compile fasmw from source via the console fasm1.
Code:
rem Copy this text to build.bat and run it
cd /d C:\Users\mathaic\Desktop\fasm\SOURCE\IDE\FASMW\
set INCLUDE=C:\Users\mathaic\Desktop\fasm\INCLUDE\;
C:\Users\mathaic\Desktop\fasm\FASM.EXE FASMW.ASM || pause > nul && exit /b 1
copy /y FASMW.EXE C:\Users\mathaic\Desktop\fasm\FASMW.EXE    

2) Check the file properties (OPENGL.ASM) for the presence of the Windows Defender lock flag.
3) Try to run fasmw as an administrator first.
Post 20 Feb 2024, 01:14
View user's profile Send private message Reply with quote
mathaic



Joined: 18 Feb 2024
Posts: 7
mathaic 22 Feb 2024, 01:18
I have tried to run it as admin, not sure how to run it on command line just yet, but same thing happens.
Post 22 Feb 2024, 01:18
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 984
Location: Russia
macomics 22 Feb 2024, 07:11
Then what about points 1 and 2? I have written 3 points of possible solutions to the problem
Post 22 Feb 2024, 07:11
View user's profile Send private message Reply with quote
mathaic



Joined: 18 Feb 2024
Posts: 7
mathaic 22 Feb 2024, 14:55
macomics wrote:
Then what about points 1 and 2? I have written 3 points of possible solutions to the problem


For point one, I am yet to successfully get command line driven working. This is something I will have to research further this will take me a long time to get it working.

For point two, there is no flag or option to push it through Windows Defender, but even disabling this application completely makes no difference.

Further more my initial problem with the current version of FASM remains when opening certain files the program exits, this is the main thing I just at least wish to report here.
Post 22 Feb 2024, 14:55
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 22 Feb 2024, 15:03
Maybe check if your files are read-only.

Also, run a debugger and watch it.
Post 22 Feb 2024, 15:03
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 984
Location: Russia
macomics 22 Feb 2024, 15:12
Quote:
For point one, I am yet to successfully get command line driven working. This is something I will have to research further this will take me a long time to get it working.
To complete the first step, it is enough to do what is written in the code, ie. copy text to a file with the bat extension, save it and then double-click on it to execute. After it is executed, the FASMW.EXE file should appear in the folder "C:\Users\mathaic\Desktop\fasm\SOURCE\IDE\FASMW\". This file can be used to replace the corresponding file in the directory "C:\Users\mathaic\Desktop\fasm\".

Quote:
For point two, there is no flag or option to push it through Windows Defender, but even disabling this application completely makes no difference.
You don't need to do anything with Windows Defender. Just go to the properties of the OPENGL.ASM file (RMB by file and select "properties") and look for a warning from Windows Defender. If there is one, then you just need to press the button to make it disappear.

Quote:
Further more my initial problem with the current version of FASM remains when opening certain files the program exits, this is the main thing I just at least wish to report here.
Most likely, the problem is related to security settings on your system. It cannot be repeated on another machine.


Description:
Filesize: 27.12 KB
Viewed: 2267 Time(s)

Screenshot_20240222_181222.png


Post 22 Feb 2024, 15:12
View user's profile Send private message Reply with quote
mathaic



Joined: 18 Feb 2024
Posts: 7
mathaic 22 Feb 2024, 18:21
I have done everything you have said and still this issue happens. I decided to take a different approach and investigate further, because even running in admin mode, disabling security entirely, etc... etc... does nothing the issue still occurs. I went into Event viewer of windows and it gave me the following information:

Error:

Faulting application name: FASMW.EXE, version: 1.0.0.0, time stamp: 0x65c3418a
Faulting module name: FASMW.EXE, version: 1.0.0.0, time stamp: 0x65c3418a
Exception code: 0xc0000005
Fault offset: 0x00010ed7
Faulting process ID: 0x3a04
Faulting application start time: 0x01da65ba697e3dd7
Faulting application path: C:\fasm\FASMW.EXE
Faulting module path: C:\fasm\FASMW.EXE
Report ID: 9c6b1bde-3e09-421e-93bc-69ffe373b3be
Faulting package full name:
Faulting package-relative application ID:


Information:

Fault bucket 1515496435133885882, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: FASMW.EXE
P2: 1.0.0.0
P3: 65c3418a
P4: FASMW.EXE
P5: 1.0.0.0
P6: 65c3418a
P7: c0000005
P8: 00010ed7
P9:
P10:

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER3CA1.tmp.dmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER3DDA.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER3DEB.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER3DF8.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER3E28.tmp.txt

These files may be available here:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_FASMW.EXE_be88553e1f179347fd29293258d1f1d627351c1e_99c95ca1_68ca5305-bf6e-4edd-b23e-69f6dc64fa98

Analysis symbol:
Rechecking for solution: 0
Report Id: 9c6b1bde-3e09-421e-93bc-69ffe373b3be
Report Status: 268435456
Hashed bucket: 8c11e8a61200810025081ffa7286adba
Cab Guid: 0



Error:

Faulting application name: FASMW.EXE, version: 1.0.0.0, time stamp: 0x65c3418a
Faulting module name: FASMW.EXE, version: 1.0.0.0, time stamp: 0x65c3418a
Exception code: 0xc000041d
Fault offset: 0x00010ed7
Faulting process ID: 0x3a04
Faulting application start time: 0x01da65ba697e3dd7
Faulting application path: C:\fasm\FASMW.EXE
Faulting module path: C:\fasm\FASMW.EXE
Report ID: 12f71074-b603-4850-9504-e5dd01e496a2
Faulting package full name:
Faulting package-relative application ID:


Fault bucket 1417401147405524691, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: FASMW.EXE
P2: 1.0.0.0
P3: 65c3418a
P4: FASMW.EXE
P5: 1.0.0.0
P6: 65c3418a
P7: c000041d
P8: 00010ed7
P9:
P10:

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER427D.tmp.dmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER4378.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER4388.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER4388.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER43B8.tmp.txt

These files may be available here:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_FASMW.EXE_5676a3ea94da5e1f7854a970a5f711c0a54ab9c3_99c95ca1_54eab6db-51b8-45f4-ba1b-67fe731f1959

Analysis symbol:
Rechecking for solution: 0
Report Id: 12f71074-b603-4850-9504-e5dd01e496a2
Report Status: 268435456
Hashed bucket: c4fac6af1174b3e703ab9ed577565ed3
Cab Guid: 0

I then pasted all the information from this thread and these error information into ChatGPT it gave me the following information:

The error information from the Event Viewer indicates that the Flat Assembler Windows version (FASMW.EXE) is crashing with exception codes `0xc0000005` and `0xc000041d`. These exception codes provide critical clues about why FASMW.EXE is unexpectedly exiting:

1. **Exception Code 0xc0000005**: This is a common Windows exception code that represents an "Access Violation" error. This error occurs when a program tries to read or write to a memory location that it does not have access to, or if the access is invalid for the type of operation attempted. This could be due to a bug in FASMW.EXE itself, where it attempts to access memory incorrectly, or it could be related to the specific files it is trying to open or compile causing it to access memory in an invalid way.

2. **Exception Code 0xc000041d**: This exception code indicates an "Unhandled Exception" occurred during a user callback. While less common than an Access Violation, it suggests that an error occurred in a part of the program where exception handling was not properly implemented or an unexpected condition arose that the program could not recover from.

Both exception codes and the accompanying fault offset (`0x00010ed7`) point towards issues within the FASMW.EXE codebase or interactions with the operating system that lead to these critical errors. The problem is not necessarily with the file sizes of `OPENGL.ASM` but rather how FASMW.EXE handles certain operations or accesses certain resources that lead to these crashes.

To troubleshoot and potentially resolve these issues, consider the following steps:

- **Update FASMW**: Ensure you're using the latest version of FASMW, as updates may contain fixes for bugs that could be causing these crashes.
- **Run as Administrator**: Running FASMW with administrative privileges can sometimes bypass access violation issues, especially if it's related to accessing restricted memory or files.
- **Check for ReadOnly Attributes**: As suggested in the forum thread, make sure the files you're trying to open or compile are not set to ReadOnly, and that you have full permissions to access and modify them.
- **Compatibility Mode**: Try running FASMW in compatibility mode for an earlier version of Windows. This can sometimes resolve issues with older software on newer operating systems.
- **Debugging**: If you have experience with debugging tools, you could attempt to debug FASMW.EXE to see exactly where the access violation is occurring. This could provide more specific insights into the cause of the crash.

Given the nature of these errors, if you're not the developer of FASMW, your ability to fix the issue directly may be limited. If the problem persists after trying these steps, consider reporting the issue to the FASM community or support channels with the detailed error information, as they may be able to provide a more targeted fix or workaround.


So additionally, to trying all the steps you have mentioned, I have the latest version of FASMW 1.73.32 to be precise, I have run it as administrator, I have checked if anything is set to read only, I have tried to run it in terms of different compatibility.

Debugging is a bit out of my depth, I was mainly playing around with FASM when I discovered this and have only started to learn assembly.

Are you 100% certain this is not a bug with this new information? It seems to me its more a memory access violation or something like that rather than a security issue as no matter what I do this error always occurs.

By the way I managed to run that .bat file and it compiled the new .exe I believe, but the same thing still occurs as above. 100% there is no option in the properties to disable security stuff, all that I have done in the windows settings, on top running it as admin mode should override that stuff anyway.


Last edited by mathaic on 22 Feb 2024, 18:30; edited 1 time in total
Post 22 Feb 2024, 18:21
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 22 Feb 2024, 18:29
No one else has reported this problem.

Without your system in front of us we can only offer suggestions for the reason.

I would recommend a debugger. There is no better solution than to see the problem first hand. The address 0x00010ed7 should give a clue about where the fault occurs in the code.
Post 22 Feb 2024, 18:29
View user's profile Send private message Visit poster's website Reply with quote
mathaic



Joined: 18 Feb 2024
Posts: 7
mathaic 22 Feb 2024, 19:07
Yeah, debugger seems like a decent way forwards. I mean who knows I might learn something new here haha. But anyway overall I think for learning purposes it all works for now I don't really need OpenGL anyway I was simply opening all the examples to see what they did, but that seems a bit out of my depth for now anyway.

I have figured out a solution. I thought what if its the code in the file and I was right. So I have managed to FINALLY compile the opengl code, and side note I have opened and compiled all other assembly files fine as well in the examples folder, but for some reason the opengl 32 bit and 64 bit example code and the opengl inc file I need to move out of the fasm directory entirely, place the files somewhere else then open them and they both work fine. Often the most simple solution is the correct solution.

I think I will come back to this issue once I learn more about assembly and debugging.
Post 22 Feb 2024, 19:07
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 984
Location: Russia
macomics 22 Feb 2024, 20:18
Quote:
I need to move out of the fasm directory entirely
Since these files cannot be opened in just one directory, then most likely the same Windows Defender lock flag is in the properties of this directory. This happens if you use IE/Edge for downloading. There will be no such behavior when downloading from other browsers. At the same time, the lock flag that appears on the archive remains on its contents if it is extracted using Explorer, and not, say, WinRAR.
Post 22 Feb 2024, 20:18
View user's profile Send private message Reply with quote
mathaic



Joined: 18 Feb 2024
Posts: 7
mathaic 22 Feb 2024, 20:59
macomics wrote:
Quote:
I need to move out of the fasm directory entirely
Since these files cannot be opened in just one directory, then most likely the same Windows Defender lock flag is in the properties of this directory. This happens if you use IE/Edge for downloading. There will be no such behavior when downloading from other browsers. At the same time, the lock flag that appears on the archive remains on its contents if it is extracted using Explorer, and not, say, WinRAR.


I downloaded, using chrome, not edge, I ticked unblock on the archive before extracting it, then ran the program in admin mode, note its already now completely exempt from any security dynamic elsewhere on my system. I used 7 zip to extract, but I could see no further option to unblock. Same thing happens overall.
Post 22 Feb 2024, 20:59
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 984
Location: Russia
macomics 22 Feb 2024, 21:33
x64dbg should help
Post 22 Feb 2024, 21:33
View user's profile Send private message 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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.