Jump to content
Eternal Lands Official Forums
Aislinn

Compiling Linux Client 6-28-2020

Recommended Posts

I didn't want to clutter up your update threads so will post here.

I just tried to compile and I got multiple warnings about sky.c and this at the end:

make: *** No rule to make target 'books.c', needed by 'books.o'.  Stop.

 

Unfortunately I accidentally closed the terminal before I could copy/paste the entire printout here.

 

 

Share this post


Link to post
Share on other sites

With the TTF changes gvissers enabled additional warnings for the old makefiles.  I use cmake so have not noticed all the warnings.  They need to be address at some stage.

 

The module books.c has been rewritten and is now books.cpp.  It looks like you will need to remove the .deps directory to enable the build to proceed.  You also need the libsdl2-ttf-dev library installed to build the TTF stuff.

Share this post


Link to post
Share on other sites

Client built but it didn't want to run.

 

[sb@arch el_linux]$ ./el.x86.linux-6-29-2020.bin
Segmentation fault (core dumped)

Share this post


Link to post
Share on other sites
16 minutes ago, Aislinn said:

Client built but it didn't want to run.

 

[sb@arch el_linux]$ ./el.x86.linux-6-29-2020.bin
Segmentation fault (core dumped)

That's not good.  Can you get a stack trace from gdb?  Or enable the "ADDRSANITISER" option in make.defaults and see if that shows more details?

Edited by bluap

Share this post


Link to post
Share on other sites


[sb@arch el_linux]$ gdb ./el.x86.linux-6-29-2020.bin
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./el.x86.linux-6-29-2020.bin...
(gdb) run
Starting program: /home/sb/el_linux/el.x86.linux-6-29-2020.bin
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff74662d8 in __strncpy_avx2 () from /usr/lib/libc.so.6
(gdb) bt full
#0  0x00007ffff74662d8 in __strncpy_avx2 () from /usr/lib/libc.so.6
No symbol table info available.
#1  0x0000555555582854 in safe_strncpy (dest=0x0,
    source=source@entry=0x7fffffffdcd4 "textures/font", len=len@entry=128)
    at asc.c:150
No locals.
#2  0x0000555555649612 in load_texture_cached (file_name=<optimized out>,
    type=type@entry=tt_font) at textures.c:421
        slot = <optimized out>
        idf = {hash = 2700822427,
          file_name = "textures/font\000\251VUU\000\000\060A\251VUU\000\000\060A\251VUU\000\000\\A\251VUU\000\000mA\251VUU\000\000\060A\251VUU\000\000mA\251VUU", '\000' <repeats 42 times>, "c\000\000\000\000\000\000\000\200\335\377\377\377\177\000\000\000\000fV"}
        i = <optimized out>

        len = <optimized out>
        idxp = 0x0
        idx = <optimized out>
#3  0x000055555569cd59 in eternal_lands::Font::load_texture (
    this=this@entry=0x555556cd1ae0)
    at /usr/include/c++/10.1.0/bits/basic_string.h:2299
No locals.
#4  0x000055555569ce01 in eternal_lands::FontManager::get (
    this=this@entry=0x555556a5a540 <eternal_lands::FontManager::get_instance()::--Type <RET> for more, q to quit, c to continue without paging--c
manager>, cat=cat@entry=CHAT_FONT) at /usr/include/c++/10.1.0/bits/stl_vector.h:1043
        result = 0x555556cd1ae0
#5  0x000055555569ff90 in eternal_lands::FontManager::reset_soft_breaks[abi:cxx11](font_cat, unsigned char const*, unsigned long, eternal_lands::TextDrawOptions const&, int*, float*) (max_line_width=0x7fffffffdef4, cursor=0x0, options=<synthetic pointer>..., text_len=44, text=0x555556a94130 "\201[11:08:19] Window size adjusted to 1024x864", cat=CHAT_FONT, this=0x555556a5a540 <eternal_lands::FontManager::get_instance()::manager>) at font.h:1265
        cat_options = {static default_foreground_color = {_M_elems = {1, 1, 1}}, static default_background_color = {_M_elems = {0, 0, 0}}, static default_selection_color = {_M_elems = {1, 0.63499999, 0}}, _max_width = -1, _max_lines = 0, _zoom = 1, _line_spacing = 1, _alignment = LEFT, _vertical_alignment = TOP_LINE, _flags = 0, _fg_color = {_M_elems = {-1, -1, -1}}, _bg_color = {_M_elems = {-1, -1, -1}}, _sel_color = {_M_elems = {1, 0.63499999, 0}}}
        cat_options = <optimized out>
