GoSecure / pyrdp

RDP monster-in-the-middle (mitm) and library for Python with the ability to watch connections live or after the fact
https://www.gosecure.net/blog/2020/10/20/announcing-pyrdp-1/
GNU General Public License v3.0
1.51k stars 244 forks source link

pyrdp-convert.py Error: Segmentation fault related to QT5 dependencies #348

Closed chenlianghua closed 3 years ago

chenlianghua commented 3 years ago

I want to convert .pyrdp to .mp4 and execute the command: pyrdp-convert.py /home/honeypot/pyrdp-1.1.0/pyrdp_output/replays/rdp_replay_20210823_11-50-09_951_Ana810761.pyrdp --output /home/honeypot/pyrdp-1.1.0/pyrdp_output/replays -f mp4

but the output is:

[*] Converting '/home/honeypot/pyrdp-1.1.0/pyrdp_output/replays/rdp_replay_20210823_11-50-09_951_Ana810761.pyrdp' to MP4
  1% (6 of 365) |#                                                                           | Elapsed Time: 0:00:02 ETA:   0:04:57Fatal Python error: Segmentation fault

Current thread 0x00007f7eb9caf740 (most recent call first):
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/player/gdi/cache.py", line 150 in __init__
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/player/gdi/draw.py", line 386 in fastGlyph
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/parser/rdp/orders/parse.py", line 169 in _parse_fast_glyph
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/parser/rdp/orders/parse.py", line 93 in _parse_primary
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/parser/rdp/orders/parse.py", line 83 in _parse_order
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/parser/rdp/orders/parse.py", line 69 in parse
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/player/RenderingEventHandler.py", line 49 in onFastPathOutput
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/player/BaseEventHandler.py", line 144 in onFastPathFragment
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/player/BaseEventHandler.py", line 73 in onPDUReceived
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/convert/MP4EventHandler.py", line 66 in onPDUReceived
  File "/home/honeypot/pyrdp-1.1.0/pyrdp/convert/ReplayConverter.py", line 30 in process
  File "/home/honeypot/pyrdp-1.1.0/bin/pyrdp-convert.py", line 97 in <module>
  File "/home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py", line 7 in <module>
Segmentation fault (core dumped)

I don't know what's the problem with this, need help.

This a virtual machine with Ubuntu 18.04.5 LTS

obilodeau commented 3 years ago

A Python interpreter segfault... This is concerning.

Two questions:

chenlianghua commented 3 years ago

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-player.py", line 7, in exec(compile(f.read(), file, 'exec')) File "/home/honeypot/pyrdp-1.1.0/bin/pyrdp-player.py", line 114, in sys.exit(main()) File "/home/honeypot/pyrdp-1.1.0/bin/pyrdp-player.py", line 81, in main enableNotifications(logger) File "/home/honeypot/pyrdp-1.1.0/bin/pyrdp-player.py", line 38, in enableNotifications notifyHandler = NotifyHandler() File "/home/honeypot/pyrdp-1.1.0/pyrdp/logging/handlers.py", line 21, in init notify2.init("pyrdp-player") File "/home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/notify2.py", line 103, in init '/org/freedesktop/Notifications') File "/home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/dbus/bus.py", line 243, in get_object follow_name_owner_changes=follow_name_owner_changes) File "/home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/dbus/proxies.py", line 250, in init self._named_service = conn.activate_name_owner(bus_name) File "/home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/dbus/bus.py", line 182, in activate_name_owner self.start_service_by_name(bus_name) File "/home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/dbus/bus.py", line 280, in start_service_by_name 'su', (bus_name, flags))) File "/home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/dbus/connection.py", line 653, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.Notifications exited with status 1

chenlianghua commented 3 years ago

By the way, here is the python dependencies: image

obilodeau commented 3 years ago

Do you run a graphical interface? Can you check the various suggestions in https://github.com/GoSecure/pyrdp/issues/143 please? Especially if DBus is running and if so can the current user talk to it?

chenlianghua commented 3 years ago

No, the Ubuntu server doesn't run a graphical interface, but I will run a graphical interface and then try the player again. Does the pyrdp-convert.py need the graphical interface? Or maybe I should run pip3 install -U -e . to install the python dependices?

chenlianghua commented 3 years ago

I install the Ubuntu desktop and rerun the pyrdp-player.py [.pyrdp] file agin, then the player application startup successfully. But the image is garbled. By The way, the language of the RDP server is Chinese. 企业微信截图_16298857588892 image

And there are many warnings in the pyrdp-player output image

But when I try to run the pyrdp-convert.py, the Segment fault error still occur. image

obilodeau commented 3 years ago

Does the pyrdp-convert.py need the graphical interface? Or maybe I should run pip3 install -U -e . to install the python dependices?

No, pyrdp-convert doesn't require a graphical interface but it definitely needs a full install (not just -U -e .) as we rely on QT for painting.

But the image is garbled.

This means we are missing some GDI drawing primitives. Can you give me the client and server Windows versions? I'll write it down to look at it later. It won't impact client interactions but yes, it means that replays are corrupted. Using --no-gdi might help you here at the cost of bandwidth and performance.

the Segment fault error still occur

Can you get a backtrace? Here are instructions to do so.

Follow all the prerequisite steps then with the virtualenv activated:

$ gdb -ex r --args python /home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py /home/honeypot/pyrdp-1.1.0/pyrdp_output/replays/rdp_replay_20210823_11-50-09_951_Ana810761.pyrdp --output /home/honeypot/pyrdp-1.1.0/pyrdp_output/replays -f mp4
(gdb) bt

You might optionally need to do a continue (or c) at the gdb prompt to get the script started. Then post the backtrace here.

chenlianghua commented 3 years ago

This means we are missing some GDI drawing primitives. Can you give me the client and server Windows versions? I'll write it down to look at it later. It won't impact client interactions but yes, it means that replays are corrupted. Using --no-gdi might help you here at the cost of bandwidth and performance.

I tried --no-gdi, and it worked for pyrdp-player.py, thank you :)

I tried another RDP Server: Windows7 x86-64, and the pyrdp-player.py [.pyrdp] works very nice with the .pyrdp file produced by pyrdp-mitm.py [RDP Server IP] (without --no-gdi). Maybe it has something to do with the Windows version?

Also, I used pyrdp-convert.py to convert the .pyrdp file to .mp4 file produced by pyrdp-mitm.py [RDP Server IP] --no-gdi, it worked sometimes, but sometimes still Segment fault.


Segment fault backtrace without --no-gdi RDP Server: Windows Server 2008 R2 x86 PyRDP runtime env: Ubuntu 18.04.5 LTS amd64 RDP client: Windows 10 x86-64

(gdb) run /home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py --output /home/honeypot/pyrdp_output -f mp4 /home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.pyrdp
Starting program: /home/honeypot/pyrdp-1.1.0/venv/bin/python /home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py --output /home/honeypot/pyrdp_output -f mp4 /home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.pyrdp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[*] Converting '/home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.pyrdp' to MP4
N/A% (0 of 364) |                                                                                           | Elapsed Time: 0:00:00 ETA:  --:--:--[New Thread 0x7fffd145c700 (LWP 12738)]
[New Thread 0x7fffd0c5b700 (LWP 12739)]
[New Thread 0x7fffd045a700 (LWP 12740)]
[New Thread 0x7fffcfc59700 (LWP 12741)]
1% (5 of 364) |#                                                                                          | Elapsed Time: 0:00:02 ETA:   0:02:32
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffe809e458 in makeBitmap(QImage&&, QFlags<Qt::ImageConversionFlag>) [clone .constprop.3] ()
from /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Gui.so.5

Segment fault backtrace with --no-gdi RDP Server: Windows7 x86-64 PyRDP runtime env: Ubuntu 18.04.5 LTS amd64 RDP client: Windows 10 x86-64


(gdb) run /home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py --output /home/honeypot/pyrdp_output -f mp4 /home/honeypot/pyrdp_output/rdp_replay_20210826_03-00-28_552_Kathleen219213.pyrdp 
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/honeypot/pyrdp-1.1.0/venv/bin/python /home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py --output /home/honeypot/pyrdp_output -f mp4 /home/honeypot/pyrdp_output/rdp_replay_20210826_03-00-28_552_Kathleen219213.pyrdp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

[*] Converting '/home/honeypot/pyrdp_output/rdp_replay_20210826_03-00-28_552_Kathleen219213.pyrdp' to MP4 N/A% (0 of 1536) | | Elapsed Time: 0:00:00 ETA: --:--:--[New Thread 0x7fffd141c700 (LWP 12748)] [New Thread 0x7fffd0c1b700 (LWP 12749)] [New Thread 0x7fffd041a700 (LWP 12750)] [New Thread 0x7fffcfc19700 (LWP 12751)] 67% (1034 of 1536) |########################################################## | Elapsed Time: 0:11:11 ETA: 0:09:47 Thread 1 "python" received signal SIGSEGV, Segmentation fault. 0x00007fffe809e458 in makeBitmap(QImage&&, QFlags) [clone .constprop.3] () from /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Gui.so.5

obilodeau commented 3 years ago

Thanks this already help narrow down the problem to PySide2/QT most likely.

After the segfault, you should be able to run the bt command to get the backtrace. Can you?

obilodeau commented 3 years ago

Another thought: you might not have QT installed. It's not explicitly listed in our install procedure since we assume most desktop environments would have it (I will fix that if it turns out to be the case).

Check if installed:

$ apt -qq list qt5-default

To install:

$ apt install qt5-default
chenlianghua commented 3 years ago

Here is the backtrace of the Segment fault:

