Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 09:51:19 +0000



[User Discussion] - Linux

View Count: 73735

[2020-09-26 11:35:06]
User921987 - Posts: 234
I finally managed to get some free time and look the bug35041 issue which have this "taskset" workaround. In the winehq bug tracking comments we can see Jacek Caban (codeweaver's developer) was able to locate the problem into the X11 Client-side library where there is some cached objects which are not handled thread-safe. In the x11 developer's mailing list he introduced some hacks how to fix the situation. Then later some commenter in winehq said this fix helped him too.

After several years the thing is still open for a reason or another...

Because of this it doesn't necessarily mean that the origin of the problem is still in the X11. But if this really is a result of bad programming in X11 client library then this may explain why we haven't got any help when the new versions of wine has been released in the past.

This is more a question of X11.

So what I did I first checked my current Debian Buster 10.5 client-side X11 library and found it is a version of 1.6.7 (2018-10-09). Then I went to X11 code base and found that the newest "official" version is 1.6.12 (2020-8-25) which I downloaded and compiled. Btw. the most latest developer's version can be found https://gitlab.freedesktop.org/xorg/lib/libx11 but I downloaded the code from https://www.x.org/releases/individual/lib/

Now I've been using these new libraries (3 of them but I think only 1 used) for some hours with no problems yet (without tasket). This of course needs a lot of more testing time to see really what is the situation.

If the problem still occurs then the next thing I will do is the Jacek's hacks into the source and compile a new version. I am quite busy man in my other projects so this may take some time so I decided to come here and tell you what I am doing so in the meantime maybe this can be some help for somebody.
[2020-09-26 12:16:11]
Kiwi - Posts: 374
Thanks ertrader and User106072 for the updates on your explorations.

I'm currently running SC on one with taskset which runs with no issues but I'm lucky that I have so little running on my little Ryzen 5 3600. I wish you and look forward to your progress.
[2020-09-26 23:20:26]
ertrader - Posts: 645
Thank you User106072....really appreciate the update and effort to get this fixed! Do you by any chance know what it is about ProtonGE that fixes the taskset issue? Possibly between that and Jacek's solution there is a permanent fix in mainstream wine.
[2020-09-27 06:05:04]
User921987 - Posts: 234
Thx guys.

ertrader I don't know ProtonGE, but I quess there is 2 options a) they have implemented task priority settings directly (even using multicore) into their system b) they have their own fixed X11 Client library and are not using the version which comes with your distro.

Btw.
Have you tried to set priorities via wine start command options (/affinity or /high or /low etc.) does it make any change in behaviour ?

But if the problem is in thread-safe things in X11 (and not fixed in the latest versions) then it's just a matter of time when it happens again. I recommend you to update the x11 client library to the latest one. For example in my case from 1.6.7 -> 1.6.12 there was a lot of changes and other bug fixes in the code which may result a side effect to fix the problem.

Here is how I did the update:


#!/bin/bash
X11_VERSION=1.6.12
LIB=libX11-${X11_VERSION}
FILE=${LIB}.tar.gz

read -p "Press [Enter] to get and make ${LIB} "
[[ ! -f $FILE ]] && wget https[COLON]//www.x.org/releases/individual/lib/${FILE}
tar xvfz ${FILE}
cd ${LIB}
./configure --prefix=/usr/local/libx11/${X11_VERSION}
make -j4 2> make_errors.txt

read -p "Press [Enter] to see possible make warnings & errors"
less make_errors.txt

read -p "Press [Enter] to install..."
sudo make install

read -p "Press [Enter] to overwrite existing librarires..."
sudo cp --backup=t /usr/local/libx11/${X11_VERSION}/lib/libX11.a /usr/lib/x86_64-linux-gnu/
sudo cp --backup=t /usr/local/libx11/${X11_VERSION}/lib/libX11.so.6.3.0 /usr/lib/x86_64-linux-gnu/
sudo cp --backup=t /usr/local/libx11/${X11_VERSION}/lib/libX11-xcb.so.1.0.0 /usr/lib/x86_64-linux-gnu/

Nah. For some reason Code blocks in this message does not work right. Replace the "[COLON]" with the ":"

You will need your distro's development packages installed to do this. In debian it's build-essential. THE ABOVE SCRIPT IS JUST MY EXAMPLE to give you the idea what to do. For your case search google for more help and check specially where your current library files are located.

When compiling I received a lot of messages but they were all warnings only and didn't look dangerous (in my "40 years of coding" eyes:). This is because of different compiler settings and versions. I did this by the gcc 8.3.0.

If your system hangs or other problems occurs while testing new libraries you can always restore the original versions from the backups done in the last 3 script lines.

After all do not put this into production until after heavy testing :)

EDIT:
Please see a new version of the above script found later in post #312
Date Time Of Last Edit: 2020-09-29 06:50:43
[2020-09-27 10:34:20]
AlexPereira - Posts: 197
Well, knowing that this is already a 7 years old x11 bug ... ( damn , really ?? shame )

I think that is a much easier simpler way ( maybe is more "hopefull" that wine goes full wayland ... hehe, this bug fixed on x11 or wine going full wayland, I wonder on what comes first :P )

You can always do this:

for x in $(pgrep "SierraChart|.exe|wine") ; do taskset -pac 0-7 $x ; done

In my case, I have an i7 , so from 0-7. ( I think from a recomendation from SC is to disable hyperthreading, so in my case, since its an intel i7, from 0-3. you can check your cores/threads with "lscpu -e" ).

So I have a script that starts SC with just taskset in 1 core, and after 1m minute, just sets the taskset back to all 4 cores.
I am trying this way today, not finding any issues.
[2020-09-27 12:48:43]
User921987 - Posts: 234
It seems this is a bug of X11 and if I remember right (?!) there is no active issue in X11 development -> https://gitlab.freedesktop.org/xorg/lib/libx11/-/issues (or do you see there anything similar?)

Anyway what I understand the origin of the problem is in the way of how some objects are handled badly (not thread-safe) in the X11 client library code. So lowering the # of CPU cores to 1 at startup will remove the thread-safe problem at startup but lifting the number of cores back later should put the system back to the state where the bug can activate later...

My system crashed at the startup and also later during the normal program execution but using taskset I am able to run SC without any problems. It's just slower.

This is why I am trying to find a solution where I don't have to use taskset.

But this all is just my quessing game because I have not debugged the bug in the code by myself. I've just read about it from the code fix made by others. So there is still possibility that your workaround is valid too.

btw. I have been "stress testing" now the new library code about 24 hours without any problems (without taskset). Also a new Wine version 5.18 popped out few days ago. Im using it.

EDIT:
I wrote an email for Jacek let's see if he can give any new information for us.
Date Time Of Last Edit: 2020-09-27 14:52:25
[2020-09-27 18:32:01]
ertrader - Posts: 645
I'm on Mint Linux 20 and have just kept default X11 with updates. Running xdpyinfo shows 1.20.8.

xdpyinfo | grep version

version number: 11.0
X.Org version: 1.20.8

I have not tried setting priorities..not sure how to do that.

Also, I've reached out to the developer of ProtonGE for potential help or guidance.

For reference, in April 2020, I submitted a bugzilla. The result was the taskset workaround.
https://bugs.winehq.org/show_bug.cgi?id=48884
Date Time Of Last Edit: 2020-09-27 18:40:37
[2020-09-27 20:00:48]
User921987 - Posts: 234
ertrader we are interested in the X11 client-side library libx11 which has it's own version number separate from X.Org version.

If you want to check yours the following command should work in Mint:

dpkg -l | grep 'libx11'

Here is my output showing 1.6.7 which I have now replaced by the 1.6.12 library files (see the script @ #278):

ii libx11-6:amd64 2:1.6.7-1+deb10u1 amd64 X11 client-side library

btw. It was a good idea to get contact with ProtonGE devs
Date Time Of Last Edit: 2020-09-27 20:01:30
[2020-09-27 20:06:01]
ertrader - Posts: 645
Here is the result of: dpkg -l | grep 'libx11'


ii libx11-6:amd64 2:1.6.9-2ubuntu1.1 amd64 X11 client-side library
ii libx11-6:i386 2:1.6.9-2ubuntu1.1 i386 X11 client-side library
ii libx11-data 2:1.6.9-2ubuntu1.1 all X11 client-side library
ii libx11-protocol-perl 0.56-7 all Perl module for the X Window System Protocol, version 11
ii libx11-xcb1:amd64 2:1.6.9-2ubuntu1.1 amd64 Xlib/XCB interface library
ii libx11-xcb1:i386 2:1.6.9-2ubuntu1.1 i386 Xlib/XCB interface library
Date Time Of Last Edit: 2020-09-27 20:29:11
[2020-09-27 20:29:55]
User921987 - Posts: 234
As we can see your version is 1.6.9 while the most recent is 1.6.12. In my case it seems (at least until now) the update to .12 was the right move. But I would like to get some replies from those devs before further actions.

I hope I can return to this matter next weekend.
[2020-09-27 20:39:00]
ertrader - Posts: 645
Thank you. I'd like to see what they say too... my system is stable and working well with ProtonGE. Trading starts soon tonight and do not need to risk any issues.
[2020-09-28 08:04:40]
Kiwi - Posts: 374
I followed User106072's instructions to build 1.6.12 then copied the files to /usr/lib/x86_64-linux-gnu/. Ran today with affinity to 2,4,6 for SC & 4 for wine without problems for 6 hours (previously I was limited to 1 thread for reliable operation (different for wine & sc)). Now changed to affinity 0-11 for both Sierra and wine. Will leave it running for 5 hours this evening and see if I experience any issues. And again during working hours tomorrow if its clear.

I am assuming that Sierra hasn't changed in a way that made this work given it was a change in SC that caused the sudden loss of reliability. Is anyone still having problems?

Configuration:
SierraChart Version 2175 64 bit
wine 5.5 (Ubuntu 5.5-3ubuntul)
Mint Linux 20
Kernel 5.4.0-48 generic
AMD Ryzen 5 3600
NVIDIA Corporation GP108 [GeForce GT 1030]
Dual Monitors
Date Time Of Last Edit: 2020-09-28 08:20:31
[2020-09-28 08:28:37]
Kiwi - Posts: 374
LOL. For the record. I have a 2161 installation that I use to calculate some stats for the next morning (collects tick data rather than 5 sec data).

Opened it ... Crashed.

Opened it ... Froze.

Guess what's changed.

Upgrade to 2175 ... now good ....

Downgrade to 2161 and ... crashed.
[2020-09-28 08:37:09]
Cavalry3162 - Posts: 523
thats what i love about Arch - https://www.archlinux.org/packages/extra/x86_64/libx11/

no need to workaround lazy ubuntu maintainers...
[2020-09-28 12:23:33]
ganz - Posts: 1048
Andreas

:)

~> sudo dnf info libX11

Installed Packages
Name : libX11
Version : 1.6.12
Release : 1.fc32
Architecture : x86_64
Size : 1.3 M
Source : libX11-1.6.12-1.fc32.src.rpm
Repository : @System
From repo : updates
Summary : Core X11 protocol client library
URL : http://www.x.org
License : MIT
Description : Core X11 protocol client library.

[2020-09-28 12:27:49]
Kiwi - Posts: 374
Arch is fun (I really do like it) but Mint is just an easy way to have a stable Linux attractive to people who preferred older style windows to mac desktops.

But the main point I suspect is that a recent change to Sierra Chart probably undid the problem that came up back after between Sierra Chart 2109 and 2116. I will run with the 1.6.12 X11 for a couple of days to prove that 2175 is stable then drop back to 1.6.9 to see if there is any difference.

Either way, if we're stable, I'm a box of fluffy ducks.
Date Time Of Last Edit: 2020-09-28 13:05:57
[2020-09-28 15:52:00]
ertrader - Posts: 645
When I try to run the above script... at the end, I'm getting:

checking keysym definitions... Package xproto was not found in the pkg-config search path.
Perhaps you should add the directory containing `xproto.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xproto' found
configure: error: /X11 doesn't exist or isn't a directory


I'm not sure what xproto.pc is and was not able to find anything helpful with searches... any suggestions?

I do have build essentials installed:
GNU Make 4.2.1
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0

Edit: I did finally get further but still shows the prior version.
Date Time Of Last Edit: 2020-09-28 18:27:07
[2020-09-28 17:25:05]
ganz - Posts: 1048
finally this discussion becomes a real and linux geeks go out from the darkness.
so no trash talks will be needed any more I believe


Kiwi
https://torrent.fedoraproject.org/

https://rpmfusion.org/Howto

FedoraProject is very simple, stable and user friendly these days except KDE/LXQT that are Qt5 based buggy ones.
Date Time Of Last Edit: 2020-09-28 19:23:46
[2020-09-28 19:31:44]
AlexPereira - Posts: 197
SC version 2175 and libX11 1.6.12 still freezes at startup if not using taskset.

After startup, don't have any problem, if I change cpu affinity or not.
[2020-09-28 19:37:40]
User816220 - Posts: 80
checking keysym definitions... Package xproto was not found in the pkg-config search path.
Perhaps you should add the directory containing `xproto.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xproto' found
configure: error: /X11 doesn't exist or isn't a directory


I'm not sure what xproto.pc is and was not able to find anything helpful with searches... any suggestions?

It looks like your system is missing a development package. I don't use Mint/Ubuntu/Debian, but x11proto-dev appears to be the one you need.

xproto.pc is a file that tells pkg-config how the xproto library was built and installed, so that other software can link against it. If building fails again with another "No package 'xproto' found" style message, you can look up which package provides it by going to https://packages.ubuntu.com/ and using the "Search the contents of packages" option. Searching for "xproto.pc" shows /usr/share/pkgconfig/xproto.pc ==> x11proto-dev
[2020-09-28 20:14:12]
ertrader - Posts: 645
I'm not getting those errors any longer... however I am seeing:
bash: ./configure: No such file or directory

However, it looks like the old version is still installed.
Date Time Of Last Edit: 2020-09-28 21:26:38
[2020-09-28 21:22:56]
User921987 - Posts: 234
My system hasn't crashed since last saturday. After quick reading new posts here it looks the bug is still active. Changed but still active.

It looks Kiwi is able to compile source codes and because I am not able to reproduce the issue anymore how about if I do a patch which is based on the code found in the lib11x developer's mailing list and you can then try it in a setup which currently doesn't work without the taskset?

I should be able to do it next weekend.
[2020-09-28 21:28:25]
ertrader - Posts: 645
Yes, that would be helpful, that may enable getting on the latest X11 version. There is still something not working on my end.... most likely user error...lol.
[2020-09-28 21:57:27]
Kiwi - Posts: 374
@ertrader: Mine also shows the old version. I checked though and the 3 original files have been replaced with the newly compiled ones.

@AlexPereira: I use the following command (binding Sierra's standard config to Super 2) from xbindkeys to launch Sierra now:

/usr/bin/wine /home/john/.wine/drive_c/SC64/SierraChart_64.exe &

This morning it started up again free of problems but will run it for the next two days before I put libX11.a, libX11.so.6.3.0, and libX11-xcb.so.1.0.0 back in /usr/lib/x86_64-linux-gnu/ . I'll attempt that by uninstalling and reinstalling those from synaptic.
Date Time Of Last Edit: 2020-09-28 22:02:11
[2020-09-28 22:01:36]
AlexPereira - Posts: 197
My system hasn't crashed since last saturday. After quick reading new posts here it looks the bug is still active. Changed but still active.

It looks Kiwi is able to compile source codes and because I am not able to reproduce the issue anymore how about if I do a patch which is based on the code found in the lib11x developer's mailing list and you can then try it in a setup which currently doesn't work without the taskset?

I should be able to do it next weekend.

That reminded me to try out the patches really.
So I made this ( if any opensuse user is interested ): https://build.opensuse.org/package/show/home:pereira_alex:branches:X11:XOrg/libX11
( an opensuse build service package of libx11 with the patchs applied. anytime opensuse updates the original package, it should be updated. you can check the libx11_{1,2,3}.diff files or the "link diff" directly )

I made a quick test, and 10 times starting and exiting, and no issues found.
Date Time Of Last Edit: 2020-09-28 22:02:51

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account