lucaschess icon indicating copy to clipboard operation
lucaschess copied to clipboard

No black moves for opening repertoire on Linux

Open antoyo opened this issue 7 years ago • 29 comments

Hi. This issue only exists in the Linux version; the Windows version works fine. For any feature involving opening repertoire, there are no moves for black. For instance, when I create a custom repertoire, I can only enter white moves. Same for opening lines. Thanks to fix this issue.

antoyo avatar Sep 08 '18 23:09 antoyo

Are you trying the binary version to Linux 64 bits?

https://drive.google.com/open?id=1joGQWTmJMVfYGyLLdpayo5KHcTfqxi1-

lukasmonk avatar Sep 09 '18 06:09 lukasmonk

I was trying the git version, but same problem with this.

antoyo avatar Sep 09 '18 13:09 antoyo

Is there some data in bug.log file (in install folder)? What version have you, 32bits or 64 bits? What Linux distibution?

lukasmonk avatar Sep 09 '18 19:09 lukasmonk

This file contains:

Traceback (most recent call last):
  File "Code/QT/WBase.py", line 281, in procesarAccion
  File "Code/Procesador.py", line 502, in procesarAccion
  File "Code/Procesador.py", line 609, in menuTools
  File "Code/Procesador.py", line 639, in menuTools_run
  File "Code/QT/WOpeningGuide.py", line 82, in __init__
  File "Code/QT/WOpeningGuide.py", line 116, in inicializa
  File "Code/QT/WBG_Moves.py", line 205, in ponFenM2inicial
  File "Code/QT/WBG_Tree.py", line 229, in showChildren
  File "Code/QT/WBG_Tree.py", line 227, in showChildren
  File "Code/QT/WBG_Tree.py", line 183, in showUnMove
  File "Code/OpeningGuide.py", line 191, in pgnNum
  File "Code/OpeningGuide.py", line 176, in pgn
  File "Code/ControlPosicion.py", line 297, in pgnSP
TypeError: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "Code/QT/WBase.py", line 281, in procesarAccion
  File "Code/Procesador.py", line 502, in procesarAccion
  File "Code/Procesador.py", line 609, in menuTools
  File "Code/Procesador.py", line 639, in menuTools_run
  File "Code/QT/WOpeningGuide.py", line 82, in __init__
  File "Code/QT/WOpeningGuide.py", line 116, in inicializa
  File "Code/QT/WBG_Moves.py", line 205, in ponFenM2inicial
  File "Code/QT/WBG_Tree.py", line 229, in showChildren
  File "Code/QT/WBG_Tree.py", line 227, in showChildren
  File "Code/QT/WBG_Tree.py", line 183, in showUnMove
  File "Code/OpeningGuide.py", line 191, in pgnNum
  File "Code/OpeningGuide.py", line 176, in pgn
  File "Code/ControlPosicion.py", line 297, in pgnSP
TypeError: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "Code/QT/WBase.py", line 281, in procesarAccion
  File "Code/Procesador.py", line 502, in procesarAccion
  File "Code/Procesador.py", line 609, in menuTools
  File "Code/Procesador.py", line 639, in menuTools_run
  File "Code/QT/WOpeningGuide.py", line 82, in __init__
  File "Code/QT/WOpeningGuide.py", line 116, in inicializa
  File "Code/QT/WBG_Moves.py", line 205, in ponFenM2inicial
  File "Code/QT/WBG_Tree.py", line 229, in showChildren
  File "Code/QT/WBG_Tree.py", line 227, in showChildren
  File "Code/QT/WBG_Tree.py", line 183, in showUnMove
  File "Code/OpeningGuide.py", line 191, in pgnNum
  File "Code/OpeningGuide.py", line 176, in pgn
  File "Code/ControlPosicion.py", line 297, in pgnSP
TypeError: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "Code/QT/WBase.py", line 281, in procesarAccion
  File "Code/Procesador.py", line 502, in procesarAccion
  File "Code/Procesador.py", line 609, in menuTools
  File "Code/Procesador.py", line 639, in menuTools_run
  File "Code/QT/WOpeningGuide.py", line 82, in __init__
  File "Code/QT/WOpeningGuide.py", line 116, in inicializa
  File "Code/QT/WBG_Moves.py", line 205, in ponFenM2inicial
  File "Code/QT/WBG_Tree.py", line 229, in showChildren
  File "Code/QT/WBG_Tree.py", line 227, in showChildren
  File "Code/QT/WBG_Tree.py", line 183, in showUnMove
  File "Code/OpeningGuide.py", line 191, in pgnNum
  File "Code/OpeningGuide.py", line 176, in pgn
  File "Code/ControlPosicion.py", line 297, in pgnSP
TypeError: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "Code/QT/WBase.py", line 281, in procesarAccion
  File "Code/Procesador.py", line 502, in procesarAccion
  File "Code/Procesador.py", line 609, in menuTools
  File "Code/Procesador.py", line 639, in menuTools_run
  File "Code/QT/WOpeningGuide.py", line 82, in __init__
  File "Code/QT/WOpeningGuide.py", line 116, in inicializa
  File "Code/QT/WBG_Moves.py", line 205, in ponFenM2inicial
  File "Code/QT/WBG_Tree.py", line 229, in showChildren
  File "Code/QT/WBG_Tree.py", line 227, in showChildren
  File "Code/QT/WBG_Tree.py", line 183, in showUnMove
  File "Code/OpeningGuide.py", line 191, in pgnNum
  File "Code/OpeningGuide.py", line 176, in pgn
  File "Code/ControlPosicion.py", line 297, in pgnSP
TypeError: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "Code/QT/PantallaPotencia.py", line 728, in comprobar
  File "Code/XGestorMotor.py", line 242, in analizaJugada
  File "Code/XGestorMotor.py", line 126, in testEngine
  File "Code/XMotor.py", line 45, in __init__
  File "Code/XMotor.py", line 372, in order_uci
  File "Code/XMotor.py", line 96, in put_line
  File "Code/EngineThread.py", line 93, in put_line
IOError: [Errno 32] Relais brisé (pipe)
Traceback (most recent call last):
  File "Code/QT/Grid.py", line 345, in mouseDoubleClickEvent
  File "Code/QT/WBase.py", line 336, in gridDobleClick
  File "Code/Gestor.py", line 971, in analizaPosicion
  File "Code/Analisis.py", line 746, in muestraAnalisis
  File "Code/Analisis.py", line 714, in creaMuestraInicial
  File "Code/Analisis.py", line 545, in __init__
  File "Code/Analisis.py", line 576, in hazListaRM
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Traceback (most recent call last):
  File "Code/QT/POLAnalisis.py", line 455, in menuContexto
UnboundLocalError: local variable 'quien' referenced before assignment
Traceback (most recent call last):
  File "Code/QT/WBase.py", line 281, in procesarAccion
  File "Code/Procesador.py", line 502, in procesarAccion
  File "Code/Procesador.py", line 609, in menuTools
  File "Code/Procesador.py", line 639, in menuTools_run
  File "Code/QT/WOpeningGuide.py", line 82, in __init__
  File "Code/QT/WOpeningGuide.py", line 116, in inicializa
  File "Code/QT/WBG_Moves.py", line 205, in ponFenM2inicial
  File "Code/QT/WBG_Tree.py", line 229, in showChildren
  File "Code/QT/WBG_Tree.py", line 227, in showChildren
  File "Code/QT/WBG_Tree.py", line 183, in showUnMove
  File "Code/OpeningGuide.py", line 191, in pgnNum
  File "Code/OpeningGuide.py", line 176, in pgn
  File "Code/ControlPosicion.py", line 297, in pgnSP
TypeError: argument of type 'NoneType' is not iterable

