bmx-ng / bmk

The enhanced BlitzMax build program.
zlib License
28 stars 13 forks source link

TImageFont.CreateDefault() end with EXCEPTION_ACCESS_VIOLATION #46

Closed olejr closed 6 years ago

olejr commented 6 years ago

Windows 10 x64

Everything updated (bmk v3.26 & bcc v0.97)

This oneline program crashes with EXCEPTION_ACCESS_VIOLATION Graphics (800, 600, 0)

Stepping through the code with debug:

Function CreateDefault:TImageFont()
  Local font:TImageFont=New TImageFont
  font._glyphs=New TImageGlyph[96]
  Local pixmap:TPixmap=TPixmap.Create( 96*8,16,PF_RGBA8888 )

  Local p:Byte Ptr=IncbinPtr( "blitzfont.bin" )  <-- This seem to be a NULL pointer
  For Local y=0 Until 16
    For Local x=0 Until 96
      Local b=p[x]            <-- Crash here
    For Local n=0 Until 8
      If b & (1 Shl n) 
            pixmap.WritePixel x*8+n,y,~0
      Else
        pixmap.WritePixel x*8+n,y,0
      EndIf
    Next
  Next
    p:+96
Next
woollybah commented 6 years ago

Hi, did you also rebuild modules? There was a change to the way incbin stuff is generated - into its own object file rather than compiled in as a header.

olejr commented 6 years ago

Yes did do a bmk makemods. Today after a some sleep I did a makemods -a, and I still got same thing.

So I started from "scratch". Download latest release v0.93.3.2. Built and replaced latest bcc and bmk. Replaced brl.mod and pub.mod with latest, removed everything else in mod folder. Did bmk makemods -a. Built bmk and bcc with new modules. Still get EXCEPTION_ACCESS_VIOLATION with just that one lineof code..

woollybah commented 6 years ago

Apologies, it was an issue with bcc. You'll need to rebuild the modules after updating bcc.

olejr commented 6 years ago

No problem. Years since I touched anything programming, so I have to relearn everything again anyway. Good practice to rebuild stuff!