Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Google, DotBot

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Compile Error & Overflows
Forum Rules | Mark all | Recent Posts

Compile Error & Overflows
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 2, 2010, 1:11 am   Last edited Sep 2, 2010, 1:13 am by Daygon
Go to the top of the page
Go to the bottom of the page

Daygon
Fledgling
GroupMembers
Posts19
JoinedJan 10, 2010

Ok, here's a bit of background.

Successfully run a SmaugFUSS server on Ubuntu 10 (Lucid). At the request of players I've decided to upgrade and begin a new world on AFKMud (mainly for the features and abilities). However I am running into some issues during compiling.

During the make process I get the following warnings:

  Compiling o/boards.o....
boards.cpp: In function ‘void load_boards()’:
boards.cpp:1132: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
  Compiling o/build.o....


  Compiling o/comm.o....
comm.cpp: In function ‘void directory_check()’:
comm.cpp:234: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result
comm.cpp:241: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result
comm.cpp:242: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
  Compiling o/commands.o....


  Compiling o/hotboot.o....
hotboot.cpp: In function ‘void hotboot_recover()’:
hotboot.cpp:792: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result
  Compiling o/imm_host.o....


  Compiling o/object.o....
new_auth.cpp: In function ‘void name_generator(std::string&)’:
new_auth.cpp:76: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
new_auth.cpp:80: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
new_auth.cpp:86: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
new_auth.cpp:93: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
new_auth.cpp:100: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
new_auth.cpp: In function ‘void pick_name(std::string&, const char*)’:
new_auth.cpp:146: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
new_auth.cpp:150: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
new_auth.cpp:155: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
  Compiling o/objindex.o....


  Compiling o/pfiles.o....
pfiles.cpp: In function ‘void do_pfiles(char_data*, std::string)’:
pfiles.cpp:854: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
pfiles.cpp: In function ‘void check_pfiles(time_t)’:
pfiles.cpp:907: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
  Compiling o/player.o....


Now aside of those upon compiling, everything works fine. I can load the MUD and telnet in without any issue, including admin/admin. However though; When I create a new character I get buffer overflows. I'm pretty sure it's due to the errors but I'm not 100%.

I have searched and found gdb and valgrind solutions (kind of) unfortunately gdb and valgrind don't work, or I'm still a bit linux retarded.

Any help is appreciated. All I need to do is get running without crashing and from there I'm golden.
       
Post is unread #2 Sep 2, 2010, 8:13 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

What do you mean by buffer overflows?

The warnings might or might not be related to whatever error you're seeing. The warnings are saying that you are improperly ignoring the return value of a function, which might be using its return value to alert you to some problem.

What doesn't work about valgrind? I would strongly recommend that you run this through valgrind; it's usually the fastest way to track down memory problems. Perhaps you simply need to install valgrind: sudo aptitude install valgrind
       
Post is unread #3 Sep 2, 2010, 11:45 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Those all appear to be the result of some new gcc warning, what version of gcc are you using on that system?

None of that should be generating buffer overflows though. You'll definitely need to get Valgrind working to pin that one down.
       
Post is unread #4 Sep 5, 2010, 9:39 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

I tried it in cygwin and had no problems out of any of it.

I did notice one odd thing though Samson, when I created a new character I never got past the room where you could say reset to start over. Maybe I missed something but didn't see any way out of it for a new character.
       
Post is unread #5 Sep 5, 2010, 10:22 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

It's unlikely that the game would work fine with one compiler and crash with another. (It is however likely that different versions will give different warnings.) That's why I'm curious to know what exactly is going wrong and how to OP is using the term "buffer overflow".
       
Post is unread #6 Sep 5, 2010, 12:48 pm   Last edited Sep 5, 2010, 12:49 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Ah, yeah. AFKMud didn't come with the newbie zones before and I forgot to connect the chargen zone to it when they got added.

Also just recompiled the base and have no issues with gcc 4.4.4.
       
Post is unread #7 Sep 5, 2010, 1:27 pm   Last edited Sep 5, 2010, 1:36 pm by Daygon
Go to the top of the page
Go to the bottom of the page

Daygon
Fledgling
GroupMembers
Posts19
JoinedJan 10, 2010

Ok, got my issue resolved. Not the way I'd have liked to, but it worked and will require very little learning curve. I scratched Ubuntu as my server and loaded the latest of Fedora. Gathered my required packages and successfully achieved a clean make.

I did receive an error

[root@server src]# ./startup &
[1] 2216
'root@server src]# Unknown option: `-
Usage: csh [ -bcdefilmnqstvVxX ] [ argument ... ].

[1]+  Exit 1                  ./startup


However, opening in gedit and resaving as Linux rather than Windows line end I was able to achieve this:

[root@server src]# ./startup &
[1] 11300
[root@server src]# 


I left the default port of 7500, adjusted the port forwarding on the router (which shouldn't matter as I'm going direct to the machine at the moment) and disabled Fedora's firewall.

However, trying to connect to my server locally (via local IP 192.168.1.104) (Just tried via dyndns url pointing at my current IP and same result) (And just tried via the server machine telnet on localserver, still same result) I get a "connection refused" return in my client. I also ran a port scan to determine if port 7500 was open or not and it does not appear so.

I'm learning the intricacies of Fedora over Ubuntu right now, so it is possible I'm missing something again... any advice? I'm not sure if the problem is lying on the startup script actually not starting, or an error in my network (which I understand would be outside the scope of support here), So close now, yet seemingly still far away :-(
       
Post is unread #8 Sep 5, 2010, 2:40 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

If you do a ps ux do you see your process listed there? If so then the startup worked and the MUD is running. Which would mean there's something funky going on in your network setup.

If it's not on the process list then something is preventing it from starting and you should be able to find some reason why in the logs directory.
       
Post is unread #9 Sep 5, 2010, 3:25 pm
Go to the top of the page
Go to the bottom of the page

Daygon
Fledgling
GroupMembers
Posts19
JoinedJan 10, 2010

I did not try ps ux but it was listed under ps x. That's what I figured. Thanks for the help. Off to figure out WTF the hangup is, ssh, apache, FTP all open, thanks again Samson :grinning: :headbang:
       
Post is unread #10 Sep 5, 2010, 4:39 pm
Go to the top of the page
Go to the bottom of the page

Daygon
Fledgling
GroupMembers
Posts19
JoinedJan 10, 2010

Sooo....found my problem.

I read the logs, and saw this:

Warning, you are a moron. Do not run as root.


So, lesson learned... I was a moron haha logged as normal user without sudo permissions, ran ./startup & and wouldn't you know it, worked!

For future people that seem to have a running mud but inability to telnet into the MUD... log off root and log into your server as a normal user and run the script.

Thank you again for the help guys. In regards to the buffer overflows I mentioned at the start... what would happen is I'd create a new character, but the moment I'd log in to create race/class it would throw buffer over flow messages into my SSH window and shut the mud down... still not sure why, but switching to Fedora from Ubuntu solved that issue.

-Daygon the Non-Log reading Moron who runs as Root.
       
Post is unread #11 Sep 5, 2010, 7:21 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

lol, Darien's code finally got to see some use :)
       
Post is unread #12 Sep 5, 2010, 8:03 pm
Go to the top of the page
Go to the bottom of the page

Daygon
Fledgling
GroupMembers
Posts19
JoinedJan 10, 2010

Glad to "test" it :P
       
Pages:<< prev 1 next >>