X SSHを介してSDL2プログラムを実行してもvalgrindを使用しないと、BadRequestエラーが発生しますか?

X SSHを介してSDL2プログラムを実行してもvalgrindを使用しないと、BadRequestエラーが発生しますか?

私は最初にSDL2に触れましたが、何かのために迅速で汚れたプログラムを書いています。私のラップトップではうまくいきますが、サーバーに接続してSSH経由でXトンネルを使用してテストしようとすると、しばらくウィンドウの輪郭が表示され、次のエラーが表示されます。

X Error of failed request:  BadRequest (invalid request code or no such operation)
  Major opcode of failed request:  130 (MIT-SHM)
  Minor opcode of failed request:  1 (X_ShmAttach)
  Serial number of failed request:  202
  Current serial number in output stream:  203

他のXプログラムは正常に動作しますか?これは他のSDL2プログラムでも同様です。

オンラインで調べるとOpenGLの問題という結果が出ましたが、私のプログラムではOpenGLをまったく使用しません。それとも、少なくともそうしないでください。その他SDL2プログラムはうまく機能し、複雑すぎるものではなく、サーフェスとビットプレーンのみを使用します。とにかく、私はこれらの解決策を試しましたが、残念ながら何もうまくいきませんでした...

興味深いことに、valgrindを介して実行すると、次のような結果が得られます。いいえ上記のエラー:

==29836== Warning: invalid file descriptor 1024 in syscall close()
==29836== Warning: invalid file descriptor 1025 in syscall close()
==29836== Warning: invalid file descriptor 1026 in syscall close()
==29836== Warning: invalid file descriptor 1027 in syscall close()
==29836==    Use --log-fd=<number> to select an alternative log fd.
==29836== Warning: invalid file descriptor 1028 in syscall close()
==29836== Warning: invalid file descriptor 1029 in syscall close()

以下はヒープの概要です。プログラムが停止しているように見えますが、実行され続けます。そして、しばらくするとプログラムが起動し始めますか?閉じると見えます。その他ヒープのまとめ...

役に立つ場合に備えて、ログ全体は次のようになります。

kit@KitServ:~/git/video-compress$ ./a.out a.vid
X Error of failed request:  BadRequest (invalid request code or no such operation)
  Major opcode of failed request:  130 (MIT-SHM)
  Minor opcode of failed request:  1 (X_ShmAttach)
  Serial number of failed request:  202
  Current serial number in output stream:  203
kit@KitServ:~/git/video-compress$ valgrind ./a.out a.vid
==29814== Memcheck, a memory error detector
==29814== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==29814== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==29814== Command: ./a.out a.vid
==29814== 
==29836== Warning: invalid file descriptor 1024 in syscall close()
==29836== Warning: invalid file descriptor 1025 in syscall close()
==29836== Warning: invalid file descriptor 1026 in syscall close()
==29836== Warning: invalid file descriptor 1027 in syscall close()
==29836==    Use --log-fd=<number> to select an alternative log fd.
==29836== Warning: invalid file descriptor 1028 in syscall close()
==29836== Warning: invalid file descriptor 1029 in syscall close()
==29836== 
==29836== HEAP SUMMARY:
==29836==     in use at exit: 12,828,426 bytes in 56,137 blocks
==29836==   total heap usage: 119,755 allocs, 63,618 frees, 53,804,810 bytes allocated
==29836== 
==29836== LEAK SUMMARY:
==29836==    definitely lost: 0 bytes in 0 blocks
==29836==    indirectly lost: 0 bytes in 0 blocks
==29836==      possibly lost: 728 bytes in 18 blocks
==29836==    still reachable: 12,827,698 bytes in 56,119 blocks
==29836==                       of which reachable via heuristic:
==29836==                         newarray           : 832 bytes in 16 blocks
==29836==         suppressed: 0 bytes in 0 blocks
==29836== Rerun with --leak-check=full to see details of leaked memory
==29836== 
==29836== For lists of detected and suppressed errors, rerun with: -s
==29836== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
^C==29814== 
==29814== HEAP SUMMARY:
==29814==     in use at exit: 10,225,041 bytes in 7,548 blocks
==29814==   total heap usage: 156,304 allocs, 148,756 frees, 124,528,896 bytes allocated
==29814== 
==29814== LEAK SUMMARY:
==29814==    definitely lost: 1,168 bytes in 15 blocks
==29814==    indirectly lost: 171,414 bytes in 776 blocks
==29814==      possibly lost: 218,440 bytes in 503 blocks
==29814==    still reachable: 9,834,019 bytes in 6,254 blocks
==29814==                       of which reachable via heuristic:
==29814==                         newarray           : 832 bytes in 16 blocks
==29814==         suppressed: 0 bytes in 0 blocks
==29814== Rerun with --leak-check=full to see details of leaked memory
==29814== 
==29814== For lists of detected and suppressed errors, rerun with: -s
==29814== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
kit@KitServ:~/git/video-compress$ 

役に立つなら、問題のプログラムです

ベストアンサー1

おすすめ記事