Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed (Author was flagged for spam)

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
X BadRequest error when running a SDL2 program over SSH, but not with valgrind?
Post Flair (click to view more posts with a particular flair)
Post Body

I'm relatively new to SDL2, but I made a quick and dirty program for something. It works fine on my laptop, but when I connect to my server, and try to test it using X tunneling over SSH, I get the outline of a window for a split second, then I get this error:

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

Other X programs work fine though? Even other SDL2 programs, too.

Looking online, I get results about it being OpenGL problems, but my program doesn't use OpenGL at all. Or, at least, it shouldn't, as my other SDL2 programs work fine, and this doesn't really use anything too complicated, just surfaces and bitplanes. Anyway, I tried the solutions and alas, nothing worked...

Interestingly, when I run it through valgrind, I get this, and not the above error:

==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()

followed by a heap summary, as if the program stopped, but it continues running... and after a while, the program begins to run? And when I close out of it, it shows another heap summary...

Here's the full log, in case it's helpful at all.

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$ 

In case it's helpful at all, here's the program in question.

Author
Account Strength
0%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
89,325
Link Karma
48,280
Comment Karma
38,812
Profile updated: 7 months ago
Posts updated: 8 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago