Page 1 of 1
(fixed) dsb_get_font Crash
Posted: Sun May 08, 2011 4:26 pm
by Qwerty
How to replace AAASYSFONT in "base/graphics.dat" with pcx bitmap on DSB0.48?
I made a pcx bitmap with ttf2pcx and I wrote this code in my original "graphics.lua".
Code: Select all
sys_font = dsb_get_font("FONTTEST")
But then, Seg-Fault was happened.
Code: Select all
PROGRAM CRASH!
Location: -5 0 0
Reason: Segmentation Fault
Stack Dump:
DSBmain
Re: dsb_get_font Crash
Posted: Sun May 08, 2011 7:45 pm
by Sophia
Can you me the font you're using?
I'll try to figure out what's wrong. It worked fine in testing.

Re: dsb_get_font Crash
Posted: Sun May 08, 2011 11:27 pm
by Qwerty
Yep, Here it is.
http://www.mediafire.com/i/?kf84sloozh87ro8
I hope that it's helpful for you.
Re: dsb_get_font Crash
Posted: Mon May 09, 2011 2:36 pm
by Qwerty
Oh, wait...
I've tested to replace the font in your "test_dungeon", It was correctly worked.
This mean that this problem must be my bad and I apologize it...
But, I don't know why only Seg-Fault was occurred when I attempted to replace font in my dungeon.

Re: dsb_get_font Crash
Posted: Mon May 09, 2011 8:12 pm
by Sophia
Segmentation faults in DSB are rarely the fault of the dungeon designer, particularly when they're that high up in the call stack (i.e., in DSBmain itself!)
There is something wrong in DSB that isn't manifesting itself in the
test_dungeon.
So don't feel bad. There is still a bug here that I need to fix. I don't know what it is yet, though.
Can you narrow down exactly what line(s) of code in your dungeon cause the problem to appear?
That is, can you comment out sections of code until you see what is actually creating the problem?
Code: Select all
--[[
Everything enclosed here will be a comment
]]
Re: dsb_get_font Crash
Posted: Tue May 10, 2011 5:23 pm
by Qwerty
Sophia wrote:Can you narrow down exactly what line(s) of code in your dungeon cause the problem to appear?
That is, can you comment out sections of code until you see what is actually creating the problem?
I've tried looking for what the thing cause this problem with comment out codes.
Unfortunately, I can't find out particular what code is making such the problem.
But I think that one cause of the problem might be occured by it I used too much bitmap images and sound data.
Maybe you know, My dungeon was replaced almost of graphics and sound which used on DSB as SNES graphics and I added musics on my dungeon.
As a result, the amount of importing bitmap images are over 800files and the total size of sound is over 50MB!
Hmm... But... I don't know what's wrong any further yet...
Would you mind if I send dungeon sources to you on PM?
Re: dsb_get_font Crash
Posted: Tue May 10, 2011 7:31 pm
by Sophia
Qwerty wrote:Would you mind if I send dungeon sources to you on PM?
Please do. That will help!
Re: dsb_get_font Crash
Posted: Wed May 11, 2011 4:17 pm
by Qwerty
I sent you my dungeon's sources.
Please check your PM.
Re: dsb_get_font Crash (Sorry! It is my mistake.)
Posted: Fri May 13, 2011 4:14 pm
by unskilledkite
Good evening, QWERTY. (This place writes in English.)
AND Sophia, I found cause.
DSB is not cause.(DSB is right)
There is cause in the PCX file.
I send a method of settlement to him. (send PM)
It thinks that it is easy to explain because it is the interval of the Japanese.
I appreciate.

dsb_get_font, thank you for corresponding.
I used DSB(0.48) and worked normally. Thanks, Sophia.
ps.
It is my mistake (2011/05/14 The reinvestigation )
Re: dsb_get_font Crash
Posted: Fri May 13, 2011 6:59 pm
by Sophia
Please send me the Japanese explanation, too.
Even if the problem is the PCX file I think DSB should produce a better error when given a badly formatted PCX file than just crashing.
Re: dsb_get_font Crash
Posted: Sat May 14, 2011 3:45 pm
by unskilledkite
Sophia,I mistook. sorry...

(QWERTY,There was pointing-out from him.)
I tested DSB(0.48version).
In the character of the scroll, in Japanese, a display was made.
result...
dsb_bitmap_textout() scroll in Japanese ※ (Except sys_font) <
Success >
( monster identify scroll = Japanese )
dsb_write() → used base font ※ (need sys_font) <
Failed >
I, too, tested. The problem (Segmemtation Fault) occurred.
QWERTY,comment is correcr...
Re: dsb_get_font Crash
Posted: Sat May 14, 2011 8:14 pm
by Sophia
Ok, thanks.
I'll keep looking then!
Re: (fixed) dsb_get_font Crash
Posted: Sun May 15, 2011 7:23 pm
by Sophia
It was a problem with DSB.
When you replace
sys_font, it caused the Lua garbage collector to destroy the old
sys_font. So, when the intro screen tried to display the status messages like "LOADING DUNGEON" (in the old
sys_font) the program crashed. The reason this didn't happen in other dungeons is that they didn't replace enough graphics to trigger Lua garbage collection during startup.
I've fixed it now, of course.

Re: (fixed) dsb_get_font Crash
Posted: Mon May 16, 2011 2:59 pm
by Qwerty
Wow, Thanks!
I'm looking forward to releasing DSB0.49!
Re: (fixed) dsb_get_font Crash
Posted: Mon May 16, 2011 6:08 pm
by unskilledkite
Oh,good news. I was anxious.
Thanks!