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$ 

도움이 된다면,문제의 프로그램입니다.

관련 정보