(gdb) run /home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py --output /home/honeypot/pyrdp_output -f mp4 /home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.pyrdp
Starting program: /home/honeypot/pyrdp-1.1.0/venv/bin/python /home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py --output /home/honeypot/pyrdp_output -f mp4 /home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.pyrdp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[*] Converting '/home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.pyrdp' to MP4
N/A% (0 of 364) |                                                                                                                                                                                                                      | Elapsed Time: 0:00:00 ETA:  --:--:--[New Thread 0x7fffd145c700 (LWP 15420)]
[New Thread 0x7fffd0c5b700 (LWP 15421)]
[New Thread 0x7fffd045a700 (LWP 15422)]
[New Thread 0x7fffcfc59700 (LWP 15423)]
  1% (5 of 364) |##                                                                                                                                                                                                                    | Elapsed Time: 0:00:02 ETA:   0:03:24
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffe809e458 in makeBitmap(QImage&&, QFlags<Qt::ImageConversionFlag>) [clone .constprop.3] () from /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Gui.so.5
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007fffe809e458 in makeBitmap(QImage&&, QFlags<Qt::ImageConversionFlag>) [clone .constprop.3] () from /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Gui.so.5
#1  0x00007fffe809e56b in QBitmap::fromImage(QImage&&, QFlags<Qt::ImageConversionFlag>) () from /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Gui.so.5
#2  0x00007fffe809e811 in QBitmap::fromData(QSize const&, unsigned char const*, QImage::Format) () from /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Gui.so.5
#3  0x00007fffe65c4da5 in Sbk_QBitmapFunc_fromData () from /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/QtGui.abi3.so
#4  0x000000000050a5a5 in _PyCFunction_FastCallDict (kwargs=<optimized out>, nargs=<optimized out>, args=<optimized out>, func_obj=<built-in method fromData of Shiboken.ObjectType object at remote 0x1d81508>) at ../Objects/methodobject.c:231
#5  _PyCFunction_FastCallKeywords (kwnames=<optimized out>, nargs=<optimized out>, stack=<optimized out>, func=<optimized out>) at ../Objects/methodobject.c:294
#6  call_function.lto_priv () at ../Python/ceval.c:4851
#7  0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#8  0x0000000000508dc5 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x7fffd2a2b930, for file /home/honeypot/pyrdp-1.1.0/pyrdp/player/gdi/cache.py, line 150, in __init__ (self=<GlyphEntry(x=1, y=-9, w=8, h=7) at remote 0x7fffd2a9ef98>, glyph=<Glyph(cacheIndex=0, x=1, y=-9, w=8, h=7, data=b'\xc3f<\x18<f\xc3') at remote 0x7fffd2a9eef0>)) at ../Python/ceval.c:754
#9  _PyFunction_FastCall (globals=<optimized out>, nargs=<optimized out>, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#10 _PyFunction_FastCallDict () at ../Python/ceval.c:5035
#11 0x0000000000595221 in _PyObject_FastCallDict (kwargs=0x0, nargs=2, args=0x7fffffffc580, func=<function at remote 0x7fffe600ef28>) at ../Objects/abstract.c:2310
#12 _PyObject_Call_Prepend (kwargs=0x0, args=<optimized out>, obj=<optimized out>, func=<function at remote 0x7fffe600ef28>) at ../Objects/abstract.c:2373
#13 method_call.lto_priv () at ../Objects/classobject.c:314
#14 0x0000000000549b3f in PyObject_Call (kwargs=0x0, args=(<Glyph(cacheIndex=0, x=1, y=-9, w=8, h=7, data=b'\xc3f<\x18<f\xc3') at remote 0x7fffd2a9eef0>,), func=<method at remote 0x7fffdb15b848>) at ../Objects/abstract.c:2261
#15 slot_tp_init () at ../Objects/typeobject.c:6420
#16 0x0000000000551391 in type_call.lto_priv () at ../Objects/typeobject.c:915
#17 0x00000000005a9d2c in _PyObject_FastCallDict (kwargs=<optimized out>, nargs=1, args=0x7fffd2a303b8, func=<type at remote 0x1f8fe78>) at ../Objects/tupleobject.c:131
#18 _PyObject_FastCallKeywords () at ../Objects/abstract.c:2496
#19 0x000000000050a533 in call_function.lto_priv () at ../Python/ceval.c:4875
#20 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#21 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x7fffd2a30220, for file /home/honeypot/pyrdp-1.1.0/pyrdp/player/gdi/draw.py, line 386, in fastGlyph (self=<GdiQtFrontend(imageHandler=<MP4Image(buffer=<PySide2.QtGui.QImage at remote 0x7fffd648de48>) at remote 0x7fffd8434860>, _warned=False, bitmaps=<BitmapCache(caches={0: {32767: <PySide2.QtGui.QImage at remote 0x7fffd649f088>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a22b48>}}, persist=False) at remote 0x7fffd7ba3d68>, brushes=<BrushCache(entries={}) at remote 0x7fffd7ba3da0>, palettes=<PaletteCache(entries={}) at remote 0x7fffd7ba3dd8>, glyphs=<GlyphCache(caches={}, fragments={}) at remote 0x7fffd7ba3e10>, bounds=None, surfaces={65535: <...>, -1: <PySide2.QtGui.QImage at remote 0x7fffd648df88>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a2d288>, 1: <PySide2.QtGui.QImage at remote 0x7fffd2a2d9c8>}, activeSurface=0) at remote 0x7fffd7ba3d30>, state=<FastGlyph(ctx=<PrimaryContext(fieldFlags=28923, deltaCoords=False, orderType=24, bounds=<Bounds(left=0, top=0, bottom=0, right=0) at remote 0x7fffd7ba3e...(truncated)) at ../Python/ceval.c:754
#22 _PyFunction_FastCall (globals=<optimized out>, nargs=140736727286304, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#23 fast_function.lto_priv () at ../Python/ceval.c:4968
#24 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#25 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#26 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x7fffd2a2cc88, for file /home/honeypot/pyrdp-1.1.0/pyrdp/parser/rdp/orders/parse.py, line 169, in _parse_fast_glyph (self=<OrdersParser(notify=<GdiQtFrontend(imageHandler=<MP4Image(buffer=<PySide2.QtGui.QImage at remote 0x7fffd648de48>) at remote 0x7fffd8434860>, _warned=False, bitmaps=<BitmapCache(caches={0: {32767: <PySide2.QtGui.QImage at remote 0x7fffd649f088>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a22b48>}}, persist=False) at remote 0x7fffd7ba3d68>, brushes=<BrushCache(entries={}) at remote 0x7fffd7ba3da0>, palettes=<PaletteCache(entries={}) at remote 0x7fffd7ba3dd8>, glyphs=<GlyphCache(caches={}, fragments={}) at remote 0x7fffd7ba3e10>, bounds=None, surfaces={65535: <...>, -1: <PySide2.QtGui.QImage at remote 0x7fffd648df88>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a2d288>, 1: <PySide2.QtGui.QImage at remote 0x7fffd2a2d9c8>}, activeSurface=0) at remote 0x7fffd7ba3d30>, ctx=<PrimaryContext(fieldFlags=28923, deltaCoords=False, orderType=24, bounds=<Bounds(left=0, top=0, bottom=0, right=0) at...(truncated)) at ../Python/ceval.c:754
#27 _PyFunction_FastCall (globals=<optimized out>, nargs=140736727272584, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#28 fast_function.lto_priv () at ../Python/ceval.c:4968
#29 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#30 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#31 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x7fffd2a86788, for file /home/honeypot/pyrdp-1.1.0/pyrdp/parser/rdp/orders/parse.py, line 93, in _parse_primary (self=<OrdersParser(notify=<GdiQtFrontend(imageHandler=<MP4Image(buffer=<PySide2.QtGui.QImage at remote 0x7fffd648de48>) at remote 0x7fffd8434860>, _warned=False, bitmaps=<BitmapCache(caches={0: {32767: <PySide2.QtGui.QImage at remote 0x7fffd649f088>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a22b48>}}, persist=False) at remote 0x7fffd7ba3d68>, brushes=<BrushCache(entries={}) at remote 0x7fffd7ba3da0>, palettes=<PaletteCache(entries={}) at remote 0x7fffd7ba3dd8>, glyphs=<GlyphCache(caches={}, fragments={}) at remote 0x7fffd7ba3e10>, bounds=None, surfaces={65535: <...>, -1: <PySide2.QtGui.QImage at remote 0x7fffd648df88>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a2d288>, 1: <PySide2.QtGui.QImage at remote 0x7fffd2a2d9c8>}, activeSurface=0) at remote 0x7fffd7ba3d30>, ctx=<PrimaryContext(fieldFlags=28923, deltaCoords=False, orderType=24, bounds=<Bounds(left=0, top=0, bottom=0, right=0) at rem...(truncated)) at ../Python/ceval.c:754
#32 _PyFunction_FastCall (globals=<optimized out>, nargs=140736727639944, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#33 fast_function.lto_priv () at ../Python/ceval.c:4968
#34 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#35 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#36 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x7fffd2a87930, for file /home/honeypot/pyrdp-1.1.0/pyrdp/parser/rdp/orders/parse.py, line 83, in _parse_order (self=<OrdersParser(notify=<GdiQtFrontend(imageHandler=<MP4Image(buffer=<PySide2.QtGui.QImage at remote 0x7fffd648de48>) at remote 0x7fffd8434860>,---Type <return> to continue, or q <return> to quit---
 _warned=False, bitmaps=<BitmapCache(caches={0: {32767: <PySide2.QtGui.QImage at remote 0x7fffd649f088>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a22b48>}}, persist=False) at remote 0x7fffd7ba3d68>, brushes=<BrushCache(entries={}) at remote 0x7fffd7ba3da0>, palettes=<PaletteCache(entries={}) at remote 0x7fffd7ba3dd8>, glyphs=<GlyphCache(caches={}, fragments={}) at remote 0x7fffd7ba3e10>, bounds=None, surfaces={65535: <...>, -1: <PySide2.QtGui.QImage at remote 0x7fffd648df88>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a2d288>, 1: <PySide2.QtGui.QImage at remote 0x7fffd2a2d9c8>}, activeSurface=0) at remote 0x7fffd7ba3d30>, ctx=<PrimaryContext(fieldFlags=28923, deltaCoords=False, orderType=24, bounds=<Bounds(left=0, top=0, bottom=0, right=0) at remot...(truncated)) at ../Python/ceval.c:754
