flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > 1.71.50 bug? Goto page 1, 2 Next |
Author |
|
Tomasz Grysztar 08 Feb 2016, 15:22
Can you show the complete source that causes the bug to show up? When you define label with "var dd 0,0" there should be no difference between "[var]" and "dword[var]" constructions.
|
|||
08 Feb 2016, 15:22 |
|
randall 08 Feb 2016, 16:39
Tomasz Grysztar wrote: Can you show the complete source that causes the bug to show up? When you define label with "var dd 0,0" there should be no difference between "[var]" and "dword[var]" constructions. https://github.com/michal-z/asmart/blob/master/amnestia/amnestia_audio.inc Line 137 |
|||
08 Feb 2016, 16:39 |
|
Tomasz Grysztar 08 Feb 2016, 17:18
Thank you! This helped me find the bug. Please try 1.71.51.
|
|||
08 Feb 2016, 17:18 |
|
l_inc 08 Feb 2016, 17:19
Seems like another non-recoverable error at the wrong place. Minimal reproducible:
Code: vcvtsi2sd xmm0,xmm0,[var] var dd 0,0 P.S. Rather seems like I'm too late. _________________ Faith is a superposition of knowledge and fallacy |
|||
08 Feb 2016, 17:19 |
|
randall 08 Feb 2016, 17:38
Tomasz Grysztar wrote: Thank you! This helped me find the bug. Please try 1.71.51. Now it works fine. Thank you. |
|||
08 Feb 2016, 17:38 |
|
Tomasz Grysztar 08 Feb 2016, 17:40
l_inc wrote: Seems like another non-recoverable error at the wrong place. |
|||
08 Feb 2016, 17:40 |
|
l_inc 08 Feb 2016, 17:53
Tomasz Grysztar
Quote: In fasm g I have no errors that are not recoverable other than running out of memory or hitting the limit of allowed passes OK. It seems the err-directive also generates a recoverable error. And the difference to assert is only about what kind of an argument it takes. _________________ Faith is a superposition of knowledge and fallacy |
|||
08 Feb 2016, 17:53 |
|
l_inc 08 Feb 2016, 21:59
Tomasz Grysztar
I think though, there are cases when the irrecoverable err is indispensable. Like this one, which is about debugging. I even wrote a little macro for that: Code: ;allows to debug long running loops ;usage: mLimitLoops $100000 macro mLimitLoops limit=$100000 { macro while args& \{ while args if % > limit display 'Error: too many iterations',13,10 err end if \} macro repeat args& \{ repeat args if % > limit display 'Error: too many iterations',13,10 err end if \} } This macro wouldn't be of much help for debugging source code for fasmg. _________________ Faith is a superposition of knowledge and fallacy |
|||
08 Feb 2016, 21:59 |
|
Tomasz Grysztar 08 Feb 2016, 22:30
You could adjust the macro to simply break out of the loop instead:
Code: macro mLimitLoops limit=$100000 macro while?! args& while args if % > limit err 'too many iterations' break end if end macro macro repeat?! args& repeat args if % > limit err 'too many iterations' break end if end macro end macro mLimitLoops 1000 while a = 0 end while a = 0 |
|||
08 Feb 2016, 22:30 |
|
l_inc 08 Feb 2016, 22:39
Tomasz Grysztar
Quote: The above sample shows the "too many iterations" error correctly, Well, in this simple example yes, but in a larger code with many loops it's still gonna continue to execute other loops to the specified limit, and then do more passes and possibly even end up with "code cannot be generated". Quote: and when you change "a = 0" to "a = 1" it is going to assemble without an error - something that the variant with unrecoverable error would not allow The purpose of the macro is debugging of compiler hanging. It's not meant be used in a code that correctly compiles. _________________ Faith is a superposition of knowledge and fallacy |
|||
08 Feb 2016, 22:39 |
|
Tomasz Grysztar 08 Feb 2016, 22:58
l_inc wrote: Tomasz Grysztar l_inc wrote: The purpose of the macro is debugging of compiler hanging. It's not meant be used in a code that correctly compiles. |
|||
08 Feb 2016, 22:58 |
|
l_inc 08 Feb 2016, 23:15
Tomasz Grysztar
Quote: Yes, and this is what meant when I mentioned that I overestimated the potential problems caused by such approach I understand that many (or even all) of the internal compiler conditions should be recoverable, but I don't feel like it's OK to not provide an interface for the user to generate unrecoverable errors. It's like you completely get rid of the concept of warnings internally, but the user still might be willing to write macros that display warnings in some cases. Quote: Still, if the assembler aborts at a later pass, when many of the values are better known, you may get a more informative debugging I actually see it as less informative. And especially disadvantageous if the compiler somehow would manage to succeed with enforced loop limits, but not without them. The actual desired loop termination conditions would not be satisfied leading to inexpressive "better known" values. Quote: And in this variant such macro may actually help with some regular assembly, too (by skipping over the wrongly predicted long loops). This is sort of black magic programming. _________________ Faith is a superposition of knowledge and fallacy |
|||
08 Feb 2016, 23:15 |
|
Tomasz Grysztar 08 Feb 2016, 23:30
l_inc wrote: I actually see it as less informative. And especially disadvantageous if the compiler somehow would manage to succeed with enforced loop limits, but not without them. The actual desired loop termination conditions would not be satisfied leading to inexpressive "better known" values. |
|||
08 Feb 2016, 23:30 |
|
l_inc 08 Feb 2016, 23:54
Tomasz Grysztar
Quote: As I said above, I am aware of the theoretical "bad case scenarios" My point is that we do not disagree about how rare the bad case scenarios are. We disagree about how to qualify particular scenarios. What you identify as good I call disastrous. Again: Quote: And in this variant such macro may actually help with some regular assembly, too (by skipping over the wrongly predicted long loops). You try to present it as an advantage, but the point was to find the bug that led to long running loops. Not to make the source code somehow magically compile. And the result is that the bug was not found. _________________ Faith is a superposition of knowledge and fallacy |
|||
08 Feb 2016, 23:54 |
|
Tomasz Grysztar 09 Feb 2016, 08:58
l_inc wrote: You try to present it as an advantage, but the point was to find the bug that led to long running loops. Not to make the source code somehow magically compile. And the result is that the bug was not found. |
|||
09 Feb 2016, 08:58 |
|
l_inc 09 Feb 2016, 12:13
Tomasz Grysztar
Quote: The bug was not found because there was no actual bug to find. From my point of view if the code induces unacceptably long loops than it is clearly a bug that should not be worked around by an artificial loop count limitation, which may or may not help. Quote: as long as we are both discussing hypothetical advantages and hypothetical disadvantages, we may keep this going for long The example I gave a link to is not hypothetical. And afair it would result in "code cannot be generated" with your modification of the macro. Quote: However I do speak from the experience Yes, but that's a different kind of experience. Your use cases are limited to finding a solution for the source code no matter what. And the use case I'm talking about is debugging. One thing is to not use unrecoverable errors internally and a completely different thing is to not provide a possibility to generate them at all. If I say to the compiler that I want it to stop at this particular point then it's really what I mean, and I prefer to have the possibility to say that. _________________ Faith is a superposition of knowledge and fallacy |
|||
09 Feb 2016, 12:13 |
|
Tomasz Grysztar 09 Feb 2016, 13:50
l_inc wrote: Yes, but that's a different kind of experience. Your use cases are limited to finding a solution for the source code no matter what. And the use case I'm talking about is debugging. One thing is to not use unrecoverable errors internally and a completely different thing is to not provide a possibility to generate them at all. If I say to the compiler that I want it to stop at this particular point then it's really what I mean, and I prefer to have the possibility to say that. |
|||
09 Feb 2016, 13:50 |
|
l_inc 09 Feb 2016, 14:08
Tomasz Grysztar
Defining a point does not require all the internal details, it requires a convenient user interface. And there cannot be any more meaningful point to stop than at the very moment something clearly goes wrong. It's not unique to fasm resolution process that you'd be willing to stop the process as early as possible. It's the generally desired fail-fast property. E.g. if you experience heap corruption, you really wanna stop the process at the very moment of the misbehaving write, and not some time later when the heap corruption manifests itself at unrelated locations. It indeed would require you to have much more knowledge of the heap operation internals to find the root cause of the corruption. _________________ Faith is a superposition of knowledge and fallacy |
|||
09 Feb 2016, 14:08 |
|
Tomasz Grysztar 09 Feb 2016, 15:11
l_inc wrote: It's not unique to fasm resolution process that you'd be willing to stop the process as early as possible. It's the generally desired fail-fast property. E.g. if you experience heap corruption, you really wanna stop the process at the very moment of the misbehaving write, and not some time later when the heap corruption manifests itself at unrelated locations. It indeed would require you to have much more knowledge of the heap operation internals to find the root cause of the corruption. |
|||
09 Feb 2016, 15:11 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.