Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Crash while starting Multiplayer-Game #4567

Closed
wzdev-ci opened this issue Mar 25, 2017 · 11 comments
Closed

Crash while starting Multiplayer-Game #4567

wzdev-ci opened this issue Mar 25, 2017 · 11 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_bug | by Leverator


Hi,

I got the following Message while setting up an network game:
warzone2100: ../../src/hb-buffer-private.hh:158: void hb_buffer_t::assert_var(unsigned int, unsigned int): Zusicherung »bits == (allocated_var_bits & bits)« nicht erfüllt.

GDB-Backtrace:

(gdb) run
Starting program: /home/torben/Development/warzone2100/src/warzone2100 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe4abf700 (LWP 11023)]
[New Thread 0x7fffd9bf9700 (LWP 11024)]
info    |02:27:02: [realmain:938] Using /home/torben/.warzone2100-master/logs/WZlog-0325_142702.txt debug file
[New Thread 0x7fffd93f1700 (LWP 11031)]
[New Thread 0x7fffd848a700 (LWP 11032)]
Cannot connect to server socket err = Datei oder Verzeichnis nicht gefunden
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
[Thread 0x7fffd848a700 (LWP 11032) exited]
[New Thread 0x7fffd3fff700 (LWP 11033)]
[Thread 0x7fffd3fff700 (LWP 11033) exited]
[New Thread 0x7fffd3fff700 (LWP 11034)]
[New Thread 0x7fffd8409700 (LWP 11035)]
[New Thread 0x7fffd2fe6700 (LWP 11036)]
[New Thread 0x7fffd0daf700 (LWP 11038)]
[New Thread 0x7fffb7fff700 (LWP 11039)]
warzone2100: ../../src/hb-buffer-private.hh:158: void hb_buffer_t::assert_var(unsigned int, unsigned int): Zusicherung »bits == (allocated_var_bits & bits)« nicht erfüllt.

Thread 11 "wzThread" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffb7fff700 (LWP 11039)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
58      ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) backtrace
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1  0x00007ffff2e5840a in __GI_abort () at abort.c:89
#2  0x00007ffff2e4fe47 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x7ffff57964a0 "bits == (allocated_var_bits & bits)", 
    file=file@entry=0x7ffff5796480 "../../src/hb-buffer-private.hh", line=line@entry=158, 
    function=function@entry=0x7ffff57968e0 "void hb_buffer_t::assert_var(unsigned int, unsigned int)") at assert.c:92
#3  0x00007ffff2e4fef2 in __GI___assert_fail (assertion=0x7ffff57964a0 "bits == (allocated_var_bits & bits)", 
    file=0x7ffff5796480 "../../src/hb-buffer-private.hh", line=158, function=0x7ffff57968e0 "void hb_buffer_t::assert_var(unsigned int, unsigned int)")
    at assert.c:101
#4  0x00007ffff573d151 in ?? () from /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
#5  0x00007ffff5754534 in ?? () from /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
#6  0x00007ffff57780b3 in ?? () from /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
#7  0x00007ffff5749f9a in hb_shape_plan_execute () from /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
#8  0x00007ffff57491a2 in hb_shape_full () from /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
#9  0x0000555555a1d5a5 in TextShaper::shapeText (this=0x5555566020c0 <getShaper()::shaper>, text=..., face=...) at textdraw.cpp:363
#10 0x0000555555a1be0b in TextShaper::getTextMetrics (this=0x5555566020c0 <getShaper()::shaper>, text=..., face=...) at textdraw.cpp:254
#11 0x0000555555a1974b in iV_GetTextWidth (string=0x7fffb0000a50 "No UPnP device was found. You must manually configure your router & firewall to")
    at textdraw.cpp:471
#12 0x000055555572f3b8 in addConsoleMessage (
    Text=0x7fffb7ffe840 "No UPnP device was found. You must manually configure your router & firewall to\nopen port 2100 before you can host a game.", 
    jusType=LEFT_JUSTIFY, player=-2, team=false) at console.cpp:166
#13 0x00005555559dcb18 in upnp_init () at netplay.cpp:1001
#14 0x00007ffff7922eac in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#15 0x00007ffff7972439 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#16 0x00007ffff0c05424 in start_thread (arg=0x7fffb7fff700) at pthread_create.c:333
#17 0x00007ffff2f0c9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105```

___
_Issue migrated from [trac:4567](https://developer.wz2100.net/ticket/4567) at 2022-04-16 12:41:05 -0700_
@wzdev-ci
Copy link
Contributor Author

Leverator commented


After using a gdb brake in testdraw.cpp:363, I get the following:

Thread 1 "warzone2100" hit Breakpoint 1, TextShaper::shapeText (this=0x5555566020c0 <getShaper()::shaper>, text=..., face=...) at textdraw.cpp:363
363                     hb_shape(face.m_font, m_buffer, features.data(), features.size());
(gdb) continue
Continuing.
[Switching to Thread 0x7fffc6fd8700 (LWP 11584)]

Thread 14 "wzThread" hit Breakpoint 1, TextShaper::shapeText (this=0x5555566020c0 <getShaper()::shaper>, text=..., face=...) at textdraw.cpp:363
363                     hb_shape(face.m_font, m_buffer, features.data(), features.size());
(gdb) continue
Continuing.
warzone2100: ../../src/hb-shape-plan.cc:341: hb_bool_t hb_shape_plan_execute(hb_shape_plan_t*, hb_font_t*, hb_buffer_t*, const hb_feature_t*, unsigned int): Zusicherung »buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE« nicht erfüllt.

Thread 14 "wzThread" received signal SIGABRT, Aborted.

My System: Debian Stretch (testing) x86_64

@wzdev-ci
Copy link
Contributor Author

Per changed blocking which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

Per changed blockedby which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

Per commented


I can reproduce this now - sometimes. It seems we try to write to screen from a uPnP-detection side-thread, which won't work, because our text rendering code (and OpenGL) is not thread-safe. I'll have a look at rewriting this.

@wzdev-ci
Copy link
Contributor Author

Per changed priority from normal to blocker

@wzdev-ci
Copy link
Contributor Author

Per changed operating_system which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

Per commented


Related to #4361 - which seems to be an insufficient fix for this issue.

@wzdev-ci
Copy link
Contributor Author

Per Inge Mathisen <per.mathisen@...> changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

Per Inge Mathisen <per.mathisen@...> changed owner from `` to Per Inge Mathisen <per.mathisen@gmail.com>

@wzdev-ci
Copy link
Contributor Author

Per Inge Mathisen <per.mathisen@...> changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

Per Inge Mathisen <per.mathisen@...> committed [03]


In Warzone2100/warzone2100@03d494d:

#CommitTicketReference repository="" revision="03d494d36663e7d483eb2d5f8a498358d0cd64ed"
Fix race condition when writing to console from UPnP thread.

The console and text drawing code are _not_ thread-safe, and should
never be called from side threads!

Also fixes a less serious, non-thread related race condition that would
mean text got truncated too early because the global font was sometimes
wrong for counting pixels while truncating into console buffer.

Closes #4567
Closes #4564
Closes #4546
Actually fixes #4361 and reverts useless fix in that ticket.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant