Jump to content
  • 0

Problems with MangosZero on Linux


AriathTheSage

Question

Hi, well... i didn't know how to title this exactly...

I'm testing MangosZero after a very long time and i have a couple of problems, but only with the source.

I have a VirtualBox machine with Ubuntu Server 22.04, minimal install, and, after doing all the cloning and installing stuff the server starts well, but as soon i try to login in the client the server crashes (only mangosd) showing an segmentation fault error. Thinking it was a problem with the latest commits, i tried downloading the source from here: https://github.com/mangoszero/server/archive/refs/tags/v22.04.1.tar.gz , but then cmake says that some stuff is missing. I tried doing a git submodule update --init --recursive, but i cannot because there is no ".git" folder.

The next thing i tried was taking note of the build the v22 release belongs to and cloning the repository with "git clone <repo> --recursive". Then i entered the folder and did "git checkout dc04a78ad0ce61886cd38e5c9aa2477870241711" (the commit of the release), and then "git submodule update --init --recursive".

After a successfully build, i tried connecting again with the same segmentation fault at the login.

BUT, what seems strange to me is that, if i try the BUILT release in Windows... all goes fine and i finally can login without problems.

 

So, in resume, i can only login with the Windows built relese. I can't build the zipped source because there is no git information to download the missing things, and cloning the repo always end with a segmentation fault (also in Windows).

I can use the Windows prebuilt version, but i would like to solve this mistery XD.

Thanks for your assistance.

 

P.D: I'm running CMAKE this way, from inside a "build" folder in the cloned repo: cmake ../ -DCMAKE_INSTALL_PREFIX=../Release -DCMAKE_CONF_DIR (or whatever is named)=../Release/conf -DPLAYERBOTS=1 -DPCH=1

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 1

Segmentation fault is more then likely coming from the OpenSSL library, cause I've seen this happen on my local machines with version 3.x. Ubuntu 22.04 ships with OpenSSL 3.x by default.
More then likely have to reinstall OpenSSL library with version 1.1.x instead of 3.x. Still need to implement proper messages within CMake itself to warn users using OpenSSL 3.x.

I would try Ubuntu 21.10 or 20.04 and see if this happens again.

Link to comment
Share on other sites

  • 1

Hey guys. I was facing the same problem (segfault on login) following this guide: 

 

Could fix by installing openssl-1.1 (Arch Linux - openssl-1.1 1.1.1.s-4 (x86_64)) and running cmake with:

cmake -S ~/mangos/zero/server/ -B ~/mangos/zero/build/ -DOPENSSL_ROOT_DIR=/usr/lib/openssl-1.1 -DBUILD_MANGOSD=1 -DBUILD_REALMD=1 -DBUILD_TOOLS=1 -DUSE_STORMLIB=1 -DSCRIPT_LIB_ELUNA=1 -DSCRIPT_LIB_SD3=1 -DPLAYERBOTS=1 -DPCH=1

So

-DOPENSSL_ROOT_DIR=/usr/lib/openssl-1.1

was the fix.

Edited by John
Link to comment
Share on other sites

  • 1

First off you are only removing the libssl-dev and not openssl together.

Remove related OpenSSL packages.

sudo apt remove openssl libssl-dev

Install OpenSSL 1.1.x

# download binary openssl packages from Impish builds
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.1.1f-1ubuntu2.19_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1f-1ubuntu2.19_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb

# install downloaded binary packages
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
sudo dpkg -i libssl-dev_1.1.1f-1ubuntu2.19_amd64.deb
sudo dpkg -i openssl_1.1.1f-1ubuntu2.19_amd64.deb

This is how I got around it on Ubuntu 22.04 for the time being.

Link to comment
Share on other sites

  • 0

Hi @AriathTheSage first off the git commands are wrong...

 

From the top level of the source code folder type the following:

 

git submodule init

git submodule update 

 

This will initialise and populate the missing submodules, this will then allow you to use cmake to build mangos

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

  • 0