#37 _PyFunction_FastCall (globals=<optimized out>, nargs=140736727644464, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#38 fast_function.lto_priv () at ../Python/ceval.c:4968
#39 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#40 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#41 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x3835918, for file /home/honeypot/pyrdp-1.1.0/pyrdp/parser/rdp/orders/parse.py, line 69, in parse (self=<OrdersParser(notify=<GdiQtFrontend(imageHandler=<MP4Image(buffer=<PySide2.QtGui.QImage at remote 0x7fffd648de48>) at remote 0x7fffd8434860>, _warned=False, bitmaps=<BitmapCache(caches={0: {32767: <PySide2.QtGui.QImage at remote 0x7fffd649f088>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a22b48>}}, persist=False) at remote 0x7fffd7ba3d68>, brushes=<BrushCache(entries={}) at remote 0x7fffd7ba3da0>, palettes=<PaletteCache(entries={}) at remote 0x7fffd7ba3dd8>, glyphs=<GlyphCache(caches={}, fragments={}) at remote 0x7fffd7ba3e10>, bounds=None, surfaces={65535: <...>, -1: <PySide2.QtGui.QImage at remote 0x7fffd648df88>, 0: <PySide2.QtGui.QImage at remote 0x7fffd2a2d288>, 1: <PySide2.QtGui.QImage at remote 0x7fffd2a2d9c8>}, activeSurface=0) at remote 0x7fffd7ba3d30>, ctx=<PrimaryContext(fieldFlags=28923, deltaCoords=False, orderType=24, bounds=<Bounds(left=0, top=0, bottom=0, right=0) at remote 0x7fffd7ba...(truncated)) at ../Python/ceval.c:754
#42 _PyFunction_FastCall (globals=<optimized out>, nargs=58939672, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#43 fast_function.lto_priv () at ../Python/ceval.c:4968
#44 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#45 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#46 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x1a9f1a8, for file /home/honeypot/pyrdp-1.1.0/pyrdp/player/RenderingEventHandler.py, line 49, in onFastPathOutput (self=<MP4EventHandler(filename='/home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.mp4', mp4=<av.container.output.OutputContainer at remote 0x7ffff542baf0>, stream=<av.video.stream.VideoStream at remote 0x7fffd7b97168>, progress=None, scale=False, mouse=(949, 240), fps=30, delta=33, log=<Logger(filters=[], name='pyrdp.player.RenderingEventHandler', level=0, parent=<RootLogger(filters=[], name='root', level=50, parent=None, propagate=True, handlers=[<StreamHandler(filters=[], _name=None, level=0, formatter=<Formatter(_style=<PercentStyle(_fmt='%(levelname)s:%(name)s:%(message)s') at remote 0x7fffd7ba34e0>, _fmt='%(levelname)s:%(name)s:%(message)s', datefmt=None) at remote 0x7fffd7ba3358>, lock=<_thread.RLock at remote 0x7fffd845a570>, stream=<_io.TextIOWrapper at remote 0x7ffff6bb6708>) at remote 0x7fffd7ba3390>], disabled=False) at remote 0x7ffff5225d30>, propagate...(truncated)) at ../Python/ceval.c:754
#47 _PyFunction_FastCall (globals=<optimized out>, nargs=27914664, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#48 fast_function.lto_priv () at ../Python/ceval.c:4968
#49 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#50 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#51 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x7fffd2a857a8, for file /home/honeypot/pyrdp-1.1.0/pyrdp/player/BaseEventHandler.py, line 144, in onFastPathFragment (self=<MP4EventHandler(filename='/home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.mp4', mp4=<av.container.output.OutputContainer at remote 0x7ffff542baf0>, stream=<av.video.stream.VideoStream at remote 0x7fffd7b97168>, progress=None, scale=False, mouse=(949, 240), fps=30, delta=33, log=<Logger(filters=[], name='pyrdp.player.RenderingEventHandler', level=0, parent=<RootLogger(filters=[], name='root', level=50, parent=None, propagate=True, handlers=[<StreamHandler(filters=[], _name=None, level=0, formatter=<Formatter(_style=<PercentStyle(_fmt='%(levelname)s:%(name)s:%(message)s') at remote 0x7fffd7ba34e0>, _fmt='%(levelname)s:%(name)s:%(message)s', datefmt=None) at remote 0x7fffd7ba3358>, lock=<_thread.RLock at remote 0x7fffd845a570>, stream=<_io.TextIOWrapper at remote 0x7ffff6bb6708>) at remote 0x7fffd7ba3390>], disabled=False) at remote 0x7ffff5225d30>, propag...(truncated)) at ../Python/ceval.c:754
#52 _PyFunction_FastCall (globals=<optimized out>, nargs=140736727635880, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#53 fast_function.lto_priv () at ../Python/ceval.c:4968
#54 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#55 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#56 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x7fffd6491048, for file /home/honeypot/pyrdp-1.1.0/pyrdp/player/BaseEventHandler.py, line 73, in onPDUReceived (self=<MP4EventHandler(filename='/home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.mp4', mp4=<av.container.output.OutputContainer at remote 0x7ffff542baf0>, stream=<av.video.stream.VideoStream at remote 0x7fffd7b97168>, progress=None, scale=False, mouse=(949, 240), fps=30, delta=33, log=<Logger(filters=[], name='pyrdp.player.RenderingEventHandler', level=0, parent=<RootLogger(filters=[], name='root', level=50, parent=None, propagate=True, handlers=[<StreamHandler(filters=[], _name=None, level=0, formatter=<Formatter(_style=<PercentStyle(_fmt='%(levelname)s:%(name)s:%(message)s') at remote 0x7fffd7ba34e0>, _fmt='%(levelname)s:%(name)s:%(message)s', datefmt=None) at remote 0x7fffd7ba3358>, lock=<_thread.RLock at remote 0x7fffd845a570>, stream=<_io.TextIOWrapper at remote 0x7ffff6bb6708>) at remote 0x7fffd7ba3390>], disabled=False) at remote 0x7ffff5225d30>, propagate=Tr...(truncated)) at ../Python/ceval.c:754
#57 _PyFunction_FastCall (globals=<optimized out>, nargs=140736788500552, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#58 fast_function.lto_priv () at ../Python/ceval.c:4968
#59 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#60 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#61 0x0000000000507cd4 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x7fffd6490230, for file /home/honeypot/pyrdp-1.1.0/pyrdp/convert/MP4EventHandler.py, line 66, in onPDUReceived (self=<MP4EventHandler(filename='/home/honeypot/pyrdp_output/rdp_replay_20210825_09-07-50_822_Samantha415947.mp4', mp4=<av.container.output.OutputContainer at remote 0x7ffff542baf0>, stream=<av.video.stream.VideoStream at remote 0x7fffd7b97168>, progress=None, scale=False, mouse=(949, 240), fps=30, delta=33, log=<Logger(filters=[], name='pyrdp.player.RenderingEventHandler', level=0, parent=<RootLogger(filters=[], name='root', level=50, parent=None, propagate=True, handlers=[<StreamHandler(filters=[], _name=None, level=0, formatter=<Formatter(_style=<PercentStyle(_fmt='%(levelname)s:%(name)s:%(message)s') at remote 0x7fffd7ba34e0>, _fmt='%(levelname)s:%(name)s:%(message)s', datefmt=None) at remote 0x7fffd7ba3358>, lock=<_thread.RLock at remote 0x7fffd845a570>, stream=<_io.TextIOWrapper at remote 0x7ffff6bb6708>) at remote 0x7fffd7ba3390>], disabled=False) at remote 0x7ffff5225d30>, propagate=Tr...(truncated)) at ../Python/ceval.c:754
#62 _PyEval_EvalCodeWithName.lto_priv.1824 () at ../Python/ceval.c:4166
#63 0x0000000000509a00 in fast_function.lto_priv () at ../Python/ceval.c:4992
#64 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#65 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
---Type <return> to continue, or q <return> to quit---
#66 0x00000000005096c8 in PyEval_EvalFrameEx (throwflag=0, 
    f=Frame 0x204c6e8, for file /home/honeypot/pyrdp-1.1.0/pyrdp/convert/ReplayConverter.py, line 30, in process (self=<ReplayConverter(inputFile=<PosixPath at remote 0x7fffd842cf28>, outputPrefix='/home/honeypot/pyrdp_output/', format='mp4') at remote 0x7fffd7ba3470>, f=<_io.BufferedReader at remote 0x7fffe5fbed58>, replay=<Replay(events={0: [0], 2846: [332], 3483: [674], 3492: [1175], 3614: [1241], 3669: [1290], 3671: [16682], 3673: [23432], 3740: [23729], 3807: [23755], 3987: [24052], 3993: [39859], 4087: [45460], 4178: [51309], 4181: [67078], 4183: [80655], 4186: [95820], 4280: [111477], 4281: [126882], 4380: [128189], 4761: [128217], 4913: [128266], 5110: [128385], 5130: [128490], 5264: [128609], 5526: [128728], 5547: [128840], 5565: [128924], 5698: [129029], 5751: [129078], 5759: [129106], 5810: [129403], 6223: [129446], 6673: [129474], 6691: [129497], 6828: [129520], 6844: [129543], 6926: [129566], 7051: [130397], 7078: [130420], 7103: [130443], 7130: [130867], 7154: [130890], 7185: [131386], 7540: [131409],...(truncated)) at ../Python/ceval.c:754
#67 _PyFunction_FastCall (globals=<optimized out>, nargs=33867496, args=<optimized out>, co=<optimized out>) at ../Python/ceval.c:4933
#68 fast_function.lto_priv () at ../Python/ceval.c:4968
#69 0x000000000050a3fd in call_function.lto_priv () at ../Python/ceval.c:4872
#70 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#71 0x0000000000507cd4 in PyEval_EvalFrameEx (throwflag=0, f=Frame 0xd41058, for file /home/honeypot/pyrdp-1.1.0/bin/pyrdp-convert.py, line 95, in <module> ()) at ../Python/ceval.c:754
#72 _PyEval_EvalCodeWithName.lto_priv.1824 () at ../Python/ceval.c:4166
#73 0x0000000000516285 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, 
    locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py') at remote 0x7ffff6b40dd8>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7e38638>, '__file__': '/home/honeypot/pyrdp-1.1.0/bin/pyrdp-convert.py', '__cached__': None, '__requires__': 'pyrdp==1.1.0', 'f': <_io.TextIOWrapper at remote 0x7ffff557ba68>, 'argparse': <module at remote 0x7ffff540f0e8>, 'logging': <module at remote 0x7ffff526b4f8>, 'sys': <module at remote 0x7ffff6b94ef8>, 'Path': <type at remote 0xccce78>, 'PCAPConverter': <type at remote 0x2070bf8>, 'ReplayConverter': <type at remote 0x1f89f38>, 'HANDLERS': {'replay': (None, 'pyrdp'), 'json': (<type at remote 0x1fa1298>, 'json'), 'mp4': (<type at remote 0x206e718>, 'mp4')}, 'loadSecrets': <function at remote 0x7fffd7ba4c80>, 'HAS_GUI': True, 'parser': <ArgumentParser(description=None, argument_default=None, prefix_chars='-', conflict_handler='e...(truncated), 
    globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py') at remote 0x7ffff6b40dd8>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7e38638>, '__file__': '/home/honeypot/pyrdp-1.1.0/bin/pyrdp-convert.py', '__cached__': None, '__requires__': 'pyrdp==1.1.0', 'f': <_io.TextIOWrapper at remote 0x7ffff557ba68>, 'argparse': <module at remote 0x7ffff540f0e8>, 'logging': <module at remote 0x7ffff526b4f8>, 'sys': <module at remote 0x7ffff6b94ef8>, 'Path': <type at remote 0xccce78>, 'PCAPConverter': <type at remote 0x2070bf8>, 'ReplayConverter': <type at remote 0x1f89f38>, 'HANDLERS': {'replay': (None, 'pyrdp'), 'json': (<type at remote 0x1fa1298>, 'json'), 'mp4': (<type at remote 0x206e718>, 'mp4')}, 'loadSecrets': <function at remote 0x7fffd7ba4c80>, 'HAS_GUI': True, 'parser': <ArgumentParser(description=None, argument_default=None, prefix_chars='-', conflict_handler='e...(truncated), 
    _co=<code at remote 0x7ffff53a45d0>) at ../Python/ceval.c:729
#74 PyEval_EvalCode (
    locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py') at remote 0x7ffff6b40dd8>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7e38638>, '__file__': '/home/honeypot/pyrdp-1.1.0/bin/pyrdp-convert.py', '__cached__': None, '__requires__': 'pyrdp==1.1.0', 'f': <_io.TextIOWrapper at remote 0x7ffff557ba68>, 'argparse': <module at remote 0x7ffff540f0e8>, 'logging': <module at remote 0x7ffff526b4f8>, 'sys': <module at remote 0x7ffff6b94ef8>, 'Path': <type at remote 0xccce78>, 'PCAPConverter': <type at remote 0x2070bf8>, 'ReplayConverter': <type at remote 0x1f89f38>, 'HANDLERS': {'replay': (None, 'pyrdp'), 'json': (<type at remote 0x1fa1298>, 'json'), 'mp4': (<type at remote 0x206e718>, 'mp4')}, 'loadSecrets': <function at remote 0x7fffd7ba4c80>, 'HAS_GUI': True, 'parser': <ArgumentParser(description=None, argument_default=None, prefix_chars='-', conflict_handler='e...(truncated), 
    globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py') at remote 0x7ffff6b40dd8>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7e38638>, '__file__': '/home/honeypot/pyrdp-1.1.0/bin/pyrdp-convert.py', '__cached__': None, '__requires__': 'pyrdp==1.1.0', 'f': <_io.TextIOWrapper at remote 0x7ffff557ba68>, 'argparse': <module at remote 0x7ffff540f0e8>, 'logging': <module at remote 0x7ffff526b4f8>, 'sys': <module at remote 0x7ffff6b94ef8>, 'Path': <type at remote 0xccce78>, 'PCAPConverter': <type at remote 0x2070bf8>, 'ReplayConverter': <type at remote 0x1f89f38>, 'HANDLERS': {'replay': (None, 'pyrdp'), 'json': (<type at remote 0x1fa1298>, 'json'), 'mp4': (<type at remote 0x206e718>, 'mp4')}, 'loadSecrets': <function at remote 0x7fffd7ba4c80>, 'HAS_GUI': True, 'parser': <ArgumentParser(description=None, argument_default=None, prefix_chars='-', conflict_handler='e...(truncated), 
    co=<code at remote 0x7ffff53a45d0>) at ../Python/ceval.c:731
