Author Topic: [fixed] Crash on FreeBSD rev. 1611 (odd issue)  (Read 1757 times)

m0ellemeister

  • Guest
[fixed] Crash on FreeBSD rev. 1611 (odd issue)
« on: 23 January 2011, 00:24:41 »
i've started the game from within trunk/mk/linux.

Folder mydata wasn'their. So it was create by glest.bin.

Server: v3.4.0-beta2-GNUC: 40403-Jan 23 2011 01:16:30
Client: v3.4.0-beta2-GNUC: 40201 [64bit]-Jan 23 2011 00:19:55 player [m0ellemeister]
terminate called after throwing an instance of 'std::runtime_error'
what():  Couldn't scan directory 'mydata/tilesets//*': Unknown error: 0
Abort trap: 6

the glest.bin was stripped to get rid off debug informations.

EDIT:
I've found a workaround for it. Just create another empty folder under trunk/mk/linux/mydata/tilesets e.g. DeLeteMe, then it seems to work.

UPDATE:
the workeraround does not work ;-(

If i have empty subfolders under mk/linux/mydata i cannot play at all, because of errors like

Code: [Select]
main.cpp::handleRuntimeError Line: 268] [Couldn't scan directory 'mydata/tilesets/winter_forest/*': No such file or directory] gameInitialized = 1, program = 0x805974280
main.cpp::handleRuntimeError Line: 357] [Couldn't scan directory 'mydata/tilesets/winter_forest/*': No such file or directory]

Why does MG searches for tilesets/winter_forest under UserData_Root? Is this expeceted?

If i set in glest.ini UserData_Root= to an empty value i can play. But then i can't use the feature of downloading missing files via ftp (ingame), because of an error something like this: can't save file to disk. Maybe if UserData_Root isn't set $currentdir could be set automaticilly?

If i create symlinks under mydata/ to the tilesets, maps, scenarios (etc.) directories, i'll get the error that i have duplicate data and the games exits.
Code: [Select]
in.cpp::handleRuntimeError Line: 268] [You have duplicate tilesets for tileset [autumn] in [tilesets] and [mydata/tilesets]] gameInitialized = 1, program = 0x805974280
main.cpp::handleRuntimeError Line: 357] [You have duplicate tilesets for tileset [autumn] in [tilesets] and [mydata/tilesets]]

If FreeBSD is the only platform with this issue, maybe this one could be the bad one (but this is just a guess, i'm not a coder ;-) ):

File: shared_lib/sources/platform/common/platform_common.cpp
Code: [Select]
    // Look recursively for sub-folders
#if defined(__APPLE__) || defined(__FreeBSD__)
        res = glob(mypath.c_str(), 0, 0, &globbuf);
#else         
        res = glob(mypath.c_str(), GLOB_ONLYDIR, 0, &globbuf);
#endif         
        if(res < 0) {                                                                                                                                                   
                std::stringstream msg;
                msg << "Couldn't scan directory '" << mypath << "': " << strerror(errno);
                throw runtime_error(msg.str());
        }     
               
        for(int i = 0; i < globbuf.gl_pathc; ++i) {
#if defined(__APPLE__) || defined(__FreeBSD__)
                struct stat statStruct;
                // only process if dir..
                int actStat = lstat( globbuf.gl_pathv[i], &statStruct);
                if( S_ISDIR(statStruct.st_mode) == 0)
                        continue;
#endif 

BTW: if i'm right MacOSX would be the case too.

« Last Edit: 23 January 2011, 01:15:44 by m0ellemeister »

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #1 on: 23 January 2011, 02:54:33 »
This may not be exactly the same situation but it seems somewhat similar to me...
I was wondering what would happen if there was no glest.ini. So I tried to run a recent development version _without_ glest.ini, and see how far i can get. It truned out that there was no way to run MegaGlest without a glest.ini which would at least contain these entries:
Quote
ConsoleMaxLines=
FactoryGraphics=OpenGL
StencilBits=
DepthBits=
FontDisplayPrefix=
FontDisplayPostfix=
FontDisplayBaseSize=
FontDisplaySmallBaseSize=
FontMenuNormalPrefix=
FontMenuNormalPostfix=
FontMenuNormalBaseSize=
FontMenuBigPrefix=
FontMenuBigPostfix=
FontMenuBigBaseSize=
FontMenuVeryBigBaseSize=
FontConsolePrefix=
FontConsolePostfix=
FontConsoleBaseSize=
PhotoMode=false
FocusArrows=false
ShadowTextureSize=
ShadowFrameSkip=
ShadowAlpha=
FilterMaxAnisotropy=
CheckGlCaps=false
FirstTime=false
But even with this file in place, running the game was not possible hten (it does work now!).

Anyway, I guess my point it that the game should work even without a proper glest.ini in place, amd that this file should get created automatically...

This may or may not be related to the original topic (you are wecome to move this to a separate thread if not so), but to a purist like me, it seems worth pointing out.
« Last Edit: 23 January 2011, 02:56:57 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #2 on: 23 January 2011, 04:40:03 »
M0llemeister, the mydata folder can be empty and does not require subfolders (only when you place custom data there). It is possible that the code behaves different for MAC and freebsd.. that code was added by GeoVah so I'm not exactly sure what he needed to do, but could you please explain more detaild as to what happens when you have an empty mydata folder?

Tomreyn regarding default ini values, its debatable. We already do have defaults for SOME entries but usually they are optional properties. Required properties are easier to manage in the ini file (as opposed to setting defaults in BOTH the code and the ini file). IF the file is missing this means someone removed a key game component (just liek a dll or so). So i can see reasons why it would be good and also others why it would be bad to default every property entry (especially since we have different values defaults for windows vs Linux for some entries).

Thanks

m0ellemeister

  • Guest
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #3 on: 25 January 2011, 08:37:00 »
Here's another short description of the behavior of MegaGlest

i've just update to rev. 1618

The directory mydata looks like this:
Code: [Select]
ls -lahrt mydata/
total 14
drwxr-xr-x  2 user user   512B 22 Jan 15:04 tutorials
drwxr-xr-x  2 user user   512B 22 Jan 15:04 tilesets
drwxr-xr-x  2 user user   512B 22 Jan 15:04 techs
drwxr-xr-x  2 user user   512B 22 Jan 15:04 scenarios
drwxr-xr-x  2 user user   512B 22 Jan 15:04 maps
drwxr-xr-x  7 user user   512B 22 Jan 15:04 .
drwxr-xr-x  6 user user   1,0K 25 Jan 08:37 ..

recursive directory listing:

Code: [Select]
ls -lahrtR mydata/
total 14
drwxr-xr-x  2  user user  512B 22 Jan 15:04 tutorials
drwxr-xr-x  2  user user  512B 22 Jan 15:04 tilesets
drwxr-xr-x  2  user user  512B 22 Jan 15:04 techs
drwxr-xr-x  2  user user  512B 22 Jan 15:04 scenarios
drwxr-xr-x  2  user user  512B 22 Jan 15:04 maps
drwxr-xr-x  7  user user  512B 22 Jan 15:04 .
drwxr-xr-x  6  user user  1,0K 25 Jan 08:37 ..

mydata/tutorials:
total 4
drwxr-xr-x  7  user user  512B 22 Jan 15:04 ..
drwxr-xr-x  2  user user  512B 22 Jan 15:04 .

mydata/tilesets:
total 4
drwxr-xr-x  7  user user  512B 22 Jan 15:04 ..
drwxr-xr-x  2  user user  512B 22 Jan 15:04 .

mydata/techs:
total 4
drwxr-xr-x  7  user user  512B 22 Jan 15:04 ..
drwxr-xr-x  2  user user  512B 22 Jan 15:04 .

mydata/scenarios:
total 4
drwxr-xr-x  7  user user 512B 22 Jan 15:04 ..
drwxr-xr-x  2  user user 512B 22 Jan 15:04 .

mydata/maps:
total 4
drwxr-xr-x  7 user user 512B 22 Jan 15:04 ..
drwxr-xr-x  2 user user 512B 22 Jan 15:04 .

When i start the game: ./glest.bin and i want to start a custom game i'll get the error:
Code: [Select]
/glest.bin
v3.4.0-beta2-GNUC: 40201 [64bit]-Jan 25 2011 08:32:31, SVN: [Rev: 1618]
[2011-01-25 08:37:54] *ERROR* In [~/mg/MegaGlest-svn/trunk/source/shared_lib/sources/platform/sdl/window.cpp::handleEvent Line: 280] (a2) Couldn't process event: [Couldn't scan directory 'mydata/tilesets/scrub_land/*': No such file or directory] codeLocation = f
[2011-01-25 08:37:54] *ERROR* In [~/mg/MegaGlest-svn/trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 268] [Couldn't scan directory 'mydata/tilesets/scrub_land/*': No such file or directory] gameInitialized = 1, program = 0x80591eec0
[2011-01-25 08:37:54] *ERROR* In [~/mg/MegaGlest-svn/trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 357] [Couldn't scan directory 'mydata/tilesets/scrub_land/*': No such file or directory]
Assertion failed: (gameNetworkInterface==NULL), function init, file~/mg/MegaGlest-svn/trunk/source/glest_game/network/network_manager.cpp, line 41.
Abort trap: 6

Here's a screenshot of the ingame error message:
This is kinda strange behavior of MG and it ain't right to me.

Hopefully i was able to explain it clear enough. ;-)

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #4 on: 25 January 2011, 13:42:41 »
I agree it can indeed make sense to have different glest.ini files because of multiple supported operating systems, and because it provides more flexibility to not hard code (all) defaults.

@ m0ellemeister:
Sorry for my off-topic post, it's because I did not understand this issue properly when I read it first. Your second explanation is much better understandable to me. This issue reminds me a lot of a previous thread GeoVah started where he run into a similar issue with findAll + globbing. I wonder whether this can be related. Based on what you think it would seem that the code currently makes assumptions on a certain behaviour of shell globbing which are not safe to make on OS X.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #5 on: 26 January 2011, 00:57:02 »
Hi m0llemeister, I'll take a look and see what we can do to fix this (there is special code for MacOsx for globbing placed there by geoVah).

Thanks

EDIT: Try svn rev 1627 and let me know how it goes (and paste any output if you have problems)
« Last Edit: 26 January 2011, 01:06:38 by softcoder »

m0ellemeister

  • Guest
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #6 on: 26 January 2011, 08:00:12 »
I've tested rev. 1627. Here's the output:

./glest.bin
v3.4.0-beta2-GNUC: 40201 [64bit]-Jan 26 2011 07:24:52, SVN: [Rev: 1627M]
[2011-01-26 07:31:01] *ERROR* In [~/MegaGlest-svn/trunk/source/shared_lib/sources/platform/sdl/window.cpp::handleEvent Line: 280] (a2) Couldn't process event: [#2 Couldn't scan directory 'mydata/tilesets/desert2/*': No such file or directory] codeLocation = f
[2011-01-26 07:31:01] *ERROR* In [~/MegaGlest-svn/trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 268] [#2 Couldn't scan directory 'mydata/tilesets/desert2/*': No such file or directory] gameInitialized = 1, program = 0x80591eec0
[2011-01-26 07:31:01] *ERROR* In [~/MegaGlest-svn/trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 357] [#2 Couldn't scan directory 'mydata/tilesets/desert2/*': No such file or directory]
Assertion failed: (gameNetworkInterface==NULL), function init, file ~/MegaGlest-svn/trunk/source/glest_game/network/network_manager.cpp, line 41.
Abort trap: 6

Screenshot of the ingame error message:

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #7 on: 26 January 2011, 09:19:52 »
Please try rev 1631 and let me know how it goes.

Thanks

m0ellemeister

  • Guest
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #8 on: 26 January 2011, 12:02:40 »
softcoder, you are my hero  :D

it works! When i click on custom game, MG doesn't crashes. Here's the output:
Code: [Select]
./glest.bin
v3.4.0-beta2-GNUC: 40201 [64bit]-Jan 26 2011 12:44:44, SVN: [Rev: 1631M]
In [~/MegaGlest-svn/trunk/source/shared_lib/sources/platform/common/platform_common.cpp::getFolderTreeContentsCheckSumRecursively Line: 421] Final CRC file count: 1

Finally i've reached the custom game menu:

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #9 on: 26 January 2011, 14:59:02 »
Yeay, congratulations! :-)
Now I wonder what would happen if you try to publish this game on the master server. :-)
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

m0ellemeister

  • Guest
Re: Crash on FreeBSD rev. 1611 (odd issue)
« Reply #10 on: 28 January 2011, 19:32:53 »
FYI. Yesterday i was playing one single player game and three multiplayer games together with titi. Everything went well. My system was the client every time. I had no technically related issues.

Next what i want to test:
- being host for a multiplayer game
- test build in ftp client

 

anything