flat assembler
Message board for the users of flat assembler.

Index > Main > file not found

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 13 Jul 2011, 10:51
i have a strange problem.

when i compile a code that uses my lib (a lot of includes), fasm don't find a lot of files.
but theses files are here, and just before the bug, it worked very well.

it is the second time it happens.
the first time, it was last year, i solved the problem by restoring the previous backup, but now, it is very hard, because a lot of files have been modified.

i tested to zip the folder, and unzip as a new folder, it don't work.


i really wonder why fasm don't want to see a file that exists.
Post 13 Jul 2011, 10:51
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 13 Jul 2011, 10:55
Sources please. It is difficult to help without an example of the behaviour.
Post 13 Jul 2011, 10:55
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 13 Jul 2011, 11:22
the source file is here: http://fool.asm4u.net/fool0.zip
and you can try to have the error by compilation of shell.asm

error, file not found
source xhtml.inc(7Cool

even if i delete the reference to this file (uninclude), it won't find another file, ive just tested now, and it don't find pixelcounter.inc.
and so on until there are no includes.

this problem is very strange, because i made no modification in the main source, just inserted a new include somewhere, some instructions elsewhere, like everytime i code.

it is boring because it forces me to think about this bug instead of thinking about bugs in my recent code.

with dos console version, it gives that:
Code:

C:\fool0>fasm shell.asm
flat assembler  version 1.69.14  (536557 kilobytes memory)
applications/../applications/../applications/../applications/../applications/../
applications/../applications/../applications/../applications/../applications/../
applications/../applications/../applications/../applications/../applications/../
fool/xhtml.inc [78]:
include 'Xhtml/charmodules.inc'
error: file not found.

    
Post 13 Jul 2011, 11:22
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 13 Jul 2011, 11:39
Your path length is too long.
Code:
applications/../applications/../applications/../applications/../applications/../applications/../applications/../applications/../applications/../applications/../applications/../applications/../applications/../applications/../applications/../fool/Xhtml/charmodules.inc    
266 characters.
Post 13 Jul 2011, 11:39
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 13 Jul 2011, 11:49
here is the problem.

this file (charmodules.inc) is included this way:

shell.asm>comsys.inc>fool/flist.inc>xhtml.inc>charmodules.inc

there, i don't see the ../applications/../application/../ etc reccursion.

in fact, i can't find where this reccursion come from.

there are application includes that sometimes uses include '../comsys.inc' statement, but nowhere i can find why there is a ../aopplications reccursion.
Post 13 Jul 2011, 11:49
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 13 Jul 2011, 12:32
SHELL.ASM includes comsys.inc includes APPLICATIONS.INC includes SHOWFPS.INC includes CPUTIME.INC includes comsys.inc ... infinite recursion.
Post 13 Jul 2011, 12:32
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 13 Jul 2011, 13:24
ho my god.

but habitually, fasm answers with a symbol still defined error
to mean that the file is still included, that's why i didn't think about an eventual ../comsys uncommenting.

habitually, this line (include '../comsys.inc') is inserted at the begining of any fool code to contain the framework.

apparentlly, there is a limit to the detection of the duplicates of the symbols.

what is fun is that fasm don't say symbol already defined, but file not found.

that is a strange mystery.

and like ever, thanks a lot revolution, your solution let me test my code now!!!!
Post 13 Jul 2011, 13:24
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 13 Jul 2011, 13:32
include is processed by the preprocessor. Symbols are not processed until after the preprocessor is finished.
Post 13 Jul 2011, 13:32
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 13 Jul 2011, 13:44
Moving to main.
Post 13 Jul 2011, 13:44
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 13 Jul 2011, 14:11
ok, then, i think that if a file is not found, but present in the file system, means that there are recursive includes.
it can be cool to have a detection of the recursion in the paths.

because as i can see, the recursion is limited here by the 256 byte path lengh of the system.
Post 13 Jul 2011, 14:11
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 13 Jul 2011, 14:21
edfed wrote:
because as i can see, the recursion is limited here by the 256 byte path lengh of the system.
... and the limit of your RAM to store only one bajillion included files.
Post 13 Jul 2011, 14:21
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 13 Jul 2011, 14:22
revolution wrote:
one bajillion.


1E2K
Laughing
Post 13 Jul 2011, 14:22
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1657
Location: Toronto, Canada
AsmGuru62 13 Jul 2011, 14:38
I believe, it is possible to guard against the multiple inclusions of the file. You just need to insert if/end if into every INC file you use, just like C/C++ language does with #ifndef/#define.
Post 13 Jul 2011, 14:38
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 13 Jul 2011, 14:42
AsmGuru62 wrote:
I believe, it is possible to guard against the multiple inclusions of the file. You just need to insert if/end if into every INC file you use, just like C/C++ language does with #ifndef/#define.
You can't use if/end if because they are assembly constructs and the preprocessor ignores them. But you can do what you say with equ's, macros and match. There are already some suggestions posted to this board. Search for "includeonce".
Post 13 Jul 2011, 14:42
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 14 Jul 2011, 22:11
another solution is to do like i did, ask to revolution for the solution.
and as the problem is fixed now, what is maybe possible is to do a sort of "include postcheck" or something like this.


apparentlly, as the source is made, the compiler made 14 reccursions before to say: file not found. the ../ comes from the include '../comsys.inc' that will include everything else.
maybe just a little code to check the presence of a path like "folder/../folder/../folder/../folder....." certainlly mean that there is a reccursive inclusion. then, the algo can be simple as:

Code:
if file not found
then, call detectreccursion
if reccursion, then, error = reccursion
else error = file not found
endif
else error = no error 
endif
    
Post 14 Jul 2011, 22:11
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


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

Website powered by rwasa.