#6  reset_soft_breaks (text=0x555556a94130 "\201[11:08:19] Window size adjusted to 1024x864", len=44, size=62, cat=cat@entry=CHAT_FONT, text_zoom=text_zoom@entry=1, width=width@entry=-1, cursor=cursor@entry=0x0, max_line_width=0x7fffffffdef4) at font.cpp:1763
        options = {static default_foreground_color = {_M_elems = {1, 1, 1}}, static default_background_color = {_M_elems = {0, 0, 0}}, static default_selection_color = {_M_elems = {1, 0.63499999, 0}}, _max_width = <optimized out>, _max_lines = 0, _zoom = <optimized out>, _line_spacing = 1, _alignment = LEFT, _vertical_alignment = TOP_LINE, _flags = 0, _fg_color = {_M_elems = {-1, <optimized out>, <optimized out>}}, _bg_color = {_M_elems = {<optimized out>, <optimized out>, <optimized out>}}, _sel_color = {_M_elems = {<optimized out>, <optimized out>, <optimized out>}}}
        res = {first = "", second = 3}
        new_len = <optimized out>
#7  0x000055555564803d in rewrap_message (msg=msg@entry=0x55555660be20 <display_text_buffer>, cat=cat@entry=CHAT_FONT, text_zoom=text_zoom@entry=1, width=-1, cursor=cursor@entry=0x0) at text.c:1292
        nlines = <optimized out>
        max_line_width = 0

#8  0x00005555555974ef in update_text_windows (pmsg=pmsg@entry=0x55555660be20 <display_text_buffer>) at chat.c:2752
No locals.
#9  0x00005555556463f1 in put_colored_text_in_buffer (color=color@entry=2 '\002', channel=channel@entry=3 '\003', text_to_add=text_to_add@entry=0x7fffffffe060 "Window size adjusted to 1024x864", len=<optimized out>, len@entry=-1) at text.c:1170
        msg = 0x55555660be20 <display_text_buffer>
        minlen = <optimized out>
        text_color = 0
        cnr = 0
        ibreak = <optimized out>
        jbreak = <optimized out>
        time_stamp = "[11:08:19] "
        l_time = <optimized out>
        c_time = 1593443299
#10 0x00005555555c19dd in setup_video_mode (fs=<optimized out>, mode=<optimized out>) at gl_init.c:155
        modestr = "1024x864\000f\263VUU\000\000`\263\306VUU\000\000\000\000\000\000\377\177\000\000 \340\377\377\377\177\000\000@\341\377\377\377\177\000\000\000\000\000\000\000\000\000\000Z\303\070\367\377\177\000\000,\225\307VUU\000\000w)\302VUU\000\000\367\a\000\000\000\000\000\000\000q\\\255Xv\t\\\000\000\000"
        str = "Window size adjusted to 1024x864\000\225\307VUU\000\000\002\366\062\367\377\177", '\000' <repeats 18 times>, "?\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\070\342\377\377\377\177\000\000Pr\374\367\377\177\000\000\000\000\000"
        new_width = 1024
        new_height = 864
        index = <optimized out>
#11 0x00005555555c360a in init_video () at gl_init.c:188
        rgb_size = <optimized out>
        flags = <optimized out>
