WorldServer trying to read 0x0000

Place your questions about osirose here

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Re: WorldServer trying to read 0x0000

Postby lmame on Fri Jan 30, 2009 10:33 am

:)
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: WorldServer trying to read 0x0000

Postby totakeke on Fri Jan 30, 2009 9:51 pm

Okay, the world server works... except not really.

It crashes within 10 seconds after entering the world. Before it crashes, I can walk, talk to the fairy NPC, and even kill jellies. In the distance, I can see text bubbles saying:

The gang of hooligans hav
recently been increasing in


That's exactly how the bubbles look. ("hav" is not a typo I made) They reappear and disappear around the screen, and in random spots. (The arrow of the txt bubble points at the ground... and there's nothing there. It looks as if the ground is talking. :lol: )

Here's the debugger output
Program received signal SIGABRT, Aborted.
In select$DARWIN_EXTSN () ()


Callstack:
#0 0x924966f2 select$DARWIN_EXTSN() (??:??)
#1 0x1de1 CWorldServer::ServerLoop(this=0x700000) (World Server/worldserver.cpp:328)
#2 0xfd4c CServerSocket::StartServer(this=0x700000) (Common/SocketServer.cpp:186)
#3 0x479cd main(argc=1, argv=0xbffffa50) (World Server/main.cpp:71)


If I leave the Rose window open after the server crashes, the bubbles multiply in number. The screen is literally filled with a bunch of text bubbles. :o

(Note I'm using v131)
totakeke
Jelly Bean
Jelly Bean
 
Posts: 12
Joined: Sat Jan 24, 2009 8:54 am

Re: WorldServer trying to read 0x0000

Postby Drakia on Fri Jan 30, 2009 10:11 pm

Paste a couple lines around 328 in WorldServer.cpp (So paste 310 - 350 or so)
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: WorldServer trying to read 0x0000

Postby totakeke on Fri Jan 30, 2009 10:19 pm

Lines 306-351 (the bolded line is line 328)
  1.  
  2. void CWorldServer::ServerLoop( )
  3. {
  4.     fd_set      fds;
  5.     int         activity;
  6.     maxfd = 0;
  7.     sockaddr_in ClientInfo;
  8.     SOCKET      NewSocket;
  9.     timeval     timeout;
  10.     maxfd = sock;
  11.     OnServerStep();
  12.     do
  13.     {
  14.         if (!Ping( ))
  15.           isActive = false;
  16.         timeout.tv_sec = 0;
  17.         timeout.tv_usec = 1000;
  18.         NewSocket = INVALID_SOCKET;
  19.         FD_ZERO( &fds );
  20.         pthread_mutex_lock( &PlayerMutex );
  21.         if(!Config.usethreads)
  22.            FillFDS( &fds );
  23.         FD_SET( sock, &fds );
  24.         activity = select( maxfd+1, &fds, NULL, NULL, &timeout );
  25.         if ( activity == 0 )
  26.         {
  27.              FD_SET( sckISCII, &fds );
  28.              activity = select( maxfd+1, &fds, NULL, NULL, &timeout );
  29.              if ( activity == 0 )
  30.              {
  31.                     pthread_mutex_unlock( &PlayerMutex );
  32.                     #ifdef _WIN32
  33.                     Sleep(1);
  34.                     #else
  35.                     usleep(1);
  36.                     #endif
  37.                     continue;
  38.              }
  39.             if ( activity < 0 && errno != EINTR )
  40.             {
  41.                 #ifdef _WIN32
  42.                 Log( MSG_ERROR, "Select command failed. Error #%i", WSAGetLastError() );
  43.                 #else
  44.                 Log( MSG_ERROR, "Select command failed. Error #%i", errno );
  45.                 #endif
  46.                 isActive = false;
  47.             }
  48.  
totakeke
Jelly Bean
Jelly Bean
 
Posts: 12
Joined: Sat Jan 24, 2009 8:54 am

Re: WorldServer trying to read 0x0000

Postby Maxxon on Sat Jan 31, 2009 10:01 am

i posted a thread long time ago what needs to be done to port osrose rev80 to linux and if i remember right i even gave some experimental port there. why dont you use that as a start for porting to osx/bsd? all rose emulators share huge chunks of code so it will be definately worth to take a look.
Image
an anymous comment on a program called reloader:
what if a fatal error happens, will it restart it?
User avatar
Maxxon
Hawker's pet
Hawker's pet
 
Posts: 1305
Joined: Sat Nov 10, 2007 12:42 pm

Re: WorldServer trying to read 0x0000

Postby Drakia on Sat Jan 31, 2009 6:23 pm

Looks like there's a lot of mixup between pthread and FDS, because of the lines
" if(!Config.usethreads)
FillFDS( &fds );"
&fds is never filled, and therefore when you call select, it tries to access random memory, and OSX apparently has stricter memory management than Windows does.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: WorldServer trying to read 0x0000

Postby totakeke on Sat Jan 31, 2009 9:54 pm

Maxxon wrote:i posted a thread long time ago what needs to be done to port osrose rev80 to linux and if i remember right i even gave some experimental port there. why dont you use that as a start for porting to osx/bsd? all rose emulators share huge chunks of code so it will be definately worth to take a look.


Are you speaking of the zrose server? I checked that out and it looked like it had a lot of functions missing. To use it as a base would be beyond my programming skills unfortunately.

I think the server just isn't coded for OS's with strict memory management. I'd have to recode a lot of stuff I bet, and that's beyond my skill as a programmer as of now. Thank you all for your help. I'm just going to run it on my Windows PC. It would have been nice to have it on my macbook, 'cause the fan is a lot quieter. :P Oh well.
totakeke
Jelly Bean
Jelly Bean
 
Posts: 12
Joined: Sat Jan 24, 2009 8:54 am

Re: WorldServer trying to read 0x0000

Postby lmame on Sat Jan 31, 2009 10:00 pm

Why don't you do a Windows Partition (BootCamp) or even use VMware for Mac to have a Windows virtual server (it's called VMWare Fusion I think for Mac).
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: WorldServer trying to read 0x0000

Postby Maxxon on Sat Jan 31, 2009 11:27 pm

totakeke wrote:
Maxxon wrote:i posted a thread long time ago what needs to be done to port osrose rev80 to linux and if i remember right i even gave some experimental port there. why dont you use that as a start for porting to osx/bsd? all rose emulators share huge chunks of code so it will be definately worth to take a look.


Are you speaking of the zrose server?


no i spoke of my own port. it was rev80 that time so it should be suited.
Image
an anymous comment on a program called reloader:
what if a fatal error happens, will it restart it?
User avatar
Maxxon
Hawker's pet
Hawker's pet
 
Posts: 1305
Joined: Sat Nov 10, 2007 12:42 pm

Previous

Return to Question Zone

Who is online

Users browsing this forum: No registered users and 2 guests

cron