*** Unhandled exception *** EXCEPTION_ACCESS_VIOLATION (String Issues)

Previous topic - Next topic

spacefractal

Im will send it, howover this might cross my skiing vacation in the next week, where im gone for a week. so im might not do anything. But im will send the xCode project.

My guess the but is in glb.h. If its there, then its easy to been fixed without a glbasic update.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/


UBERmonkeybot

Hi  SF,
I have another weird issue that i think might be connected.

On compilation i am getting error  : GPC0007 wrong argument type :      at line that contains p$=p$+"loop 1"
I suspect there is something in my code that is causing these weird string issues.
Let me know if you or Gernot want my code to try and track down this bug.


Code (glbasic) Select
FUNCTION playTunes:init
// LOCAL t//=GETTIMERALL()
STATIC settimer//=0
LOCAL cp,cc
LOCAL p$="playing "
STATIC c
cp=tune[c]
IF cp=-99
c=0
cp=tune[c]
ENDIF
cc=bAND(cp,1)
IF cc=1 THEN p$=p$+"loop 1"       //error occurs here



IF GETTIMERALL()>settimer
DEBUG "\n swapping"
cc=bAND(cp,1)
IF cc=1
PLAYSOUND (s1,0,1)
ENDIF

cc=bAND(cp,2)
IF cc=2
PLAYSOUND (s2,0,1)
ENDIF

cc=bAND(cp,4)
IF cc=4
PLAYSOUND (s3,0,0.2)
ENDIF

cc=bAND(cp,8)
IF cc=8
PLAYSOUND (s4,0,0.8)
ENDIF

settimer=GETTIMERALL()+29000
INC c
DEBUG "\nloop"
ENDIF
NewOSDebug("Timer"+((GETTIMERALL()-settimer)/1000)+p$)
ENDFUNCTION

UBERmonkeybot

OK!

The weirdness continues

If i make the string name longer than 1 character it works ok

i changed p$ to pu$ and it now works.

Something strange is going on...

spacefractal

Im have been and is still currectly sig, some days after the ski vaccation (which was fun), which is why im are a bit away and not have looked in anything at all. Sorry about that. so im have not a change to look into this, but HeadKaze have linked into this post about this issue:
http://stackoverflow.com/questions/19840671/malloc-error-incorrect-checksum-for-freed-object-object-was-probably-mod

This is what im seen, and is also happens on iOS as well. Sometimes its works and sometimes its crash in various points, but all with same issue. So its property a imprompert way a string is released me thinks.

But sadly my c++ knowable might not been that strong to fix this issue, but im is happy to send you the xCode project back for future testing. Im thinks this issue is easiest to been fix on iOS and not in Windows. Im will do take a look later, when im fresh again.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

You might allready have a GLOBAL P argument..... Which might have confuced the compiler. dont mix them up in objects.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

UBERmonkeybot

Ah yes you are right i had a global p hidden away!

Get well soon.