But I'm not sure this is relevant, because I was unable to have new data in this file by reproducing this issue. It's the 64-bit version. I use ArchLinux.

antoyo avatar Sep 09 '18 19:09 antoyo

Sorry, I have no idea. (With the binary distribution in a Cinnamon-64 bits, I have no problem) With the binary distribution, first remove bug.log, then you could try renaming UsrData folder to UsrData0, by example and then exec xlucas.sh, open Opening Lines distribution. If fail, in this folder could you exec chmod -R 777 * to assign all permisions, then ./xlucas.sh And show again the new bug.log file.

lukasmonk avatar Sep 09 '18 19:09 lukasmonk

The only error I got was the following, when I double-clicked on the new opening:

Traceback (most recent call last):
  File "Code/QT/Grid.py", line 345, in mouseDoubleClickEvent
  File "Code/QT/PantallaAperturas.py", line 754, in gridDobleClick
  File "Code/QT/PantallaAperturas.py", line 810, in editar
  File "Code/Variantes.py", line 16, in editaVariante
  File "Code/GestorVariantes.py", line 31, in inicio
AttributeError: UnPGN instance has no attribute 'partida'

I'll take a look at the code to try to find what's the issue.

antoyo avatar Sep 09 '18 19:09 antoyo

You could insert in line 73 of PGNreader.py:

import sys
sys.stderr.write("\n[%s]\n[%s]\n" %(fen,txt))

To know which is the text sended to bug.log.

lukasmonk avatar Sep 09 '18 20:09 lukasmonk

Can you please tell me where is the check to know if a piece can move, depending on whether it is white or black to play, for the board opened by Custom openings → New?

antoyo avatar Sep 09 '18 20:09 antoyo

File: Code/GestorVariantes.py Method: def mueveHumano line:184

lukasmonk avatar Sep 09 '18 20:09 lukasmonk

