(fixed) dsb_get_font Crash

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Qwerty
Apprentice
Posts: 55
Joined: Sun Aug 30, 2009 6:21 am

(fixed) dsb_get_font Crash

Post 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
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: dsb_get_font Crash

Post by Sophia »

Can you me the font you're using?
I'll try to figure out what's wrong. It worked fine in testing. :oops:
User avatar
Qwerty
Apprentice
Posts: 55
Joined: Sun Aug 30, 2009 6:21 am

Re: dsb_get_font Crash

Post by Qwerty »

Yep, Here it is.
http://www.mediafire.com/i/?kf84sloozh87ro8

I hope that it's helpful for you.
User avatar
Qwerty
Apprentice
Posts: 55
Joined: Sun Aug 30, 2009 6:21 am

Re: dsb_get_font Crash

Post 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... :cry:
But, I don't know why only Seg-Fault was occurred when I attempted to replace font in my dungeon. :?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: dsb_get_font Crash

Post 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
]]
User avatar
Qwerty
Apprentice
Posts: 55
Joined: Sun Aug 30, 2009 6:21 am

Re: dsb_get_font Crash

Post 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?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: dsb_get_font Crash

Post by Sophia »

Qwerty wrote:Would you mind if I send dungeon sources to you on PM?
Please do. That will help!
User avatar
Qwerty
Apprentice
Posts: 55
Joined: Sun Aug 30, 2009 6:21 am

Re: dsb_get_font Crash

Post by Qwerty »

I sent you my dungeon's sources.
Please check your PM.
User avatar
unskilledkite
Novice
Posts: 11
Joined: Sun Dec 12, 2010 4:32 pm
Location: Japan

Re: dsb_get_font Crash (Sorry! It is my mistake.)

Post by unskilledkite »

Good evening, QWERTY. (This place writes in English.) :o

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. :D 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 )
Last edited by unskilledkite on Sat May 14, 2011 3:09 pm, edited 1 time in total.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: dsb_get_font Crash

Post 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.
User avatar
unskilledkite
Novice
Posts: 11
Joined: Sun Dec 12, 2010 4:32 pm
Location: Japan

Re: dsb_get_font Crash

Post by unskilledkite »

Sophia,I mistook. sorry... :cry: (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...
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: dsb_get_font Crash

Post by Sophia »

Ok, thanks.
I'll keep looking then!
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: (fixed) dsb_get_font Crash

Post 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. :D
User avatar
Qwerty
Apprentice
Posts: 55
Joined: Sun Aug 30, 2009 6:21 am

Re: (fixed) dsb_get_font Crash

Post by Qwerty »

Wow, Thanks!
I'm looking forward to releasing DSB0.49!
User avatar
unskilledkite
Novice
Posts: 11
Joined: Sun Dec 12, 2010 4:32 pm
Location: Japan

Re: (fixed) dsb_get_font Crash

Post by unskilledkite »

Oh,good news. I was anxious.
Thanks!
Post Reply