maj
New Member
Posts: 4
|
Post by maj on Mar 17, 2023 13:14:08 GMT
I'm getting a SIGSEV when I try to step over line 66 in this screenshot. It should be setting abilities(1) to ability. Sometimes it crashes without showing an error. When I just try to run the build executable I get `zsh: segmentation fault ./dos/sbf/sbf`. i'm on an M1 mac os 13.2.1. I'm using this version of qb64 "qb64_2022-09-08-23-37-44_47f5044_osx". Additionally qb64 doesn't seem to notice the app has exited when it crashes. Either when I try run or debug. This should be the relevant code. The NewAbility sub just sets the fields to the values provided. I'm using this pattern a lot in my app and it works elsewhere, but this one is crashing with a SIGSEV for some reason. I'm not sure if it's something wrong in my code or a bug. The full source is on github, but this new type hasn't been pushed yet, because of the error so I'm attaching the updated .bas file. Type AbilityType id as Integer singular as String plural as String End Type
Const ABILITY_TALENTS_ID = 1 Const ABILITY_TALENTS_SINGULAR = "Talent" Const ABILITY_TALENTS_PLURAL = "Talents"
Dim Shared Abilities(1 to 3) as AbilityType I've also tried running "qb64 -c -z -o sbf.cpp sbf.bas" to inspect the c++ code generated. It runs to 100% completion, but doesn't seem to create the output file anywhere. I'm thinking this is a bug, but if not could you point me to how to investigate the error further? Attachments:
sbf.bas (41.67 KB)
|
|
maj
New Member
Posts: 4
|
Post by maj on Mar 17, 2023 13:25:06 GMT
Sorry, I'm a little dumb. My ABILITIES_COUNT wasn't actually defined. I made it a const 3 and now the code works. I'm still surprised by the error message though. I thought I got an index out of bounds error before in qb64 instead of the app just crashing.
|
|