#12 0x00005555555ce3ec in init_stuff () at init.c:689
        seed = <optimized out>
        file_name = "\000\000\000\000\000\000\000\000[\000\000\000w", '\000' <repeats 19 times>, "\342\375uUUU\000\000\340\001\025\000\000\000\000\000\340)L\367\377\177\000\000H\000\000\000\000\000\000\000 \236\266VUU\000\000\360\375uUUU\000\000`\226\266VUU\000\000\345\341\070\367\377\177\000\000<\207\266VUU\000\000 h\247VUU\000\000<\207\266VUU\000\000 h\247VUU\000\000<\207\266VUU\000\000U\331dUUU\000\000 \236\266VUU\000\000\350\006\000\000\000\000\000\000 \236\266VUU\000\000\360\206\266VUU\000\000@\227\266VUU\000\000\360\375uUUU\000\000\270BvUUU\000\000"...
        i = <optimized out>

        config_location = "k\221ZUUU\000\000\342\375uUUU\000\000\067xZUUU\000\000j\366uUUU\000\000p\345\377\377\377\177\000\000\000q\\\255Xv\t\\\200\345\377\377\377\177\000\000\000q\\\255Xv\t\\ows, enable this`\227\262VUU\000\000`\231\262VUU\000\000p\374\265VUU\000\000\300\374\265VUU\000\000\377\000\000\000\000\377\000\000\000\000\000\377\000\000\000\000\377\000\000\000\000\377\000\000\000\000\000\377\000\000\000\000\060\027\261VUU\000\000\360\031\261VUU\000\000`\227\262VUU\000\000`\231\262VUU\000\000P\016\261VUU\000\000\220\020\261VUU\000\000\060\027\261VUU\000\000"...
        cfgdir = <optimized out>
        __FUNCTION__ = "init_stuff"
#13 0x00005555555ef48a in main (argc=<optimized out>, argv=0x7fffffffe7a8) at main.c:546
No locals.
(gdb)

Share this post


Link to post
Share on other sites

Thanks.  Ironic that it appears to be crashing in the safe_strncpy() function.  I'll take a closer look later today.

Share this post


Link to post
Share on other sites

Thank you :)

 

Here's the warnings I got when compiling after removing the .deps directory, just in case this helps.


[sb@arch Eternal-Lands]$ git pull
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.

Already up to date.
[sb@arch Eternal-Lands]$ make -f Makefile.linux
  CXX  books.o
  CXX  cal3d_wrapper.o
  CXX  command_queue.o
  CXX  context_menu.o
  CXX  elloggingwrapper.o
  CXX  engine/logging.o
  CXX  exceptions/extendedexception.o
  CXX  font.o
font.cpp: In member function ‘void eternal_lands::Font::draw_ingame_string(const unsigned char*, size_t, float, float, int, float, float) const’:
font.cpp:1250:11: warning: comparison is always true due to limited range of data type [-Wtype-limits]
 1250 |    if (ch >= 0)
      |        ~~~^~~~
  CXX  hud_indicators.o
hud_indicators.cpp:44:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   44 |    static const float zoom(void) { return scale; }
      |           ^~~~~
hud_indicators.cpp:45:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   45 |    static const int space(void) { return (int)(0.5 + scale * 5); }
      |           ^~~~~
hud_indicators.cpp:46:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   46 |    static const int border(void) { return (int)(0.5 + scale * 2); }
      |           ^~~~~
hud_indicators.cpp:47:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   47 |    static const float font_x(void)
      |           ^~~~~
hud_indicators.cpp:52:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

   52 |    static const float font_y(void)
      |           ^~~~~
hud_indicators.cpp:56:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   56 |    static const int y_len(void) { return static_cast<int>(border() + zoom() * font_y() + 0.5); }
      |           ^~~~~
  CXX  hud_timer.o
  CXX  icon_window.o
  CXX  io/cal3d_io_wrapper.o
  CXX  item_info.o
item_info.cpp:52:4: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   52 |    const bool compare(Uint16 the_item_id, int the_image_id) const;
      |    ^~~~~
item_info.cpp:101:2: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  101 |  const bool Item::compare(Uint16 the_item_id, int the_image_id) const
      |  ^~~~~
  CXX  item_lists.o
  CXX  named_colours.o
  CXX  password_manager.o
password_manager.cpp: In member function ‘int Password_Manaager::Window::ui_scale(Password_Manaager::Logins*, window_info*)’:
password_manager.cpp:275:86: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
  275 | win->window_id, scroll_id, ((logins->size() - max_displayed < 0) ?0: logins->size() - max_displayed));
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

  CXX  optimizer.o
  CXX  quest_log.o
  CXX  select.o
  CXX  sendvideoinfo.o
  CXX  trade_log.o
  CXX  user_menus.o
  CXX  xml/xmlhelper.o
  CXX  eye_candy_wrapper.o
eye_candy_wrapper.cpp: In function ‘void* ec_create_effect_from_map_code(char*, float, float, float, int)’:

eye_candy_wrapper.cpp:1025:36: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
 1025 |  const unsigned char*const code2 = (const unsigned char*const) code;
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX  engine/hardwarebuffer.o
  CXX  xor_cipher.o
  CXX  eye_candy/eye_candy.o
  CXX  eye_candy/math_cache.o
  CXX  eye_candy/effect_lamp.o
  CXX  eye_candy/effect_candle.o
  CXX  eye_candy/effect_campfire.o
  CXX  eye_candy/effect_fountain.o
  CXX  eye_candy/effect_teleporter.o
  CXX  eye_candy/effect_firefly.o
  CXX  eye_candy/effect_sword.o
eye_candy/effect_sword.cpp: In member function ‘virtual bool ec::SwordEffect::idle(Uint64)’:
eye_candy/effect_sword.cpp:264:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
  264 |     if (speed > 2.0)
      |     ^~
eye_candy/effect_sword.cpp:269:4: note: here
  269 |    case SWORD_OF_FIRE:
      |    ^~~~
  CXX  eye_candy/effect_summon.o
  CXX  eye_candy/effect_selfmagic.o
  CXX  eye_candy/effect_targetmagic.o
  CXX  eye_candy/effect_ongoing.o
  CXX  eye_candy/effect_impact.o
  CXX  eye_candy/effect_smoke.o
  CXX  eye_candy/effect_bag.o
  CXX  eye_candy/effect_cloud.o
  CXX  eye_candy/effect_harvesting.o
  CXX  eye_candy/effect_wind.o
  CXX  eye_candy/effect_breath.o
  CXX  eye_candy/effect_glow.o
eye_candy/effect_glow.cpp: In constructor ‘ec::GlowEffect::GlowEffect(ec::EyeCandy*, bool*, ec::Vec3*, ec::GlowEffect::GlowType, Uint16)’:
eye_candy/effect_glow.cpp:685:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
  685 |     }
      |     ^
eye_candy/effect_glow.cpp:687:4: note: here
  687 |    case LEVEL_UP_SUM_GLOW:
      |    ^~~~

eye_candy/effect_glow.cpp: In member function ‘virtual bool ec::GlowEffect::idle(Uint64)’:
eye_candy/effect_glow.cpp:795:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
  795 |     }
      |     ^
eye_candy/effect_glow.cpp:797:4: note: here
  797 |    default:
      |    ^~~~~~~
  CXX  eye_candy/effect_mines.o
  CXX  eye_candy/effect_missile.o
  CXX  eye_candy/orbital_mover.o
  CXX  eye_candy/kepler_orbit.o
  CXX  eye_candy/effect_staff.o
  CXX  json_io.o
  LINK el.x86.linux.bin
[sb@arch Eternal-Lands]$

Share this post


Link to post
Share on other sites
4 minutes ago, bluap said:

Thanks.  Ironic that it appears to be crashing in the safe_strncpy() function.  I'll take a closer look later today.

Quote

#1  0x0000555555582854 in safe_strncpy (dest=0x0

The destination is NULL, you'll have to go backwards to see why.

Share this post


Link to post
Share on other sites

Hmm...annoying. I'll have a look tonight if bluap hasn't found the cause yet. Is this a debug or release build, Aisy?

Share this post


Link to post
Share on other sites
9 minutes ago, Aislinn said:

I pulled from git.

 

Now I can't get the old client to run normally.  :bangwall:

 

git checkout bda7573a222fd0aa8acc0851b663dfdbf543128c

 

should get you to a state before the TTF merge.

Share this post


Link to post
Share on other sites
5 minutes ago, Grum said:

 

git checkout bda7573a222fd0aa8acc0851b663dfdbf543128c

 

should get you to a state before the TTF merge.

 

Thanks, fortunately a reboot fixed that issue, whatever it was.  But that would have been my next step!

Share this post


Link to post
Share on other sites

I can reproduce the crash if I enable the "old behaviour" for windowed chat.  Looks like this executes an unexpected path where textures are not initialised before being used.  We could potentially just move init_video() in init.c later in the sequence, at least after the textures are initialised.  This fixes it but I'd want to check further for other consequences.

Edited by bluap

Share this post


Link to post
Share on other sites
32 minutes ago, bluap said:

init_video() in init.c later in the sequence, at least after the textures are initialised.

 

