Nonsense exception (debug+threaded) (Bmax 1.41)
Archives Forums/BlitzMax Bug Reports/Nonsense exception (debug+threaded) (Bmax 1.41)
| ||
Edit: I'm now fairly sure this is a glitch and abnormal behaviour - check post #5 this could be a memory leak. Modifying a bit the source provided resulted in outputing a binary block out of the memory rather than the value of an integer. --- Beause of the insane behaviour of this, I don't have the slightest clue of what could be causing this error. It is volatile, so it can work on your computer. or not. I have no clue. I managed to shrink the source code down into this: Global a[16] Global b[256] Global c[36] Global d[2048] Global e[16] file=WriteFile("test_deleteme") WriteString file,"abcdefgh" CloseFile file Function readstringdat:String(stream:TStream,l:Byte) Local array:Byte[l] Local i For i=0 To l-1 array[i]=ReadByte(stream) Next Local result:String="" For i=0 To l-1 If array[i]=0 Then Return result Else result=result+Chr(array[i]) Next Return result End Function Type Problem Field count Function make:Problem(path$) Local in:TStream = ReadFile(path) If in=Null Return Null Local result:Problem = New Problem Local a$=readstringdat(in,4) Local b$=readstringdat(in,4) result.count=10 Print "result.count = "+result.count For Local i=0 To result.count-1 Print "value of i is" Print i Print "value of i is"+i Print "*" Next Print "*" DebugStop CloseFile in Return result End Function End Type Type Ta Global a:Ta[2048] Function GLITCH:Object(data:Object=Null) Local test:Problem = Problem.make("test_deleteme") End Function End Type Local thread:TThread=CreateThread(Ta.GLITCH,Null) WaitKey() End And something completly unexplainable occurs: Building test Compiling:test.bmx flat assembler version 1.68 (1621336 kilobytes memory) 4 passes, 10740 bytes. Linking:test.debug.mt.exe Executing:test.debug.mt.exe result.count = 10 value of i is 0 EXCEPTION: ACCESS VIOLATION More insanity, here you go. If I replace Print "value of i is"+iby Print "value of i is "+i I get Building test Compiling:test.bmx flat assembler version 1.68 (1593617 kilobytes memory) 4 passes, 10790 bytes. Linking:test.debug.mt.exe Executing:test.debug.mt.exe result.count = 10 value of i is 0 value of i is 0 * value of i is 1 value of i is 1 * value of i is 2 value of i is 2 * value of i is 3 value of i is 3 * value of i is 4 value of i is 4 * value of i is 5 value of i is 5 * value of i is 6 value of i is 6 * value of i is 7 value of i is 7 * value of i is 8 value of i is 8 * value of i is 9 value of i is 9 * * EXCEPTION: ACCESS VIOLATION --- This code is a shrunk version of something that was supposed to load me graphics. It works fine on release or if I call the function in the main process (no threading) and sometimes works in debug even if you didn't change the code at all - but if you run another program then try this one again, it will throw an exception. summary of facts: - if you remove a[] or e[] it will still crash. - if you remove a[] and e[] or b[], c[], or d[], it won't crash and stop correctly at debugstop - if you remove any call to "readstringdat' it won't crash - if you add a space at the end of the string in the line print "value of i is"+i OR remove this line altogether, debugstop will crash - if you replace Global a:Ta[2048] by Global a:Ta[9999] it won't crash Thanks for the support. :) Last edited 2011 Last edited 2011 |
| ||
Hiya. I copied and pasted the code above straight into the standard MaxIDE ( 1.42 ). Sure enough It works perfect every time, no crashing at all. When you say run another program, I assume you mean another BMax source, ie compile and run? I've compiled and run my own sources in-between compiling and running yours, no regular pattern, just run and exit mine code maybe once or a couple of times, then yours maybe once or a couple of times to try to reproduce how you say, but it runs glitch free everytime. The only difference I see is that I'm using V1.42 This may or may not be the cause :- but you are setting up 2 Global arrays as a[]. The main one in the main global scope is an integer array, the other as a:Ta[...] within the Ta Type, and you are also then assigning 'a' again as a Local a$ within the Problem.Make function. I've experienced a similar issue in the past, and I was using a Global variable name and then a Local one with the same name and same type, one minute it would work as expected and the next compile - the program would be erratic, even though it compiled ok and I always use SuperStrict. Not really sure if its a bug or not as at the end of the day you are defining 'a' as Global. Maybe the compiler error checking should pick this up?? Not sure on other peoples thoughts about this bit. Although you say it still crashes for you even when you remove the a[]. I would advise against using the same names if one or both are Global - even if this isn't the cause for you. EDIT :- Sony Vaio VGN-FW31M - Vista Home Premium 32bit SP2, Standard BlitzMax IDE 1.40 with compiler V1.42, FASM 1.69.14, GCC 3.4.5, G++ 3.4.5 Last edited 2011 |
| ||
Thanks, i'll upgrade tomorrow and see if i'm still getting the crash. It's true that two globals are named a (i shrunk down the name to something simple and didn't realise this) but if i rename a to, say, f, nothing changes Also: Window XP 32bits SP3 MaxIDE 1.40 Release version 1.41 FASM 1.68 GCC: n/a G++: n/a Also important: It only crash on threaded debug, amonst the things i mentionned earlier. If i'm debugging but running with no threading (removing the thread call so it compiles) it will work with no problem. If i switch to release mode it will also work. Edit - screened the error: Last edited 2011 |
| ||
Upgrading to 1.42 with FASM 1.69.14 didn't solve the problem. |
| ||
Global a[16] Global b[256] Global c[36] Global d[2048] Global e[16] file=WriteFile("test_deleteme") WriteString file,"abcdefgh" CloseFile file Function readstringdat:String(stream:TStream,l:Byte) Local array:Byte[l] Local i For i=0 To l-1 array[i]=ReadByte(stream) Next Local result:String="" For i=0 To l-1 If array[i]=0 Then Return result Else result=result+Chr(array[i]) Next Return result End Function Type Problem Field count Function make:Problem(path$) Local in:TStream = ReadFile(path) If in=Null Return Null Local result:Problem = New Problem Local a$=readstringdat(in,4) Local b$=readstringdat(in,4) result.count=100 Print "result.count = "+result.count For Local i=0 To result.count-1 Print "value of i is" Print i Print "value of i is "+i Print "*" Next Print "*" DebugStop CloseFile in Return result End Function End Type Type Ta Global a:Ta[2048] Function GLITCH:Object(data:Object=Null) Local test:Problem = Problem.make("test_deleteme") End Function End Type Local thread:TThread=CreateThread(Ta.GLITCH,Null) WaitKey() End (changed: result.count=100 Print "value of i is "+i (re-added the space) Results: Building untitled1 Compiling:untitled1.bmx flat assembler version 1.69.14 (1399164 kilobytes memory) 4 passes, 10742 bytes. Linking:untitled1.debug.mt.exe Executing:untitled1.debug.mt.exe result.count = 100 value of i is 0 value of i is 0 * value of i is 1 value of i is 1 * value of i is 2 value of i is 2 * value of i is 3 value of i is 3 * value of i is 4 value of i is 4 * value of i is 5 value of i is 5 * value of i is 6 value of i is 6 * value of i is 7 value of i is 7 * value of i is 8 value of i is 8 * value of i is 9 value of i is 9 * value of i is 1Dz value of i is 10 * value of i is ௻ﳤ[<ਞﱃ0৆dਞ﹃︤௿/ ࡔ︡ࡘ暑pendॺZ257{AppSuspend}ࡂCॺZ}257{AppSuspend}ࡄ!ॺZऄ[௻ﳤ[Kࢻ!ॺZअ[௻ﳤ[Hਣﱃ0৆dਣ﹃︤ࡔ︡ࡅ﹃umeਨﱃ0৆dਨ﹃︤௿/ ࡅ︡࡞ume}੎PুcঀZ੕︩ऀZঀZࡈ!ॺZऋ[௺﹇ﳤ[Fࣅﱃ!ॺZ੩[௺ﳤ[<ࡃCॺZ259{AppTerminateࡈﱃॺZ259{AppTerminate}੕︂ࣽZાc`ࡍ!ॺZ੄Z௺Gﳩ直ZKࣆﱃ!ॺZ਼Z௹ﳩZHࡉﱃॺZ260{AppOpenFileࡍﱃॺZ260{AppOpenFile}ࡥC︂ࣽZৌb€ ঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZࡒﱃ!ॺZਾZ௹ﳨ￰ZF࣒C!ॺZसZ௸ﱇﳨ¦Z<ਭ0৆dਭ︤ࡁ︡આ﹃eਲ0৆dਲ︣ﺸ࡞︡ࡁe}ࣽZࣁb$ੜ﹃︩ਫ਼﹃︩੠﹃︩੢﹃︩੤﹃︩兩੦﹃︩笠੨﹃︩喝੪﹃︩﫸੬﹃︩ﭸ੮﹃︩ﯸੰ﹃︩ﮘ੬︩滛੨︩輦੤︩੠︩ੜ︩੓︩ੋ︩ࡘC!ॺZस[௸ﱇﳤ﹈[K࣓C!ॺZ6H਷0৆d਷︣ﹸࡁ︡અn਼0৆d਼︣רּ௿/ ࡅ︡࡞n}ॺZW}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}࡝ﱃ!ॺZ5Fࣞﱃ!ॺZ5<੃0৆dঀZঀZ࡞︡࡞ੱ0୷cݨ୹cঀZdd7=0ॺZa}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}ࡣﱃ!ॺZ4<ेﱃ!ॺZ4K৽1ࣽZऩcharࡪ1ࣽZਂ`੹﹯डޤ઀[ॺZm}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}ࡪC!ॺZ3Hॆﱃ!ॺZ3F࡫1ࣽZਂ`ࣷच﫡াࢃf︕ࡱ1ࣽZਂ`੹︯डޤ઀[ॺZ{}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}ࡰﱃ!ॺZ2<ष!ॺZ2Kࡸﱃ1ࣽZ஧_ॻa࣮ࢾﺦਫ਼ﯪࡎﱃॺZ1025{MouseDown}ॺZŠ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}ࡸ!ॺZ1Hश!ॺZ1Fࡹ1ࣽZ௧[ࢀ1ࣽZ௧[ॺZ—}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}ࢀC!ॺZ0<࣬C!ॺZ0Kࢥ1ࣽZ௦[ࡲCॺZ1027{MouseMove}ॺZ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}࢈!ॺZ100H࢚!ॺZefghFࢁॺZ1028{MouseWheel࢈ﱃॺZ1028{MouseWheel}ॺZ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}ળC"ਣZ௳࢐ﱃ ௻hdɀ<ࢉﱃॺZ1029{MouseEnter࢑ﱃॺZ1029{MouseEnter}ॺZ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}࢚ﱃ!ॺZh<ࢤ!ॺZefgK࢒ﱃॺZ1030{MouseLeave࢛ॺZ1030{MouseLeave}ॺZ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}ࢮ!ॺZgࢮ暑ࢯC ࠩ\ʀǠ <৪C1ࣽZ௦[࢜ॺZ2049{TimerTick}ॺZ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}ࢹ!ॺZefࢹ﹃ࣅ ࠩ\ʀǠ<ੈ0ଖ[ঀZঀZitࢦCॺZ4097{HotkeyHit}ॺZ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}ࢹﱃ!ॺZf<ࣄﱃ!ॺZebc{ࡄCAॺZvalue of i is 10nࡇﱃAॺZvalue of i is 9on}ॺZĆ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}ષC!ॺZe194࣑C ि[ࣅ︣ࣅ{ࡌﱃAॺZvalue of i is 8tࡒAॺZvalue of i is 7t}ॺZė}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}࣑ ॐ[ࣅ8195ࣝﱃ ि[࣑暑︣࣑暑{ࡗAॺZvalue of i is 6ct࡝AॺZvalue of i is 5ct}ॺZĩ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}ࣟﱃ ॐ[࣑暑8196࢑!ॺZabcd73ࡣAॺZvalue of i is 4৿ﱃ@... = 100}ੁ@ૃdૅdॼZੀ︨リঀZঀZঀZঀZॺZʼn}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}ࣹॺZ65537{इCॺZ65537࡙@ૃd૆dॼZ਻︨﹘ঀZঀZঀZঀZࡘ@ૃd૆dॼZਸ਼︨ﴘঀZঀZঀZঀZॺZŚ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}इॺZ32769{कﱃॺZ32769ࡔC@ૃdેdॼZ਱︨ﯘঀZঀZঀZঀZࡓ@ૃdેdॼZਬ︨滛ঀZঀZঀZঀZॺZŪ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}खॺZ16389{थॺZ16389ࡅﱃ@ૃdૈdॼZਧ﹃︨兩ঀZঀZঀZঀZࡅC@ૃdૈdॼZॾZਢ﹃︨ঀZঀZঀZঀZ}ॺZſ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}थﱃॺZ16388{वॺZ16388઄@ૃdૉdॼZॺZਜ﹃︨ग﹃︦0ZঀZঀZઆC@ૃd૊dॼZࣽZਖ﹃︨ग﹃︦0ZঀZঀZॺZƐ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}वﱃॺZ16387{ॆॺZ16387{ࡿAॺZvalue of i is 0ivate}ࡷﱃAॺZvalue of i is 1ivateॺZơ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}16385{WindowMove}ॺZ16386ॅﱃॺZ16386{ࡰAॺZvalue of i is 2se}ࡩAॺZvalue of i is 3seॺZƲ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}16385{WindowMove}16386{WindowSize}ॺZDŽ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}16385{WindowMove}16386{WindowSize}16387{WindowClose}ॺZǙ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}16385{WindowMove}16386{WindowSize}16387{WindowClose}16388{WindowActivate}ॺZǬ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}16385{WindowMove}16386{WindowSize}16387{WindowClose}16388{WindowActivate}16389{WindowAccept}ॺZǽ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}16385{WindowMove}16386{WindowSize}16387{WindowClose}16388{WindowActivate}16389{WindowAccept}32769{MenuAction}ઌ︐ࣽZਖ਼eЀĀmEof}ॺZȟ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}16385{WindowMove}16386{WindowSize}16387{WindowClose}16388{WindowActivate}16389{WindowAccept}32769{MenuAction}65537{StreamEof}65538{StreamAvail}࠯ﱃ︒ॺZȲ}257{AppSuspend}258{AppResume}259{AppTerminate}260{AppOpenFile}261{AppIdle}513{KeyDown}514{KeyUp}515{KeyChar}516{KeyRepeat}1025{MouseDown}1026{MouseUp}1027{MouseMove}1028{MouseWheel}1029{MouseEnter}1030{MouseLeave}2049{TimerTick}4097{HotkeyHit}8193{GadgetAction}8194{GadgetPaint}8195{GadgetSelect}8196{GadgetMenu}8197{GadgetOpen}8198{GadgetClose}8199{GadgetDone}8200{GadgetLostFocus}8201{GadgetShape}16385{WindowMove}16386{WindowSize}16387{WindowClose}16388{WindowActivate}16389{WindowAccept}32769{MenuAction}65537{StreamEof}65538{StreamAvail}131073{ProcessExit}শﱃ஝[ৈﱃ︐ࣽZ௦[ЀĀ৉C︐ࣽZ௦[ЀĀ৙︐ࣽZ௦[ЀĀࡏﱃࢽc৺︂ࣽZࣀc€৺ﱃ︂ࣽZࣀc€ࡤथcৣ`ż৯朗௹ﱦjʐ॓؀ସ`ﻡ௘`﯁@ࡀோRससৰ>৯朗ʐ॓௹ﱦj৯朗௹ﱦjʐ॓@ĀࠠaऀhோRȀਆﱃ҄iࣷ[௼ﳣﷸ[Kਇﱃ҄iह[௼﵇ﳤﹼ[Fࢤﱃ ࠩ\ʀǠFਈﱃ҄iǜi௽ﳌiਇ ࠩ\ʀǠHਉﱃ҄iϔi௽﵇ﳐiਈ ࠩ\ʀǠKਊﱃ҄i৫e௾ﳧﬨeਉ ࠩ\ːǠ<੊҄iਊ ࠩ\ːɀ<઱*ਣZ਋ ࠩ\̠ɘ<਍ﱃ ਷eਐ﹃︨਋﹃਌ ࠩ\̠ɘFઈ ৖e਎﹃︨਍ ࠩ\̠ɘHਏﱃ ঞeਏ﹃︨਍﹃਎ ࠩ\̠ɘKਐﱃ ॎe੃︨਎﹃ਏ ࠩ\Ѐ̀<ઈ ௣dঀZ਑﹃︨ਐ ࠩ\Ѐ̀Fઆﱃ ચdࣽZ਒﹃︨਑ ࠩ\Ѐ̀Hਓﱃ!ॺZnull[]਒ ࠩ\Ѐ̀Kਔﱃ ि[ਓ﹃︨ਓ﹃ਓ ࠩ\Ҁ͠<ਕﱃ ॐ[ਓ﹃︨ਓ﹃ਔ ࠩ\Ҁ͠Fਖﱃ ि[ਕ﹃︨ਕ﹃ਕ ࠩ\Ҁ͠Hध ॐ[ਕ﹃︨ਕ﹃ਖ ࠩ\Ҁ͠Kઅ ચdॺZਘ﹃︨ਗ ࠩ\Ԁː<ਙﱃ!ॺZstringਘ ࠩ\Ԁ̀<ਚﱃ ि[ਙ﹃︨ਙ﹃ਙ ࠩ\Ԁ̀Fਛﱃ ॐ[ਙ﹃︨ਙ﹃ਚ ࠩ\Ԁ̀Hਜﱃ ि[ਛ﹃︨ਛ﹃ਛ ࠩ\Ԁ̀Kद ॐ[ਛ﹃︨ਛ﹃ਜ ࠩ\Ԁ̠<ࡁ ચdॾZਞ﹃︨ਝ ࠩ\Ԁ̠Fਟﱃ!ॺZobjectਞ ࠩ\Ԁ̠Hਠﱃ ि[ਟ﹃︨ਟ﹃ਟ ࠩ\Ԁ̠Kਡﱃ ॐ[ਟ﹃︨ਟ﹃ਠ ࠩ\Ԁπ<ਢﱃ ि[ਡ﹃︨ਡ﹃ਡ ࠩ\ԀπFगﱃ ॐ[ਡ﹃︨ਡ﹃ਢ ࠩ\ԀπHਤﱃ!ॺZdoubleਣ ࠩ\ԀπKਥﱃ ि[ਤ﹃︨露ਤ﹃ਤ ࠩ\ԀЀ<ਦﱃ ॐ[ਤ﹃︨隸ਤ﹃ਥ ࠩ\ԀЀFਧﱃ ि[ਦ﹃︨隸ਦ﹃ਦ ࠩ\ԀЀHखﱃ ॐ[ਦ﹃︨器ਦ﹃ਧ ࠩ\ԀЀK਩!ॺZfloatਪ ि[਩︨縉਩Hਨ ࠩ\ʀǠ Fਫ ॐ[਩︨齃ਨ﹃਩ﱃ ࠩ\ʀǠ Hਬ ि[ਫ︨齃ਫਪﱃ ࠩ\ʀǠ KउC ॐ[ਫ︨ﭘਫਫﱃ ࠩ\ːǠ <ਮ!ॺZlongਬﱃ ࠩ\ːɀ <ਯ ि[ਮ︨ﮘਮਭﱃ ࠩ\̠ɘ <ਰ ॐ[ਮ︨ﰘਮਮﱃ ࠩ\̠ɘ F਱ ि[ਰ︨ﰘਰਯﱃ ࠩ\̠ɘ HईC ॐ[ਰ︨ﲘਰਰﱃ ࠩ\̠ɘ Kਲ਼!ॺZint਱ﱃ ࠩ\Ѐ̀ <਴ ि[ਲ਼︨ﳘਲ਼ਲﱃ ࠩ\Ѐ̀ Fਵ ॐ[ਲ਼︨ﵘਲ਼ਲ਼ﱃ ࠩ\Ѐ̀ Hਸ਼ ि[ਵ︨ﵘਵ਴ﱃ ࠩ\Ѐ̀ Kࣺﱃ ॐ[ਵ︨ਵਵﱃ ࠩ\Ҁ͠ <ਸ!ॺZshortਸ਼ﱃ ࠩ\Ҁ͠ Fਹ ि[ਸ︨︘ਸ਷ﱃ ࠩ\Ҁ͠ H਺ ॐ[ਸ︨ﺘਸਸﱃ ࠩ\Ҁ͠ K਻ ि[਺︨ﺘ਺ਹﱃ ࠩ\Ԁː <ࣹﱃ ॐ[਺︨8਺਺ﱃ ࠩ\Ԁ̀ <਽!ॺZbyte਻ﱃ ࠩ\Ԁ̀ Fਾ ि[਽︨x਽਼ﱃ ࠩ\Ԁ̀ Hਿ ॐ[਽︨￘਽਽ﱃ ࠩ\Ԁ̀ Kੀ ि[ਿ︨￘ਿਾﱃ ࠩ\Ԁ̠ <࣭C ॐ[ਿ︩Xਿਿﱃ ࠩ\Ԁ̠ Fੂ ড়dઆ︩˜ੀੀﱃ ࠩ\Ԁ̠ H࡞ ড়dࡔ︩ੁੁﱃ ࠩ\Ԁ̠ K੄ ধd࠯︩ੂੂﱃ ࠩ\Ԁπ <੅ ࡨdঀZ੅︩੃ﱃ ࠩ\Ԁπ F੆ ௹c੆︯フc௿/ ੄ﱃ ࠩ\Ԁπ Hੇ ௹cੇ︯lc੅ﱃ ࠩ\Ԁπ Kࢯ ௹c࡟︯(c੆ﱃ ࠩ\ԀЀ <ੴC ૔[ঀZୣﱯ େVঀZੇﱃ ࠩ\ԀЀ Fੋ ࠩ\̠ɘ 8ੈﱃ ࠩ\ԀЀ Hੋﱃࡈa̠ɘ8੉ﱃ ࠩ\ԀЀ Kੌﱃ ࠩ\ԀЀ K੍ﱃࡈaԀЀK੊ﱃ ࠩ\̠ɘ8੓ ࠩ\ԀЀ Hੌ ࠩ\̠ɘ 8੓ﱃࡈaԀЀH੍︅ࣽZࡘbĠHࢯ︢露ਇ︨ਉ︨਋︨਍︨ਏ︨਑︨ਓ︨ਕ︨ਗ︨ਙ︨ਛ︨ਝ︨ਟ︨ਡ︨ਣ︨落ਥ︨輦ਧ︨礼਩﹃︨視ਫ﹃︨טּਭ﹃︨﮸ਯ﹃︨ﰸ਱﹃︨ﲸਲ਼﹃︨ﴸਵ﹃︨ﶸ਷﹃︨︸ਹ﹃︨ﺸ਻﹃︨X਽﹃︨ᄌਿ﹃︩8ੁ﹃︩੃﹃︩੅﹃︩ੇ﹃︩੉﹃︩ੌ︩੔ ࠩ\ԀЀ F੔ﱃࡈaԀЀFੜ ࠩ\ԀЀ <੝ࡈaԀЀ<ࡆaࣽZ৑c@ࡊﱃ઺c੖ﱃࢃb੗C︅੓`ঀ਀ૻ଻ ࢆﴃࣿࣿईள܀̃̀̃̀̃??ࡀࡀȀࢀࡀ˹ीﰠଲ→ﰠଲ→ﰠल→ﰠलǿ௿Ļघo ௿̀௿ᅣ̀௿.झq̏̀̀ ȀĀā௿௿Ƞࡀਫ਼ ࠩ\Ԁπ K੗ ࠩ\ʀǠ <੟ࡈaԀπKੜﱃ ࠩ\ʀǠ F੠ ࠩ\Ԁπ H੝ﱃ ࠩ\ʀǠ H੡ࡈaԀπHਫ਼ﱃ ࠩ\ʀǠ K੢ ࠩ\Ԁπ F੟ﱃ ࠩ\ːǠ <੣ࡈaԀπF੠ﱃ ࠩ\ːɀ <੤ ࠩ\Ԁπ <੡ﱃ ࠩ\̠ɘ <੥ࡈaԀπ<੢ﱃ ࠩ\̠ɘ F੦ ࠩ\Ԁ̠ K੣ﱃ ࠩ\̠ɘ H੧ࡈaԀ̠K੤ﱃ ࠩ\̠ɘ K੨ ࠩ\Ԁ̠ H੥ﱃ ࠩ\Ѐ̀ <੩ࡈaԀ̠H੦ﱃ ࠩ\Ѐ̀ F੪ ࠩ\Ԁ̠ F੧ﱃ ࠩ\Ѐ̀ H੫ࡈaԀ̠F੨ﱃ ࠩ\Ѐ̀ K੬ ࠩ\Ԁ̠ <੩ﱃ ࠩ\Ҁ͠ <੭ࡈaԀ̠<੪ﱃ ࠩ\Ҁ͠ F੮ ࠩ\Ԁ̀ K੫ﱃ ࠩ\Ҁ͠ H੯ࡈaԀ̀K੬ﱃ ࠩ\Ҁ͠ Kੰﱃ ࠩ\Ԁ̀ H੭ﱃ ࠩ\Ԁː <ੰࡈaԀ̀H੮ﱃ ࠩ\Ԁ̀ <࣫CࡈaԀ̀F੯ﱃ ࠩ\Ԁ̀ F੉︂ࣽZࣃb$ੜ﹃︩ਫ਼﹃︩੠﹃︩੢﹃︩੤﹃︩兩੦﹃︩笠੨﹃︩喝੪﹃︩﫸੬﹃︩ﭸ੮﹃︩ﯸੰ﹃︩ﮘ੬︩滛੨︩輦੤︩੠︩ੜ︩੓︩ੋ︩࡟C︐ࣽZைcЀĀঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZঀZਝﱃ0৆dਝ﹃︤௿/ આ︡࡞ਘﱃ0৆dਘ﹃︤輦௿/ ࡘ暑︡࡞ਗﱃ0৆dਗ﹃︤輦࡞︪઄暑਒ﱃ0৆d਒﹃︤律௿/ ࡓ︡࡞਑ﱃ0৆d਑﹃︤律௿/ આ︡࡞ઇ୫d਎ﱃ2৒eঀZୋQঀZ਌ﱃaࣽZ੘e@ઉaࣽZ੘e@ઊﱃ︐ࣽZ੘eЀĀऒ4aࣽZ௾h@જﱃ︐ࣽZ௿hЀĀઞ︂ࣽZ௿h$৓4aࣽZ௿h@਋ﱃ2৒e੔4ঀZ࣓YঀZـiࡀ︪ﴨ ऀZࣽZ՝i€ ਉ﹃︨ਇ﹃︨ਆ︈暑︡ࡀ﹃︡ࡄ暑︡ࡈ︡ࡍ︡ࡒ﹃︡ࡘ︡࡝﹃︡ࡣ﹃︡難︡愈ࡰ︡ﰸࡷ﹃︡︘ࡿ暑︢ࢇ﹃︢ࣞ1ࣽZĬiঙ簾ȁࢀ濾 Exception: Access Violation Last edited 2011 |
| ||
Errrr, Something's definitely not right there!!! And it works perfectly on my system everytime! I've tried so many to get this to replicate in many different orders of trying things, and it's just not having it, I cant reproduce what you have there. Last edited 2011 |
| ||
when executed with Framework&import the glitch go away. I'm going to look if there is a particular module causing this. Using delay 1000 instead of WaitKey seems to produce some more garbage after the 1 second waiting ॑ﭕࢂࠠ ࡊ陋ਢ難婢઀ࢨ ࠤ﫥ࡊ࢒ࢉਢਪ઀HࡊऀHࢨ"ਪࡔઠBࡄਪࡄઠBࢨ"ࢨ"ઠB਀Ȁ@ @Ȁ਀ƀЀࡀ଀H઀j着પ﫪着પ﫪着પ﫪着પ﫪着પ﫪着પ﫪着પ﫪着પ﫪着ࢪਊપ着પ﫪着પ響੉h ࢂ਀PIȁƜĈ4ƏĈࣧﱤ￧4ƾĈࡼ﨧ࡼﰧࢆGࢆࢇﬧࡼ︧ࢉࡽﻧࡾࡽࡽǑĈࢤﬧ4 ǀĊ44ࡊBBDX7Device Window Class NJĈ4 ǽĈࡢડ௿/ ǢĈ࢟4࢝4ઢ௿/ ǮČણ௿/ ĔČણ௿/ ĚĈকﳦউj࢟4ė୶ࢀ﵄ﷄࡒﱃহdQ ĄĈ௱děĚো﹄࡜﹃˄Ěো﹄ܬĚো﹄௱děࠧ籠ě࡝௱dě࠭Dě࠲ě࠷﹄ě࠽ěࡂﱄěࡈě௱dě௱dě࣊ěࣥ﵄ěও梅ěૼ梅ě୉ě୮籠ě࡭děࢗפּěচě௱dě௱dě௱dě௱dě௱děতěশě৆ěQŷČৎ4ŹČ৑4ŻĈb Ĉকﳦউj࢟4ėࣥࢀ﵄ ࡞﹃হd ŧČऊ呂ėऌ呂ėऑ﵄呂ėग呂ėजפּ呂ėढ呂ėध籠呂ėभD呂ėल呂ėष﹄呂ėऽ呂ėƂĈࡑ࡝暑ƊĈ૔4ƽĈࢵ௿/ ࠾ ơĊࡦBBDX9Device Window Class ƫČࡧ﹦ﱡথহঽly ǑĈࡨtest_deleteme ǖĈ4ljĈ4ǸĈ4ǫĈ૳ﱧ4ĚĈࡍࡍﱧࡒࡎࡏ︧ࡎčĈࡡҘ4ļĈǐ௿/ ௜ĮĈ࠹௿/ ௜ŀĈ˰4ųĈɨ4ŢĈࢶ௿/ ࠾ŦĈǀ4ǀ4ࡿCਐ﹃ࡀDF4Ƙ4 you can see test_deleteme on the last line if you look a bit. Looks like it's dumping memory from the source code created. How strange. More info: if you successfully enter into debugmode it won't crash if you continue the execution^. you can enter debugmode before local a$ receive its value you can enter debugmode before local b$ receive its value you will get EXCEPTION ACCESS VIOLATION if you use start using debugstop anywhere after local b$ Renaming variable to x$ and y$ doesn't change anything Following those discoveries, i've made a duplicate of the function readstringdat so i can use debug in only one of those. Local a$=readstringdat(in,4) Local b$=readstringdat2(in,4) Function readstringdat2:String(stream:TStream,l:Byte) DebugStop Local array:Byte[l] 'DebugStop Local i For i=0 To l-1 array[i]=ReadByte(stream) Next Local result:String="" For i=0 To l-1 If array[i]=0 Then Return result Else result=result+Chr(array[i]) Next Return result End Function Won't crash, but Function readstringdat2:String(stream:TStream,l:Byte) 'DebugStop Local array:Byte[l] DebugStop Local i For i=0 To l-1 array[i]=ReadByte(stream) Next Local result:String="" For i=0 To l-1 If array[i]=0 Then Return result Else result=result+Chr(array[i]) Next Return result End Function WILL crash. Very curious... Last edited 2011 |
| ||
As a long shot in the dark, have you tried turning off Garbage Collection while the second thread is being used ? GCSuspend() GCResume() GCSuspend() Local thread:TThread=CreateThread(Ta.GLITCH,Null) WaitThread( thread ) GCResume() End |
| ||
I tried but it did the same thing. I have used some process hacking to check the integer value while it's being incremented, the problem don't seem to comme from here though, it goes without problem from 0 to where it crash (11) Beside, i tried starting from I=11 and... it crashed at i=22. It seems to fail to access the value properly, this is very weird. O_o value of i is 11 value of i is 11 * value of i is 12 value of i is 12 * value of i is 13 value of i is 13 * value of i is 14 value of i is 14 * value of i is 15 value of i is 15 * value of i is 16 value of i is 16 * value of i is 17 value of i is 17 * value of i is 1Dz value of i is 18 * value of i is 1Dz value of i is 19 * value of i is 2Dz value of i is 20 * value of i is 2Dz value of i is 21 * value of i is ௻ﳥ etc... with exception access violation |
| ||
Screenie of excecution (just in case) |
| ||
Works fine here too. Always a good idea to use Strict/SuperStrict and Framework anyway... |
| ||
Still works perfect every time here. Another long shot as it seems specific to your machine... 'rebuild all modules'? in both 'Threaded' and 'Non-Threaded'. I'm not expecting that to work though, but you never know. Some other things to try ( though not too constructive, but might help pinning this one down )... Use 'Superstrict', Close the file before the loop, Close the file before 'DebugStop', Create a mutex for the file if you are keeping the file open, so as to 'lock' it. Create a mutex for the loop variable. Just shots in the dark as it seems ok here every time. |
| ||
Remember that I already have found many way of fixing the problem. What i'm wanting to know is WHY it's happening :P As in, for example, why Global a:Ta[2112]will crash on my computer and why Global a:Ta[2113]will make it run fine, as if there was no bug at all. (you'd expect the opposite, usually, using more memory is supposed to make things worse. lol) Edit: Global a:Ta[2001] to Global a:Ta[2112] seems to be the glitch range since anything 2000 or below is also working. very strange Last edited 2011 |
| ||
Sounds like some kind of overflow and you're just taking care of the 'overflow' with making the array bigger? EDIT :- After reading your edit, I'm lost with this one :p Remember that I already have found many way of fixing the problem. What i'm wanting to know is WHY it's happening :P Good luck :P :D Last edited 2011 |
| ||
Just as I said changing the size of most arrays can delete the problem off, but I don't know why. I could also not use the 2nd call to readstringdat to make it work nicely. the behaviour of that 'i' variable also changes depending on how and what I choose to use it with. Print "value of i is "+i and Print "value of i is"+i will lead to two completly different crashes, the last one being completly unable to be processed without a crash. In my library, it is used this way result.list:+[TGamefile.readgamefile(in,i)]and is simply unable to access the i variable, resulting in crash. Or I could give up on the threaded mode and replace this Local thread:TThread=CreateThread(Ta.GLITCH,Null)by this... Ta.GLITCH()It won't crash at all. Or I could give up on the Debug Mode and untick Debug Build in Program>Build options. The glitch will no longer occur either. But this is quite an evasive way of fixing the problem, who know, I might just end up with something compatible for me but not for others? |