* 671 Posts in 238 Topics by 74 Members Latest Member: pythagoras   **
IFSO PORTAL
  Advanced search
May 20, 2013, 08:39:12 am
HomeforumHelpSearchLoginRegister**
Recent Posts
[May 08, 2013, 10:38:33 pm]

[April 26, 2013, 02:00:31 pm]

[April 14, 2013, 12:39:49 pm]

[December 21, 2012, 06:13:17 am]

[November 13, 2012, 02:21:49 pm]

[August 28, 2012, 06:38:27 pm]

[May 28, 2012, 10:12:41 pm]

[May 05, 2012, 01:01:38 pm]

[May 03, 2012, 02:11:03 pm]

[April 30, 2012, 12:48:25 pm]
IFSO Portal  |  Forum  |  ifsoGUI  |  Bug Reports  |  Topic: GUI.LoadTheme() crash in multithreaded app « previous next »
Pages: [1] 2 Go Down Print
Author Topic: GUI.LoadTheme() crash in multithreaded app  (Read 10798 times)
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« on: January 09, 2010, 09:20:26 am »

Hi,
I think I found this strange bug with ifsoGUI 1.14 and Bmax 1.36, while by using previous GUI version, with max 1.34 & 1.35, with same sources, anything works fine.

In the Max output window I get a lot of messages like this for a couple of different objects:
main.debug.mt(416,0xa07be720) malloc: *** error for object 0x528b10: double free
*** set a breakpoint in malloc_error_break to debug

Stepping through debug I noticed the crash occurs into Function LoadTheme(path:String) when it enters the first for-next cycle.

Thanks in advance and happy new year. Wink
Bye.

Logged
TaskMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 462


TaskyZ
View Profile
« Reply #1 on: January 09, 2010, 04:12:40 pm »

Hi,
I think I found this strange bug with ifsoGUI 1.14 and Bmax 1.36, while by using previous GUI version, with max 1.34 & 1.35, with same sources, anything works fine.

In the Max output window I get a lot of messages like this for a couple of different objects:
main.debug.mt(416,0xa07be720) malloc: *** error for object 0x528b10: double free
*** set a breakpoint in malloc_error_break to debug

Stepping through debug I noticed the crash occurs into Function LoadTheme(path:String) when it enters the first for-next cycle.

Thanks in advance and happy new year. Wink
Bye.



Do you have a code sample that causes it?  I have been using ifsoGUI with BlitzMax 1.36 without problems.  It also appears that you are using multi-threading.  Do you have the mod compiled for Multi-Threading?
Logged
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« Reply #2 on: January 10, 2010, 05:25:40 am »

Do you have a code sample that causes it?  I have been using ifsoGUI with BlitzMax 1.36 without problems.  It also appears that you are using multi-threading.  Do you have the mod compiled for Multi-Threading?
Just try to compile your example #1 with MT enabled under Bmax 1.36.
And yes, I compiled all the modules with MT enabled, otherwise max doesn't get the mods to link.
Under Mac OSX it simply crashes on LoadTheme() call.

Bye.

EDIT:
Note: if you compile the same sources with MT feature disabled, it works normally. So I tend to consider it a MT related issue.
« Last Edit: January 10, 2010, 06:24:51 am by Corum » Logged
TaskMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 462


TaskyZ
View Profile
« Reply #3 on: January 10, 2010, 02:04:40 pm »

Do you have a code sample that causes it?  I have been using ifsoGUI with BlitzMax 1.36 without problems.  It also appears that you are using multi-threading.  Do you have the mod compiled for Multi-Threading?
Just try to compile your example #1 with MT enabled under Bmax 1.36.
And yes, I compiled all the modules with MT enabled, otherwise max doesn't get the mods to link.
Under Mac OSX it simply crashes on LoadTheme() call.

Bye.

EDIT:
Note: if you compile the same sources with MT feature disabled, it works normally. So I tend to consider it a MT related issue.

I just compiled and ran Example 1 as multi threaded in both debug and release mode and they both work fine.  I do not believe there is a Threaded build issue with ifsoGUI.  My guess is that you need to recompile something (maybe ifsoGUI) as multi-threaded witht he latest version of BlitzMax.
Logged
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« Reply #4 on: January 10, 2010, 05:48:23 pm »

Hi,
I've just recompiled all the mods I have in MT version, ifsoGUI included.
The problem is still there.
Any Mac User out there with same situation?

My config is:
Leopard 10.5.8 - XCode 3.1.3 - BlitzMax 1.36 - ifsoGUI 1.14

Regards.
Logged
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« Reply #5 on: January 11, 2010, 07:56:23 am »

