From badelvis, 8 Months ago, written in Plain Text.
This paste will hop the perch in 1 Second.
Embed
  1. Code:
  2. import os.path
  3.  
  4. from PyQt5.QtWidgets import QApplication
  5. from PyQt5.QtCore import QObject, pyqtSlot, QUrl
  6. from PyQt5.QtWebChannel import QWebChannel
  7. from PyQt5.QtWebEngineWidgets import QWebEngineView
  8.  
  9. class CallHandler(QObject):
  10.     @pyqtSlot(str)
  11.     def test(self, s):
  12.         print(s.__repr__())
  13.        
  14. app = QApplication([])      
  15. view = QWebEngineView()
  16. channel = QWebChannel()
  17. handler = CallHandler()
  18.  
  19. channel.registerObject('handler', handler)
  20. view.page().setWebChannel(channel)
  21.  
  22. view.load(QUrl.fromLocalFile(os.path.abspath('index.html')))
  23. view.show()
  24.  
  25. app.exec_()
  26.  
  27.  
  28. Run:
  29.  
  30. % python3 qt_web_channel_test.py         :(
  31. [1]    21570 segmentation fault  python3 qt_web_channel_test.py
  32. [21593:21593:0100/000000.538165:ERROR:broker_posix.cc(41)] Invalid node channel message
  33.  
  34.  
  35. Strace:
  36.  
  37. ...
  38. getpid()                                = 21532
  39. getpid()                                = 21532
  40. getpid()                                = 21532
  41. getpid()                                = 21532
  42. getpid()                                = 21532
  43. getpid()                                = 21532
  44. getpid()                                = 21532
  45. getpid()                                = 21532
  46. getpid()                                = 21532
  47. getpid()                                = 21532
  48. getpid()                                = 21532
  49. getpid()                                = 21532
  50. getpid()                                = 21532
  51. getpid()                                = 21532
  52. poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
  53. writev(3, [{iov_base="N\0\4\0\v\0 \0037\1\0\0\356\0\0\0\1\30\f\0\26\0 \0037\1\0\0\0\0\0\0"..., iov_len=72}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 72
  54. poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
  55. writev(3, [{iov_base="\16\0\2\0\26\0 \3", iov_len=8}], 1) = 8
  56. futex(0x7ffd9a50fb44, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
  57. futex(0x1ddb218, FUTEX_WAKE_PRIVATE, 1) = 0
  58. poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
  59. writev(3, [{iov_base="\224\3\4\0\30\0 \3\26\0 \3\7\0\0\0\224\4\2\0\26\0 \3\16\0\2\0\26\0 \3", iov_len=32}], 1) = 32
  60. futex(0x7ffd9a50fab4, FUTEX_WAIT_PRIVATE, 1, NULL) = -1 EAGAIN (Resource temporarily unavailable)
  61. futex(0x1ddb218, FUTEX_WAKE_PRIVATE, 1) = 0
  62. memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING) = 64
  63. ftruncate(64, 4)                        = 0
  64. mmap(NULL, 4, PROT_READ|PROT_WRITE, MAP_SHARED, 64, 0) = 0x7fed9812b000
  65. ioctl(9, DRM_IOCTL_I915_GEM_CREATE, 0x7ffd9a50f970) = 0
  66. ioctl(9, DRM_IOCTL_I915_GEM_SET_TILING, 0x7ffd9a50f8c0) = 0
  67. ioctl(9, DRM_IOCTL_I915_GEM_SET_DOMAIN, 0x7ffd9a50f964) = 0
  68. ioctl(9, DRM_IOCTL_PRIME_HANDLE_TO_FD, 0x7ffd9a50faac) = 0
  69. poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
  70. sendmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\225\2\6\0\31\0 \3\26\0 \3\0\0\0\0d\0d\0\0\2\30 \225\4\4\0\31\0 \3"..., iov_len=40}], msg_iovlen=1, msg_control=[{cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[65, 64]}], msg_controllen=24, msg_flags=0}, 0) = 40
  71. close(65)                               = 0
  72. close(64)                               = 0
  73. ioctl(9, DRM_IOCTL_I915_GEM_CREATE, 0x7ffd9a50f930) = 0
  74. ioctl(9, DRM_IOCTL_I915_GEM_SET_TILING, 0x7ffd9a50f880) = 0
  75. ioctl(9, DRM_IOCTL_I915_GEM_SET_DOMAIN, 0x7ffd9a50f924) = 0
  76. ioctl(9, DRM_IOCTL_I915_GEM_CREATE, 0x7ffd9a50f8a0) = 0
  77. ioctl(9, DRM_IOCTL_I915_GEM_SET_TILING, 0x7ffd9a50f7f0) = 0
  78. ioctl(9, DRM_IOCTL_I915_GEM_SET_DOMAIN, 0x7ffd9a50f894) = 0
  79. ioctl(9, DRM_IOCTL_I915_GEM_CREATE, 0x7ffd9a50f930) = 0
  80. ioctl(9, DRM_IOCTL_I915_GEM_SET_TILING, 0x7ffd9a50f880) = 0
  81. ioctl(9, DRM_IOCTL_I915_GEM_SET_DOMAIN, 0x7ffd9a50f924) = 0
  82. getpid()                                = 21532
  83. ioctl(9, DRM_IOCTL_I915_GEM_EXECBUFFER2, 0x7ffd9a50fc80) = 0
  84. ioctl(9, DRM_IOCTL_I915_GEM_BUSY, 0x7ffd9a50fb70) = 0
  85. ioctl(9, DRM_IOCTL_I915_GEM_MADVISE, 0x7ffd9a50fbe0) = 0
  86. getpid()                                = 21532
  87. getpid()                                = 21532
  88. getpid()                                = 21532
  89. getpid()                                = 21532
  90. getpid()                                = 21532
  91. getpid()                                = 21532
  92. getpid()                                = 21532
  93. poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
  94. writev(3, [{iov_base="\4\0\2\0\26\0 \3\233\33\r\0\0\0\0\0\215\0\0\0\27\0 \3\4\0\0\0A\200\0\0"..., iov_len=76}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 76
  95. poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
  96. writev(3, [{iov_base="\16\0\2\0\33\0 \3", iov_len=8}], 1) = 8
  97. futex(0x7ffd9a50fd34, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
  98. futex(0x1ddb218, FUTEX_WAKE_PRIVATE, 1) = 0
  99. getpid()                                = 21532
  100. getpid()                                = 21532
  101. getpid()                                = 21532
  102. getpid()                                = 21532
  103. getpid()                                = 21532
  104. getpid()                                = 21532
  105. getpid()                                = 21532
  106. getpid()                                = 21532
  107. getpid()                                = 21532
  108. getpid()                                = 21532
  109. getpid()                                = 21532
  110. getpid()                                = 21532
  111. getpid()                                = 21532
  112. getpid()                                = 21532
  113. getpid()                                = 21532
  114. getpid()                                = 21532
  115. getpid()                                = 21532
  116. munmap(0x7fed9812b000, 4)               = 0
  117. ioctl(9, DRM_IOCTL_GEM_CLOSE, 0x7ffd9a50fbd0) = 0
  118. ioctl(9, DRM_IOCTL_I915_GEM_MADVISE, 0x7ffd9a50fc04) = 0
  119. ioctl(9, DRM_IOCTL_I915_GEM_MADVISE, 0x7ffd9a50fbf4) = 0
  120. ioctl(9, DRM_IOCTL_I915_GEM_MADVISE, 0x7ffd9a50fc04) = 0
  121. getpid()                                = 21532
  122. open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 64
  123. fstat(64, {st_mode=S_IFREG|0644, st_size=167837, ...}) = 0
  124. mmap(NULL, 167837, PROT_READ, MAP_PRIVATE, 64, 0) = 0x7fed98103000
  125. close(64)                               = 0
  126. access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
  127. open("/lib/x86_64-linux-gnu/libGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  128. open("/usr/lib/x86_64-linux-gnu/libGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  129. open("/lib/libGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  130. open("/usr/lib/libGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  131. munmap(0x7fed98103000, 167837)          = 0
  132. open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 64
  133. fstat(64, {st_mode=S_IFREG|0644, st_size=167837, ...}) = 0
  134. mmap(NULL, 167837, PROT_READ, MAP_PRIVATE, 64, 0) = 0x7fed98103000
  135. close(64)                               = 0
  136. access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
  137. open("/lib/x86_64-linux-gnu/libGL", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  138. open("/usr/lib/x86_64-linux-gnu/libGL", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  139. open("/lib/libGL", O_RDONLY|O_CLOEXEC)  = -1 ENOENT (No such file or directory)
  140. open("/usr/lib/libGL", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  141. munmap(0x7fed98103000, 167837)          = 0
  142. open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 64
  143. fstat(64, {st_mode=S_IFREG|0644, st_size=167837, ...}) = 0
  144. mmap(NULL, 167837, PROT_READ, MAP_PRIVATE, 64, 0) = 0x7fed98103000
  145. close(64)                               = 0
  146. access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
  147. open("/lib/x86_64-linux-gnu/GL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  148. open("/usr/lib/x86_64-linux-gnu/GL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  149. open("/lib/GL.so", O_RDONLY|O_CLOEXEC)  = -1 ENOENT (No such file or directory)
  150. open("/usr/lib/GL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  151. munmap(0x7fed98103000, 167837)          = 0
  152. open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 64
  153. fstat(64, {st_mode=S_IFREG|0644, st_size=167837, ...}) = 0
  154. mmap(NULL, 167837, PROT_READ, MAP_PRIVATE, 64, 0) = 0x7fed98103000
  155. close(64)                               = 0
  156. access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
  157. open("/lib/x86_64-linux-gnu/GL", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  158. open("/usr/lib/x86_64-linux-gnu/GL", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  159. open("/lib/GL", O_RDONLY|O_CLOEXEC)     = -1 ENOENT (No such file or directory)
  160. open("/usr/lib/GL", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  161. munmap(0x7fed98103000, 167837)          = 0
  162. --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
  163. +++ killed by SIGSEGV +++