I tried with that after the "git checkcout <release 22 commit>" stuff, but the world server keeps crashing.

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22>git checkout dc04a78ad0ce61886cd38e5c9aa2477870241711
Note: switching to 'dc04a78ad0ce61886cd38e5c9aa2477870241711'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at dc04a78a Added some new Readme Badges
M       dep
M       src/modules/SD3
M       src/realmd
M       src/tools/Extractor_projects
M       win

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22>git submodule init

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22>git submodule update
Submodule path 'dep': checked out '8399efecbb66c2a8a9cd87c017d6501dc29ef5db'
Submodule path 'src/modules/SD3': checked out '6debc85471cbb60f4dd847158bf9bd0d60fc00dd'
Submodule path 'src/realmd': checked out '7401c0c72fc0813dae1644abaade216d30ac3a88'
Submodule path 'src/tools/Extractor_projects': checked out '5e7f406cf645844911344ac5038c3e6ee36c35be'
Submodule path 'win': checked out 'ac213a8e728fc21005d58da8d6fd71b1baa96e2b'

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22>md build

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22>cp ..\generate_project.bat build\

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22>cd build

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22\build>nano generate_project.bat

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22\build>generate_project.bat
-- Building for: Visual Studio 16 2019

This script builds the MaNGOS server.
  Options that can be used in order to configure the process:
   General:
    CMAKE_INSTALL_PREFIX    Path where the server should be installed to
    BUILD_MANGOSD           Build the main server
    BUILD_REALMD            Build the login server
    BUILD_TOOLS             Build the map/vmap/mmap extractors
    USE_STORMLIB            Use StormLib for reading MPQs
    SOAP                    Enable remote access via SOAP
    PCH                     Enable use of precompiled headers
    DEBUG                   Debug build, only for systems without IDE (Linux, *BSD)
   Scripting engines:
    SCRIPT_LIB_ELUNA        Compile with support for Eluna scripts
    SCRIPT_LIB_SD3          Compile with support for ScriptDev3 scripts
   Modules:
    PLAYERBOTS              Enable Player Bots

  To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
  Also, you can specify the generator with -G. See 'cmake --help' for more details
  For example: cmake .. -DCMAKE_INSTALL_PREFIX=/opt/mangos -DSCRIPT_LIB_SD3=0

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.29.30146.0
-- The CXX compiler identification is MSVC 19.29.30146.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.37.1.windows.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Found MySQL: C:/Program Files/MariaDB 10.6/include/mysql
-- Looking for dlopen
-- Looking for dlopen - not found
-- Found OpenSSL: optimized;C:/Program Files/OpenSSL-Win64/lib/VC/libcrypto64MD.lib;debug;C:/Program Files/OpenSSL-Win64/lib/VC/libcrypto64MDd.lib (found version "3.0.7")
-- Linking against dependent libraries statically
===================================================
Mangos revision       : dc04a78ad0ce 2022-07-09 00:10:27 +0100 (HEAD branch)
Build type            : Release
Install server(s) to  : D:/Otros/World of Warcraft (Classic)/server/GitHub/mangoszero_r0.22/Release
Install configs to    : .

Detailed Information
+-- opeating system   : Windows-10.0.19045
+-- cmake version     : 3.24.1

Build main server     : Yes (default)
+-- with Eluna script engine
+-- with SD3 script engine
+-- with PlayerBots
Build login server    : Yes (default)
Support for SOAP      : No (default)
Build tools           : Yes (default)

===================================================
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Otros/World of Warcraft (Classic)/server/GitHub/mangoszero_r0.22/build

D:\Otros\World of Warcraft (Classic)\server\GitHub\mangoszero_r0.22\build>explorer .

The "explorer ." is for opening the folder where the VS 2019 solution is generated. After compiling it with Release option all goes ok.

This is the only error i have seen in one of the login attempts at the mangosd console:
 

Quote

 

_______________________________________________________

 MaNGOS Server: World Initialization Complete
_______________________________________________________

        Server Version : dc04a78ad0ce 2022-07-09 00:10:27 +0100 (HEAD branch)
      Database Version : Rel22.4.2

    Supporting Clients : 1.12.x
                Builds : 5875 6005 6141

         Module Status -
 
                 Eluna : Enabled
                Warden : Enabled
            PlayerBots : Disabled
      ScriptDev3 (SD3) : Enabled
    Remote Access (RA) : Disabled
_______________________________________________________

2023-01-03 22:07:34 SERVER STARTUP TIME: 0 minutes 10 seconds
2023-01-03 22:07:34
2023-01-03 22:07:34 Max allowed socket connections: 1024
2023-01-03 22:07:34 World Updater Thread started (50ms min update interval)
2023-01-03 22:07:34 176 bots processed. 4 alliance and 4 horde bots added. 0 bots online. Next check in 60 seconds
2023-01-03 22:07:42 ERROR:WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed).

 