Ok, I restricted the field to the zipstream module, you wrapped from C.
If I use to load a theme without the incbin-zipstream feature, but straight from filesystem, my MT app doesn't crash anymore.
Looking at my crash report, it does something messy with memory allocation, when unzCloseCurrentFile is called.
Any suggestion?
Regards.
Logged
TaskMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 462


TaskyZ
View Profile
« Reply #6 on: January 11, 2010, 08:11:20 am »

Ok, I restricted the field to the zipstream module, you wrapped from C.
If I use to load a theme without the incbin-zipstream feature, but straight from filesystem, my MT app doesn't crash anymore.
Looking at my crash report, it does something messy with memory allocation, when unzCloseCurrentFile is called.
Any suggestion?
Regards.

That is the zipstream module by Koriolis.  I would try to debug it for you, but I do not have a mac.  Maybe you could grab the zipstream module and see if it works in multi-threaded mode by itself?  It could end up being a BlitzMax bug as well, as I know there are a few issue with the multi-threaded garbage collector that Mark Sibly hasn't got all worked out yet.

Logged
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« Reply #7 on: January 11, 2010, 09:14:05 am »

Well, I'm going to test it.
I'll keep you informed.

EDIT: I've just tested zipstream this way:
Code:
Import koriolis.zipstream
Local sound:TSound = LoadSound("zip::Track.zip//Track.ogg")
PlaySound(sound)
While Not KeyHit(KEY_ESCAPE)
Wend
I compiled the mod in both normal and MT versions.
Everything has gone perfect.

ifsoGUI unzCloseCurrentFile() crashes mt MT app. Why? Sad
« Last Edit: January 11, 2010, 09:34:51 am by Corum » Logged
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« Reply #8 on: January 11, 2010, 10:11:14 am »

By using Parallels Desktop, I've just downloaded, compiled and tested the Example#1 under my emulated WinXP. I added the Skin.zip file, actually missing.
Compiled under BMax 1.36 and ifsogui 1.14, with MT flag enabled.
I get an EXCEPTION_ACCESS_VIOLATION error. Shocked

But... what's happening? It's just me?!?
« Last Edit: January 11, 2010, 10:17:53 am by Corum » Logged
TaskMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 462


TaskyZ
View Profile
« Reply #9 on: January 11, 2010, 10:17:45 am »

I have noticed that you tend to get funny errors if one of the graphics files is missing, but that may or may not be your problem.

You tried to compile and run Example 1 under an emulated WinXP and it failed?  In single thread or multi-thread?
Logged
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« Reply #10 on: January 11, 2010, 10:18:43 am »

Both of them.
Standard mode works.
MT mode fails...
Logged
TaskMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 462


TaskyZ
View Profile
« Reply #11 on: January 11, 2010, 10:25:40 am »

Both of them.
Standard mode works.
MT mode fails...

I am sorry, but without a Mac, I am just unable to debug this.  I do have a mac virtual machine that I could try with, but I won't be able to mess with it until later, as I am at work.

Funny that it would fail in your Windows XP emulation.

What if you do not put your files into a zip file, does it work in MT then?
Logged
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« Reply #12 on: January 11, 2010, 10:33:02 am »

Funny that it would fail in your Windows XP emulation.

What if you do not put your files into a zip file, does it work in MT then?
It works. Shocked
Tell me you're joking, please. Smiley
Logged
TaskMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 462


TaskyZ
View Profile
« Reply #13 on: January 11, 2010, 10:46:02 am »

Funny that it would fail in your Windows XP emulation.

What if you do not put your files into a zip file, does it work in MT then?
It works. Shocked
Tell me you're joking, please. Smiley

So, it has something to do with the zipstream stuff.  Were you also doing incbin?  Maybe it has something to do with the incbin/zipstream combination...
Logged
Corum
ifsoGUI Owner
Newbie
*
Offline Offline

Posts: 37


CoRuMmO
View Profile
« Reply #14 on: January 11, 2010, 10:59:56 am »

I have a multifile project.
There is a main file, which opens the gui wrapper (this one is the real core, encapsulating game state, configuration, game IO stuff, etc.), the game instance object, the game map object and so on.
Every class includes its own init() method, so it's filled with all needed parameters, interacting between them where necessary.
The Incbin "Skins.zip" is done into gui wrapper class, just after the imports.

EDIT: I only incbin "Skins.zip", in the whole project.
« Last Edit: January 11, 2010, 11:33:21 am by Corum » Logged
Pages: [1] 2 Go Up Print 
IFSO Portal  |  Forum  |  ifsoGUI  |  Bug Reports  |  Topic: GUI.LoadTheme() crash in multithreaded app « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.17 | SMF © 2011, Simple Machines
TinyPortal v0.9.8 © Bloc
TechHead design by Bloc
Valid XHTML 1.0! Valid CSS!