Until the cache is initialized, you mean?

 

I see that the video initialization tries to log to console. I'm a bit confused. How has this ever worked before? And what has the chat window mode got to do with it? Questions, questions...

 

Digging into this.

 

EDIT: no crash here, but my font texture is solid blocks. So something is indeed wrong. Grmbl, tested windowed and tabbed chat, but not console only.

Edited by Grum

Share this post


Link to post
Share on other sites
2 minutes ago, Grum said:

 

Until the cache is initialized, you mean?

 

I see that the video initialization tries to log to console. I'm a bit confused. How has this ever worked before? And what has the chat window mode got to do with it? Questions, questions...

 

Digging into this.

Yes, the cache sorry. It's the CONSOLE_LOG() call that eventually calls update_text_windows() in chat.c.  For the old tabbed chat case, this then calls rewrap_message() which leads to the  path via reset_soft_breaks() in font.cpp.  I presume there's a new path in font.cpp that expects the texture cache to be initialised.

Share this post


Link to post
Share on other sites

Well, this also fixes the issue for me:

diff --git a/chat.c b/chat.c
index 5ce5b571..86f1abca 100644
--- a/chat.c
+++ b/chat.c
@@ -2749,7 +2749,7 @@ void update_text_windows (text_message * pmsg)
        if (console_root_win >= 0) update_console_win (pmsg);
        switch (use_windowed_chat) {
                case 0:
-                       rewrap_message(pmsg, CHAT_FONT, 1.0, get_console_text_width(), NULL);
+//                     rewrap_message(pmsg, CHAT_FONT, 1.0, get_console_text_width(), NULL);
                        lines_to_show += pmsg->wrap_lines;
                        if (lines_to_show > 10) lines_to_show = 10;
                        break;

Long text still gets wrapped afterwards, so somewhere rewrap_message() does get called anyway.

 

On another note, I cannot find the "Window size adjusted" string in the console anyway. Where did it go? [FIXED on github, wrong line count]

 

EDIT: font textures do now indeed get loaded on first use of a font, where they weren't before.

Edited by Grum

Share this post


Link to post
Share on other sites
1 hour ago, Grum said:

Well, this also fixes the issue for me:

 

I'd say this is probably the least incorrect fix. Upon creation of the console window, all existing messages are wrapped, and afterwards new messages are wrapped by the call to update_console_win() two lines before. Since the console window is created before the opening window, there is no way to see a message being cut off due to not being line wrapped. So I'd vote for just removing the call to rewrap_message() in chat.c. Leaving it open for now so bluap can have a looksee, and either agree or tell me why I'm being stupid again.

 

 

Share this post


Link to post
Share on other sites
2 hours ago, Grum said:

I'd say this is probably the least incorrect fix. Upon creation of the console window, all existing messages are wrapped, and afterwards new messages are wrapped by the call to update_console_win() two lines before. Since the console window is created before the opening window, there is no way to see a message being cut off due to not being line wrapped. So I'd vote for just removing the call to rewrap_message() in chat.c. Leaving it open for now so bluap can have a looksee, and either agree or tell me why I'm being stupid again.

Agree, that looks fine.  I presume you'll commit the change.

Share this post


Link to post
Share on other sites
8 hours ago, bluap said:

Agree, that looks fine.  I presume you'll commit the change.

Ok, fixed.

Share this post


Link to post
Share on other sites

Yay, it works now.  Thank you so much both of you!  :)

 

And oh wow at the fonts, this will take some getting used to! 

Share this post


Link to post
Share on other sites

You're more than welcome, I'm glad it works :)

 

Hope you enjoy the TTF fonts, I know I find it a lot easier on the eyes.

Share this post


Link to post
Share on other sites

To be honest, my first impression (on a traditional screen) wasn't all that positive.

Most ttf fonts looked worse than the older bitmap fonts, but like I said, that's on a

traditional (low-res) screen.

Share this post


Link to post
Share on other sites
2 hours ago, revi said:

To be honest, my first impression (on a traditional screen) wasn't all that positive.

Most ttf fonts looked worse than the older bitmap fonts, but like I said, that's on a

traditional (low-res) screen.

Depending on how fast your system is, you may want to enable full-scene anti-aliasing.  Its in the options under the Video tab (restart required - needs adding to the long description).

Edited by bluap

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×