As i said, in Linux the server ended with a segmentation fault.

I really don't understand what is happening. If i'm checking out the same commit of the precompiled release it should work as it does...

Link to comment
Share on other sites

  • 0

First, thank all of you for the new answers and suggestions :) .

I have donde some testing but it seems the realmd server keeps using OpenSSL 3.X instead 1.X.

Because i have not found any libssl1-dev like package in Ubuntu 22.04, i have done the following:

 

In the first server (the one a pulled from github), i configured CMake this way:

Quote

cmake ../ -DCMAKE_INSTALL_PREFIX=/home/mangos/server -DCONF_INSTALL_DIR=/home/mangos/server/conf -DOPENSSL_ROOT_DIR=/home/mangos/deps/installed/openssl -DBUILD_MANGOSD=1 -DBUILD_REALMD=1 -DBUILD_TOOLS=1 -DUSE_STORMLIB=1 -DSCRIPT_LIB_ELUNA=1 -DSCRIPT_LIB_SD3=1 -DPLAYERBOTS=1 -DPCH=1

The "/home/mangos/deps/installed/openssl" contains result of building the openssl-1.1.1c.tar.gz i downloaded from https://ftp.openssl.org/source/old/1.1.0/

This is the realmd output after generating projects and doing make and make install:

2201075 [realm-daemon]
Mangos revision: ce8b12f420d4 2022-12-31 21:29:00 +0000 (master branch)
<Ctrl-C> to stop.

Using configuration file /home/mangos/server/conf/realmd.conf.
Using SSL version: OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
WARNING: OpenSSL version may be out of date or unsupported. Logins to server may not work!
WARNING: Minimal required version [OpenSSL 1.1.x] and Maximum supported version [OpenSSL 1.2]

 

 

I decided try the next using the other server version, the one corresponding to the build in the Release section.

First, i installed this pkg: http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb

Because i didn't found any openssl folder in "/usr/lib", i used the old CMake configuration process without including the "-DOPENSSL_ROOT_DIR":

Quote

cmake ../ -DCMAKE_INSTALL_PREFIX=/home/mangos/server_r0.22 -DCONF_INSTALL_DIR=/home/mangos/server_r0.22/conf -DBUILD_MANGOSD=1 -DBUILD_REALMD=1 -DBUILD_TOOLS=1 -DUSE_STORMLIB=1 -DSCRIPT_LIB_ELUNA=1 -DSCRIPT_LIB_SD3=1 -DPLAYERBOTS=1 -DPCH=1

I though, because i installed the 1.1.0 OpenSSL version, and the server prefer that one, it would be used instead the 3.X one, even if both are installed.

But the realmd keep showing the same SSL version in use, 3.0.2 :P .

 

Any ideas?

Edited by AriathTheSage
Link to comment
Share on other sites

  • 0

You need to uninstall OpenSSL 3.x before attempting to use OpenSSL 1.1.x. Once OpenSSL 3.x is uninstalled, you'll have to install OpenSSL 1.1.x manually on the command line.
I was doing some testing the past few days and how I got it to use the correct version.

Note: OpenSSL 3.x support is on the way, but will take some time to make sure everything is working right.

Link to comment
Share on other sites

  • 0
mangos@mangoszero:~$ sudo apt-get remove libssl-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libzstd-dev zlib1g-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  default-libmysqlclient-dev libmysqlclient-dev libssl-dev
0 upgraded, 0 newly installed, 3 to remove and 52 not upgraded.

Uninstalling libssl-dev default-libmysqlclient-dev gets also removed, and it is listed as one of the requirements for building mangos 🤨...

And, if i try to remove libssl3...

mangos@mangoszero:~/deps$ sudo apt list --installed | grep libssl

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libssl1.1/now 1.1.0g-2ubuntu4 amd64 [installed,local]
libssl3/jammy-updates,jammy-security,now 3.0.2-0ubuntu1.7 amd64 [installed,automatic]
mangos@mangoszero:~/deps$ sudo apt-get remove libssl3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 apt : Depends: adduser but it is not going to be installed
       Recommends: ca-certificates but it is not going to be installed
 login : PreDepends: libpam-runtime but it is not going to be installed
         PreDepends: libpam-modules but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Maybe i'm doing it wrong?

Link to comment
Share on other sites

  • 0
Quote

mangos@mangoszero:~$ sudo apt remove openssl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apport-symptoms cloud-guest-utils eatmydata fdisk gdisk gir1.2-packagekitglib-1.0 isc-dhcp-client isc-dhcp-common
  libappstream4 libdns-export1110 libeatmydata1 libfdisk1 libglib2.0-bin libgstreamer1.0-0 libisc-export1105
  libnetplan0 libpackagekit-glib2-18 libstemmer0d libunwind8 libxmlb2 libyaml-0-2 libzstd-dev netplan.io packagekit
  packagekit-tools python-babel-localedata python3-attr python3-babel python3-blinker python3-cffi-backend
  python3-chardet python3-configobj python3-cryptography python3-distro python3-distupgrade python3-distutils
  python3-idna python3-jeepney python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-jwt
  python3-keyring python3-lazr.uri python3-lib2to3 python3-markupsafe python3-netifaces python3-oauthlib
  python3-pkg-resources python3-problem-report python3-pyparsing python3-pyrsistent python3-secretstorage
  python3-serial python3-setuptools python3-six python3-systemd python3-tz python3-update-manager python3-urllib3
  python3-wadllib python3-yaml squashfs-tools tzdata zlib1g-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  python3-distupgrade
The following packages will be REMOVED:
  apport ca-certificates cloud-init openssl python3-apport python3-certifi python3-httplib2 python3-launchpadlib
  python3-lazr.restfulclient python3-requests python3-software-properties snapd software-properties-common
  ssh-import-id ubuntu-release-upgrader-core ubuntu-server-minimal
The following packages will be upgraded:
  python3-distupgrade
1 upgraded, 0 newly installed, 16 to remove and 45 not upgraded.
Need to get 107 kB of archives.
After this operation, 112 MB disk space will be freed.
Do you want to continue? [Y/n]

Mmm... it seems apt wants to remove too many things along with openssl...

I suppose things like software-properties-common or the ubuntu-release-upgrader-core have SSL dependencies, but... i feel like i'm breaking things if i remove them 😅

Edited by AriathTheSage
Link to comment
Share on other sites

  • 0

Those packages should be alright to remove, the system itself won't uninstall anything that it needs. If you are unsure, I would backup and/or snapshot the virtual machine before continuing.
I've had that list pop up when I did the downgrade on OpenSSL and the system is working just fine.

From my Ubuntu 22.04 machine.

image.png.2d1a4d40d78429d9e57677612cae3499.png

image.png.155948e03ce8cc0a0ef38b0a9747495a.png

So I believe you'll be fine. If you need anymore help, feel free to message me.

Link to comment
Share on other sites

  • 0
Quote

mangos@mangoszero:~/server_r0.22/bin$ ./realmd
2201075 [realm-daemon]
Mangos revision: dc04a78ad0ce+ 2022-07-09 00:10:27 +0100 (HEAD branch)
<Ctrl-C> to stop.

Using configuration file /home/mangos/server_r0.22/conf/realmd.conf.
Using SSL version: OpenSSL 1.1.1f  31 Mar 2020 (Library: OpenSSL 1.1.1f  31 Mar 2020)
Using ACE: 6.5.9
Max allowed open files is 1024
Login Database total connections: 2
Connected to MySQL database mangos@127.0.0.1:3306/realmd
MySQL client library: 8.0.32
MySQL server ver: 5.5.5-10.6.11-MariaDB-0ubuntu0.22.04.1
AUTOCOMMIT SUCCESSFULLY SET TO 1
Connected to MySQL database mangos@127.0.0.1:3306/realmd
MySQL client library: 8.0.32
MySQL server ver: 5.5.5-10.6.11-MariaDB-0ubuntu0.22.04.1
AUTOCOMMIT SUCCESSFULLY SET TO 1
The table `db_version` indicates that your [Realmd] database has the same version as the core requirements.

Updating Realm List...
Added realm id 1, name 'MaNGOS Zero Server #1'

image.png.1cd2607b496c6d9123ec692fdd7ab1e5.png

It finally works! :D

I'm testing with the 0.22 release commit. Removed the openssl package, rebooted, installed your recommended packages, did a make clean and regenerated the project with cmake (i had to reinstall default-libmysqlclient-dev because was previously removed when i uninstalled previous stuff and cmake complaint about something related to mysql was missing).

After making, it now runs perfect. All the problem was with the modern openssl version.

Thank you so much all of you for your help :D .

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use