First test I did is to print jg and play the moves d4, c4 and Nc3 (without black moves because I can't) and here's the output:

d2 d4 : rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
c2 c4 : rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
b1 c3 : rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

If you find anything abnormal in this, please tell me. I'll try other tests.

antoyo avatar Sep 09 '18 20:09 antoyo

The poblem can be detected (perhaps) in line 73 of PGNreader.py:

To know which is the text sended and the fen..

lukasmonk avatar Sep 09 '18 20:09 lukasmonk

In file: Code/GestorVariantes.py Method: def mueveHumano from line:184 the question is, when it is produced a bug, in which line. bug.log, is indicating this probably.

lukasmonk avatar Sep 09 '18 20:09 lukasmonk

The PGN reader looks fine. For instance, with the following PGN:

[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
[ECO "C50"]

1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6  *

I get the following fen and txt:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6  *

There's not output in bug.log when the bug happens.

antoyo avatar Sep 09 '18 20:09 antoyo

The problem is not reading a pgn, the problem is that it is trying to read an automatic pgn, created by the program, and which for any reason is incorrect.

lukasmonk avatar Sep 09 '18 20:09 lukasmonk

I'm not sure I explained the problem correctly, so I'll give you screenshots of this issue in another scenario. If I go in Tool → Create your own game, I can only play the white pieces, even multiple times in a row. mouseblackpiece As you can see in the previous image, the mouse cursor indicates that I cannot move a black piece. mousewhitepiece The cursor here indicates that I can move a white piece.

So, it seems to me that it is more of a GUI problem.

antoyo avatar Sep 09 '18 21:09 antoyo

Yes it is a GUI problem, playing in a context that I can´t replicate because all other contexts (windows-Linux Cinnamon64) that I could control works well. For this reason, I need information, and the next could be a good way:

You could insert in line 73 of PGNreader.py:

import sys
sys.stderr.write("\n[%s]\n[%s]\n" %(fen,txt))

To know which is the text sended to bug.log.

lukasmonk avatar Sep 09 '18 21:09 lukasmonk

When I do Create you own game, no text is sent to bug.log. In custom openings, I only see:

[rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1]
[]

And when I import a PGN file, I already posted what I see here.

antoyo avatar Sep 09 '18 21:09 antoyo

So, for some reasons, Tablero.activaColor is always called with siBlancas=True. Does that look normal?

antoyo avatar Sep 09 '18 21:09 antoyo

No.

Create your own game is controlled in file GestorSolo.py

The loop to read moves is in line 324: def siguienteJugada (nextMove in english)

The side is controlled in line 333: siBlancas = ... (is White or not)

The move done by user is checked in line 365: def mueveHumano (humanMove in english)

Something in this method is working bad, because of this the move is not added to variable that controls the game (self.partida)

It is needed to test if all lines are executed, and why is not added the move, at end why the line 393 is not executed ?

lukasmonk avatar Sep 09 '18 21:09 lukasmonk

When I print jg and play multiple moves, I get the following:

e2 e4 : rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
d2 d4 : rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

Does the FEN next to the move indicate the current position? If yes, it looks like the move is not actually registered in the game state and that seems to be the case, because I cannot play e5 after I played e4, for instance.

It looks like the move is registered by the LCEngine, whatever that is. Could there be a problem in the LCEngine.so file that I have which would trigger this issue on my computer?

antoyo avatar Sep 09 '18 21:09 antoyo

Could be. But a way to know it is to follow that I have indicated in the previous message.

lukasmonk avatar Sep 10 '18 15:09 lukasmonk

All of mueveHumano (except the block if self.siJuegaMotor and not self.partida.siEstaTerminada():) is executed and self.partida.append_jg is indeed called.

antoyo avatar Sep 10 '18 22:09 antoyo

Then jg variable is incorrect. You could try to recompile LCEngineV1.so and irina.so, from folder LCEngine, subfolder irina.

lukasmonk avatar Sep 11 '18 20:09 lukasmonk

Recompiling seemed to have fixed the issue. But I just noticed many other bugs like I cannot open the personal opening guide and even a segfault. Are you able to open the personal opening guide on your side, in the Linux version?

Edit: Here's the logs for the personal opening guide:

Traceback (most recent call last):
  File "Code/QT/WBase.py", line 281, in procesarAccion
  File "Code/Procesador.py", line 502, in procesarAccion
  File "Code/Procesador.py", line 609, in menuTools
  File "Code/Procesador.py", line 639, in menuTools_run
  File "Code/QT/WOpeningGuide.py", line 82, in __init__
  File "Code/QT/WOpeningGuide.py", line 116, in inicializa
  File "Code/QT/WBG_Moves.py", line 205, in ponFenM2inicial
  File "Code/QT/WBG_Tree.py", line 229, in showChildren
  File "Code/QT/WBG_Tree.py", line 227, in showChildren
  File "Code/QT/WBG_Tree.py", line 183, in showUnMove
  File "Code/OpeningGuide.py", line 191, in pgnNum
  File "Code/OpeningGuide.py", line 176, in pgn
  File "Code/ControlPosicion.py", line 297, in pgnSP
TypeError: argument of type 'NoneType' is not iterable

antoyo avatar Sep 11 '18 23:09 antoyo

It works in cinnamon-64 without problems.

File "Code/ControlPosicion.py", line 297, in pgnSP This is in relation to LCEngine.

lukasmonk avatar Sep 12 '18 14:09 lukasmonk

I understand that it works with the cinnamon desktop environement, but which distribution do you use?

antoyo avatar Sep 12 '18 15:09 antoyo

Linux Mint 18.1 - Cinnamon 64 bits

lukasmonk avatar Sep 12 '18 16:09 lukasmonk

I've tried with the same distribution and it indeed works.

antoyo avatar Sep 12 '18 19:09 antoyo

It seems that for some reason LCEngineV1.so or libirina.so, are not working properly in ArchLinux.

lukasmonk avatar Sep 12 '18 20:09 lukasmonk