jota10
The diagram is not seen and the editor crashed with a segfault.
The following output is displayed in term.
After a lot of work I managed to compile wxpython classic for python2.7. I tried a demo that comes with the package and it worked fine.
The simulation does it well, what it cost me was to install pyro.


*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(Beremiz.py:582962): Gtk-CRITICAL **: 19:58:23.693: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

(Beremiz.py:582962): Gtk-CRITICAL **: 19:58:41.684: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

(Beremiz.py:582962): Gtk-CRITICAL **: 19:58:43.371: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
./openplc_editor.sh: línea 8: 582962 Violación de segmento (`core' generado)
python2.7 ./editor/ Beremiz.py
jota10
With dev-python3 I also have other problems.


app-title:
beremiz

app-version:
1.3.3 beta
Release: 2022-07-06 dev-python3

wx-version:
4.1.1

wx-platform:
__WXGTK__

python-version:
3.9.12

platform:
Linux-5.4.0-122-generic-x86_64-with-glibc2.31

e-type:
<class 'wx._core.wxAssertionError'>

e-value:
C++ assertion ""width > 0 && height > 0"" failed at /tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create(): invalid bitmap size

date:
Sat Jul 30 20:48:22 2022

cwd:
/home/jose/plc/OpenPLC_Editor

traceback:
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in OnPaint
dc = self.GetLogicalDC(True)
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in GetLogicalDC
bitmap = wx.Bitmap(*self.Editor.GetClientSize())
<class 'wx._core.wxAssertionError'>: C++ assertion ""width > 0 && height > 0"" failed at /tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create(): invalid bitmap size

locals:
self: <editors.LDViewer.LD_Viewer object at 0x7f512a327f70>
buffered: True

self:
VARIABLE_PANEL_TYPE: 'program'
ParentWindow: <BeremizIDE.Beremiz object at 0x7f512830ac10>
Controler: <ProjectController.ProjectController object at 0x7f510204efd0>
TagName: 'P::Hello_World'
Icon: <wx._core.Bitmap object at 0x7f512a399af0>
Debug: False
MenuItems: []
VariableEditor: <controls.VariablePanel.VariablePanel object at 0x7f512a336040>
Editor: <wx._core.ScrolledWindow object at 0x7f512a39d0d0>
SubscribeTick: True
Inhibited: False
DataConsumers: {}
LastRefreshTime: 1659224886.726861
HasAcquiredLock: False
AccessLock: <unlocked _thread.lock object at 0x7f512a32fd50>
LastRefreshTimer: None
TimerAccessLock: <unlocked _thread.lock object at 0x7f5102054e10>
DataProducer: <ProjectController.ProjectController object at 0x7f510204efd0>
rubberBand: <graphics.RubberBand.RubberBand object at 0x7f5102054910>
Rungs: []
RungComments: []
Blocks: {2: <graphics.LD_Objects.LD_PowerRail object at 0x7f512a39e850>, 3: <graphics.LD_Objects.LD_Contact object at 0x7f512a38e310>, 4: <graphics.FBD_Objects.FBD_Block object at 0x7f512a38e250>, 7: <graphics.FBD_Objects.FBD_Variable object at 0x7f512a38e070>, 5: <graphics.LD_Objects.LD_Coil object at 0x7f512a38e2b0>, 6: <graphics.LD_Objects.LD_PowerRail object at 0x7f512a38ecd0>}
Wires: {<graphics.Graphic_Element.Wire object at 0x7f512a38e220>: 6, <graphics.Graphic_Element.Wire object at 0x7f512a38e190>: 7, <graphics.Graphic_Element.Wire object at 0x7f512a38e820>: 8, <graphics.Graphic_Element.Wire object at 0x7f510205f0a0>: 9, <graphics.Graphic_Element.Wire object at 0x7f510205fa00>: 10}
Comments: {1: <graphics.Graphic_Element.Comment object at 0x7f51020547c0>}
Subscribed: {}
SelectedElement: None
HighlightedElement: None
ToolTipElement: None
LastClientSize: wx.Size(454, 143)
Scaling: (10.0, 10.0)
DrawGrid: True
GridBrush: <wx._core.Brush object at 0x7f512a399b80>
PageSize: None
PagePen: <wx._core.Pen object at 0x7f512cb6aee0>
DrawingWire: False
current_id: 7
Highlights: []
SearchParams: None
SearchResults: None
CurrentFindHighlight: None
InstancePath: ''
StartMousePos: None
StartScreenPos: None
InstanceName: <editors.Viewer.DebugInstanceName object at 0x7f5102054fd0>
LastHighlightCheckTime: 1659224886.7291331
LastToolTipCheckTime: 1659224886.7291522
Buffering: False
CurrentCursor: 0
wire_id: 10
Mode: 0
SavedMode: False
CurrentLanguage: 'LD'
ElementRefreshList: []
ElementRefreshList_lock: <unlocked _thread.lock object at 0x7f5102054f00>
MiniTextDC: <wx._core.MemoryDC object at 0x7f512a399d30>
CurrentScale: 6
ViewScale: (1.0, 1.0)
RefreshHighlightsTimer: <wx._core.Timer object at 0x7f512a399dc0>

In the term.

./ openplc_editor.sh
(Beremiz.py:876334): dbind-WARNING **: 20:46:33.756: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
20:46:44: Debug: Adding duplicate image handler for 'Windows bitmap file'
20:46:44: Debug: Adding duplicate animation handler for '1' type
20:46:44: Debug: Adding duplicate animation handler for '2' type

(Beremiz.py:876334): Gtk-CRITICAL **: 20:48:04.540: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
Traceback (most recent call last):
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in OnPaint
dc = self.GetLogicalDC(True)
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in GetLogicalDC
bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at /tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create(): invalid bitmap size
Traceback (most recent call last):
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in OnPaint
dc = self.GetLogicalDC(True)
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in GetLogicalDC
bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at /tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create(): invalid bitmap size

(Beremiz.py:876334): Gtk-CRITICAL **: 20:48:25.451: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
Traceback (most recent call last):
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in OnPaint
dc = self.GetLogicalDC(True)
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in GetLogicalDC
bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at /tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create(): invalid bitmap size
Traceback (most recent call last):
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in OnPaint
dc = self.GetLogicalDC(True)
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in GetLogicalDC
bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at /tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create(): invalid bitmap size
Traceback (most recent call last):
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in OnPaint
dc = self.GetLogicalDC(True)
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in GetLogicalDC
bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at /tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create(): invalid bitmap size

Traceback (most recent call last):
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in OnPaint
dc = self.GetLogicalDC(True)
File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in GetLogicalDC
bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at /tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create(): invalid bitmap size
./openplc_editor.sh: línea 3: 876334 Violación de segmento (`core' generado)
python3 ./editor/ Beremiz.py

Reply 0 0
thiagoralves
I feel like your system has a mix of several different incompatible libraries. That’s the problem with Linux, you have to use whatever is bundled with the system instead of providing your own libs in a package.

What were you doing when this error appeared. Do you have the editor bug report? Those terminal messages are pretty much useless as there are tons of messages printed from wxwidgets itself
Reply 0 0
jota10
Thank you for answering me at all times. There are two situations. I open the editor and load the project, I display all the tabs of the project and try to change perspective (F12) and nothing happens, nor does it show any message on the console, I select "start plc simulation" and the generation messages are displayed of the source code, etc., without errors and does the simulation with python2.7, but I can't see the diagram and the "segment violation... (core)" occurs and the program crashes. With python 3.9 when trying to simulate it does the same thing with the no module Pyro found error and obviously it doesn't simulate and the program crashes, also core... I tried, without much knowledge, to change import Pyro4 instead of Pyro in PyroServer.py, but it gives me other errors. Could it be that I need another version of a library, I don't know how to solve this, or is it because I work on an old netbook, due to lack of budget I still can't change it? Please help me. and thanks.
Reply 0 0
thiagoralves

The Python 3 version is still esperimental. Simulation does not work on it yet. You must stick with Python 2 if you want to use simulation.

Does simulation work if you don’t change perspective?

Reply 0 0
jota10
With python 3 the simulation does not work.
With either version of python the perspective does not change.
In the console, with python 3 the following is displayed.

Iniciar la construcción en /home/jose/proyectos/Hello World/build
Generando el código ST/IL/SFC IEC-61131 para el SoftPLC...
Compilando el programa IEC en código C...
Extrayendo variables locales...
El código C fué generado con éxito.
PLC:
[CC] plc_main.c -> plc_main.o
[CC] plc_debugger.c -> plc_debugger.o
PLC:
[CC] Config0.c -> Config0.o
[CC] Res0.c -> Res0.o
Enlace:
[CC] plc_main.o plc_debugger.o Config0.o Res0.o -> Hello World.so
Construido con éxito.
/home/jose/plc/OpenPLC_Editor/editor/Beremiz_service.py:344: SyntaxWarning: "is not" with a literal. Did you mean "!="?
dlg.SetTests([(lambda name: len(name) is not 0, _("Name must not be null!"))])

(Beremiz_service.py:66406): dbind-WARNING **: 11:15:49.791: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Beremiz_service: 1.3.3 beta
Traceback (most recent call last):
Release: 2022-07-06 dev-python3
File "/home/jose/plc/OpenPLC_Editor/editor/Beremiz_service.py", line 247, in <module>
class BeremizTaskBarIcon(wx.TaskBarIcon):
AttributeError: module 'wx' has no attribute 'TaskBarIcon'
"/home/jose/anaconda3/bin/python3" "/home/jose/plc/OpenPLC_Editor/editor/Beremiz_service.py" -p 61380 -i localhost -x 1 /tmp/tmp0ihb1kal
Terminado con estatus 1 (pid 66406)
Exception while connecting to 'LOCAL://': cannot import name 'PyroURI' from 'Pyro4.core' (/home/jose/anaconda3/lib/python3.9/site-packages/Pyro4/core.py)
¡La conexión con LOCAL:// falló!


But I don't know what it is that doesn't allow to change the perspective.
Reply 0 0
thiagoralves
The error you posted has nothing to do with perspective change. It is related to simulation not being implemented yet on Python3. As I said before, the Python3 branch is experimental, and some things just aren’t  working yet.

If you can provide a bug report about the perspective error then maybe I can try to figure out where the problem is
Reply 0 0
jota10
When I want to change perspective after loading a project, what I had put before happens, in the console it doesn't show anything and it disappears, the window remains blank and the program crashes and shows only in the terminal, in python 2. In python 3 something happens similar, but it is added that the simulation cannot be done, perhaps this problem should have been dealt with in another topic. If it shows something, it's just in the terminal and it dies.

The messages are different depending on the project, but the sure thing is that it does not change perspective.

python2.7

./ openplc_editor.sh  

(Beremiz.py:1339273): Gtk-CRITICAL **: 14:47:04.555: gtk_box_gadget_distribute
: assertion 'size >= 0' failed in GtkScrollbar
./openplc_editor.sh: línea 8: 1339273 Violación de segmento  (`core' generado)
python2.7 ./editor/ Beremiz.py

===========================================================
python3

./ openplc_editor.sh            

(Beremiz.py:1450478): dbind-WARNING **: 15:04:53.617: Couldn't register with a
ccessibility bus: Did not receive a reply. Possible causes include: the remote
application did not send a reply, the message bus security policy blocked the
reply, the reply timeout expired, or the network connection was broken.
15:05:16: Debug: Adding duplicate image handler for 'Windows bitmap file'
15:05:16: Debug: Adding duplicate animation handler for '1' type
15:05:16: Debug: Adding duplicate animation handler for '2' type

(Beremiz.py:1450478): Gtk-CRITICAL **: 15:07:08.963: gtk_box_gadget_distribute
: assertion 'size >= 0' failed in GtkScrollbar
Traceback (most recent call last):
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in
OnPaint
   dc = self.GetLogicalDC(True)
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in
GetLogicalDC
   bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at
/tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create()
: invalid bitmap size
Traceback (most recent call last):
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in
OnPaint
   dc = self.GetLogicalDC(True)
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in
GetLogicalDC
   bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at
/tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create()
: invalid bitmap size
Traceback (most recent call last):
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in
OnPaint
   dc = self.GetLogicalDC(True)
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in
GetLogicalDC
   bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at
/tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create()
: invalid bitmap size

(Beremiz.py:1450478): Gtk-CRITICAL **: 15:07:40.723: gtk_box_gadget_distribute
: assertion 'size >= 0' failed in GtkScrollbar
Traceback (most recent call last):
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in
OnPaint
   dc = self.GetLogicalDC(True)
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in
GetLogicalDC
   bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at
/tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create()
: invalid bitmap size
Traceback (most recent call last):
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 3724, in
OnPaint
   dc = self.GetLogicalDC(True)
 File "/home/jose/plc/OpenPLC_Editor/editor/editors/Viewer.py", line 855, in
GetLogicalDC
   bitmap = wx.Bitmap(*self.Editor.GetClientSize())
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at
/tmp/pip-req-build-nr5tmh9x/ext/wxWidgets/src/gtk/bitmap.cpp(539) in Create()
: invalid bitmap size

(Beremiz.py:1450478): Gtk-CRITICAL **: 15:09:58.629: gtk_box_gadget_distribute
: assertion 'size >= 0' failed in GtkScrollbar

(Beremiz.py:1450478): Gtk-CRITICAL **: 15:10:10.441: gtk_box_gadget_distribute
: assertion 'size >= 0' failed in GtkScrollbar
./openplc_editor.sh: línea 3: 1450478 Violación de segmento  (`core' generado)
python3 ./editor/ Beremiz.py



Reply 0 0
thiagoralves
Works fine for me on Ubuntu:
ubuntu1.png  ubuntu2.png 
Reply 0 0
thiagoralves
Tested on Linux Mint and the result is the same, it works. I even played around with very low screen resolutions (like 1024x768 for example which was very common on netbooks back in the day), and it all worked just fine.
Reply 0 0
jota10
Thank you Thiago for your commitment. If it is the screen, I am complicated, because I have a resolution of 1024x600. I'll have to use an older version, because at some point it worked fine. Where did you get old versions from? I love this app, but sadly I shouldn't post this here on the forum, I still can't switch machine.
Reply 0 0
thiagoralves
I have the feeling that this is being caused by some inconsistency in your setup. The code for changing perspective hasn't been modified in ages. Getting an older version would be the same. In any case, you can get any version you want straight from GitHub. Just browse through the project's history from here:  https://github.com/thiagoralves/OpenPLC_Editor/commits/master then select a version you would like, click on "Browse Files" and then on the next screen go to "Code" -> "Download ZIP" 
Reply 0 0
thiagoralves
Perhaps the best way to fix it would be for you to reinstall your OS with fresh libraries. One thing you can try is boot a fresh Linux OS from a USB stick and then install OpenPLC Editor on that. If everything works fine, then definitely your OS is the culprit.
Reply 0 0
jota10
I was trying to debug and it showed me an error, which uses python3.8 as python, I corrected it, it did not give the error but it was not solved. I'm going to do what you told me about the USB stick.
Reply 0 0
Reply