#75 builtin_exec_impl (module=<optimized out>, 
    locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py') at remote 0x7ffff6b40dd8>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7e38638>, '__file__': '/home/honeypot/pyrdp-1.1.0/bin/pyrdp-convert.py', '__cached__': None, '__requires__': 'pyrdp==1.1.0', 'f': <_io.TextIOWrapper at remote 0x7ffff557ba68>, 'argparse': <module at remote 0x7ffff540f0e8>, 'logging': <module at remote 0x7ffff526b4f8>, 'sys': <module at remote 0x7ffff6b94ef8>, 'Path': <type at remote 0xccce78>, 'PCAPConverter': <type at remote 0x2070bf8>, 'ReplayConverter': <type at remote 0x1f89f38>, 'HANDLERS': {'replay': (None, 'pyrdp'), 'json': (<type at remote 0x1fa1298>, 'json'), 'mp4': (<type at remote 0x206e718>, 'mp4')}, 'loadSecrets': <function at remote 0x7fffd7ba4c80>, 'HAS_GUI': True, 'parser': <ArgumentParser(description=None, argument_default=None, prefix_chars='-', conflict_handler='e...(truncated), 
    globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py') at remote 0x7ffff6b40dd8>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7e38638>, '__file__': '/home/honeypot/pyrdp-1.1.0/bin/pyrdp-convert.py', '__cached__': None, '__requires__': 'pyrdp==1.1.0', 'f': <_io.TextIOWrapper at remote 0x7ffff557ba68>, 'argparse': <module at remote 0x7ffff540f0e8>, 'logging': <module at remote 0x7ffff526b4f8>, 'sys': <module at remote 0x7ffff6b94ef8>, 'Path': <type at remote 0xccce78>, 'PCAPConverter': <type at remote 0x2070bf8>, 'ReplayConverter': <type at remote 0x1f89f38>, 'HANDLERS': {'replay': (None, 'pyrdp'), 'json': (<type at remote 0x1fa1298>, 'json'), 'mp4': (<type at remote 0x206e718>, 'mp4')}, 'loadSecrets': <function at remote 0x7fffd7ba4c80>, 'HAS_GUI': True, 'parser': <ArgumentParser(description=None, argument_default=None, prefix_chars='-', conflict_handler='e...(truncated), 
    source=<code at remote 0x7ffff53a45d0>) at ../Python/bltinmodule.c:983
#76 builtin_exec () at ../Python/clinic/bltinmodule.c.h:283
#77 0x000000000050a22f in _PyCFunction_FastCallDict (kwargs=<optimized out>, nargs=<optimized out>, args=<optimized out>, func_obj=<built-in method exec of module object at remote 0x7ffff7e38638>) at ../Objects/methodobject.c:234
#78 _PyCFunction_FastCallKeywords (kwnames=<optimized out>, nargs=<optimized out>, stack=<optimized out>, func=<optimized out>) at ../Objects/methodobject.c:294
#79 call_function.lto_priv () at ../Python/ceval.c:4851
#80 0x000000000050bf44 in _PyEval_EvalFrameDefault () at ../Python/ceval.c:3335
#81 0x0000000000507cd4 in PyEval_EvalFrameEx (throwflag=0, f=Frame 0xadfc38, for file /home/honeypot/pyrdp-1.1.0/venv/bin/pyrdp-convert.py, line 7, in <module> ()) at ../Python/ceval.c:754
#82 _PyEval_EvalCodeWithName.lto_priv.1824 () at ../Python/ceval.c:4166
#83 0x000000000050ae13 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, locals=<optimized out>, globals=<optimized out>, _co=<optimized out>) at ../Python/ceval.c:4187
#84 PyEval_EvalCode (co=<optimized out>, globals=<optimized out>, locals=<optimized out>) at ../Python/ceval.c:731
#85 0x0000000000635262 in run_mod () at ../Python/pythonrun.c:1025
#86 0x0000000000635317 in PyRun_FileExFlags () at ../Python/pythonrun.c:978
---Type <return> to continue, or q <return> to quit---
#87 0x0000000000638acf in PyRun_SimpleFileExFlags () at ../Python/pythonrun.c:419
#88 0x0000000000638ca5 in PyRun_AnyFileExFlags () at ../Python/pythonrun.c:81
#89 0x0000000000639671 in run_file (p_cf=0x7fffffffe29c, filename=<optimized out>, fp=<optimized out>) at ../Modules/main.c:340
#90 Py_Main () at ../Modules/main.c:810
#91 0x00000000004b0e40 in main (argc=7, argv=0x7fffffffe498) at ../Programs/python.c:69
(gdb) 
chenlianghua commented 3 years ago

👍 👍 👍 Thanks for your hint, my PyRDP runtime env didn't have the qt5-default installed. After the qt5-default installed, the pyrdp-convert.py works well. So, the qt5-default is a key component.

It would be better if the convert process can be faster :)

obilodeau commented 3 years ago

Installing qt5-default is like using a bazooka to kill a mouse. A lot (if not all) of the QT5 stuff should have been in the venv/. I think installing qt5-default pulled in something subtle that was missing but I don't think the whole thing is required. Case in point: our docker images work well including to convert to mp4 yet we don't specify QT dependencies in them.

I ran ldd on a couple of the libraries on my system and couldn't identify what could be missing... I'll do some more tests.

It would be better if the convert process can be faster :)

I know :disappointed:

obilodeau commented 3 years ago

I tried to reproduce the issue starting with an empty ubuntu 18.04 LTS vagrant box. I couldn't reproduce the issue. The reason is I think that when building the virtualbox guest additions, the missing dependencies are installed.

If you want, you could reset your computer from before you installed the qt5-default package and then run:

$ ldd /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Gui.so.5

or

$ ldd /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Core.so.5

Anything with (not found) at the end of the line would point to what is missing.

Are you willing to do this or should we close this issue?

chenlianghua commented 3 years ago

I will try it in later

chenlianghua commented 3 years ago

I started a new Ubuntu 18.04 LTS (the same ISO file), and install the PyRDP. Then I run ldd /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Gui.so.5, and the output is below: image As we can see there is no not found items.

And no qt5-default installed: image

Finally, still Segment fault with pyrdp-convert.py. image

chenlianghua commented 3 years ago

I think apt install qt5-default need to be added in the installation process. :)

obilodeau commented 3 years ago

As we can see there is no not found items.

You can see that one of the first dependency of libQt5Gui is libQt5Core. Is there any not found under there?

$ ldd /home/honeypot/pyrdp-1.1.0/venv/lib/python3.6/site-packages/PySide2/Qt/lib/libQt5Core.so.5

I'm trying to avoid pulling all of QT5 since this would blow up our docker image size significantly.

obilodeau commented 3 years ago

It would be better if the convert process can be faster :)

You will be glad to hear that it is now 6x faster in master. I merged #349 with this improvement today.

chenlianghua commented 3 years ago

There is no not found items, too. image

chenlianghua commented 3 years ago

You will be glad to hear that it is now 6x faster in master. 👍 That's a really good news, it's a great improvement.

obilodeau commented 3 years ago

I think I might have found it. Can you try again (before installing qt5-default) to install libxcb-xinerama0 with apt?

Otherwise, the ldd would need to be run recursively starting with the libraries inside PySide2/ to search for a not found entry.

obilodeau commented 3 years ago

Re-opening. Closed by accident due to the merge of #355 (fix keyword in same sentence).

chenlianghua commented 3 years ago

Yeah, apt install libxcb-xinerama0 worked, too. And it should be executed before pyrdp installed.

obilodeau commented 3 years ago

Confirmed to be fixed with #355. Thanks @chenlianghua!