silx-kit / silx

silx toolkit
http://www.silx.org/doc/silx/latest/
MIT License
129 stars 73 forks source link

Dirty files in debian package ... #3025

Open kif opened 4 years ago

kif commented 4 years ago

The debian package python3-silx (from silx.org) installs some files into thirds party places like: /usr/lib/x86_64-linux-gnu/qt5/plugins/designer/python/plot1dplugin.py and those files are byte-compiled in Python3

Later on, third party software (here FreeCAD) load those files with the Python2 interpreter which ends systematically with a seg-fault of FreeCAD. Maybe I am the only user of silx & FreeCAD, but as it is related to Qt5, which is used by half of the GUI tools, I would not be surprised if silx would be crashing other software ...

kif commented 4 years ago

@picca Do you have an idea of what can cause this ? Your official debian package is affected in the same way.

picca commented 4 years ago

Hello,

I just install the qtdesigner plugins at the expected place in order to provide the it at a system level.

picca commented 4 years ago

I have just installed sudo apt install qttools5-dev-tools and started designer

I can find the plugins and it works. (on Debian unstable).

I need to check on a buster to understand what is going on.

picca commented 4 years ago

On unstable, I can start freecad without issue.

How do you reproduce this segfault ?

kif commented 4 years ago

Some tools crash: I think it is "draft" unless it is "sketcher", "part" or "part-design". The crash occurs when switching tool, those are the 4 I am using.

One can consider Freecad should upgrade to Python3 (it is on the way ...)

kif commented 4 years ago

On Sat, 25 Apr 2020 09:36:36 -0700 picca notifications@github.com wrote:

On unstable, I can start freecad without issue.

How do you reproduce this segfault ?

I am on debian10, here is the backtrace of freecad when switching to the "Draft" workshop (right at the start-up)

$ gdb /usr/bin/freecad
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 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-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 /usr/bin/freecad...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/freecad 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
FreeCAD 0.18, Libs: 0.18R
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

[New Thread 0x7fffed4b0700 (LWP 15799)]
[New Thread 0x7fffe7fff700 (LWP 15800)]
[New Thread 0x7fffe6344700 (LWP 15801)]
[New Thread 0x7fffe5b43700 (LWP 15802)]
[New Thread 0x7fffe5342700 (LWP 15803)]
[New Thread 0x7fffe4b41700 (LWP 15804)]
[New Thread 0x7fffcffff700 (LWP 15805)]
[New Thread 0x7fffcf7fe700 (LWP 15806)]
[New Thread 0x7fffceffd700 (LWP 15807)]
[New Thread 0x7fffce7fc700 (LWP 15808)]
[New Thread 0x7fffb3e04700 (LWP 15809)]
[New Thread 0x7fff719ff700 (LWP 15810)]

Thread 1 "freecad" received signal SIGSEGV, Segmentation fault.
__memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:383
383 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  0x00007ffff354a1fe in __memmove_sse2_unaligned_erms ()
    at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:383
#1  0x00007ffff65d5f83 in memcpy
    (__len=212, __src=0xffffffffffffffff, __dest=<optimized out>, __dest=<optimized out>, __src=<optimized out>, __len=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
#2  0x00007ffff65d5f83 in PyUnicodeUCS4_FromUnicode (u=0xffffffffffffffff, size=53)
    at ../Objects/unicodeobject.c:505
#3  0x00007ffff65d6293 in PyUnicodeUCS4_Encode
    (s=<optimized out>, size=<optimized out>, encoding=0x55555556c680 "UTF-8", errors=0x0)
    at ../Objects/unicodeobject.c:1330
#4  0x00007ffff6580369 in find_module
    (fullname=fullname@entry=0x5555578a8900 "plot1dplugin", subname=subname@entry=0x5555578a8900 "plot1dplugin", path=<optimized out>, 
    path@entry=0x0, buf=buf@entry=0x5555578a9910 "/usr/lib/freecad/Macro", buflen=buflen@entry=4097, p_fp=p_fp@entry=0x7fffffffa450, p_loader=<optimized out>) at ../Python/import.c:1478
#5  0x00007ffff6582c1b in import_submodule
    (mod=mod@entry=None, subname=subname@entry=0x5555578a8900 "plot1dplugin", fullname=fullname@entry=0x5555578a8900 "plot1dplugin") at ../Python/import.c:2736
#6  0x00007ffff6582fd8 in load_next

I am able to reproduce the bug on a couple of other computers, on more recent ones, the memmove is the AVX2 verison which is used, but it seg-faults the same way, when loading some stuff from silx, installed into the qt directory.

Cheers, Jerome

picca commented 4 years ago

Hello,

did you tried with the backported version of silx ? 0.11

kif commented 4 years ago

On Sat, 25 Apr 2020 12:57:11 -0700 picca notifications@github.com wrote:

Hello,

did you tried with the backported version of silx ? 0.11

Hi,

I tested to downgrade silx (0.13-dev to the backported version (0.11) and the result is the same.

This problem exists for a year or even more (at least since 08-2019): I don't use FreeCAD on a daily basis, more during holidays & week-ends, rarely on the same computer where I develop).

I initially suspected it was related to python2/python3, then to UCS2-UCS4 unicode storage but the more likely is an incompatibility between pyqt5 and pyside2.

Removing those files is a work-around. I found many people complaining that FreeCAD was crashing randomly with this kind of error messages and the only "solution" described was: "reformateed the computer" which is not really helpful.

Maybe a qt guru could have an idea.

Cheers,

Jerome

picca commented 4 years ago

In this bug report, it seems that the remove the .FreeCAD directory

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926500

Can you try this ?

picca commented 4 years ago

Hello, Jerome, maybe the best would be to fill a bug against freecad on Debian. then we will work with him in order to solve this issue at the Debain level.

Cheers

kif commented 4 years ago

No, removing .FreeCAD does not prevent the app from crashing when switching to the "draft" workbench.

picca commented 4 years ago

I do not understand :)

kif commented 4 years ago

I am backporting freecad to buster to check if (actually) the latest version has fixed the issue.

kif commented 4 years ago

I am unable to backport freecad to stable ... the C++ code is too complicated to be compiled. I will upgrade one of my computer to testing and validate I can built it there, and check if the issue has been fixed upstream (in freecad as apparently silx did little wrong)

picca commented 4 years ago

I can confirme, that freecad does not crash on Debian unstable with python3-silxs installed.

kif commented 4 years ago

I just checked ... but at the same time, the "Draft workbench" is disabled due to a missing module "Pivy"

picca commented 4 years ago

If I am not wrong this is because of the python3.7 removal which did not yet reach testing.

did you tryed with unstable ?

kif commented 4 years ago

Yes, I tested with unstable and there is no "draf workbench" for now, probably related to the migration python3.7->3.8