intel / gstreamer-media-SDK

GNU Lesser General Public License v2.1
90 stars 53 forks source link

Double close a fd make the program logic not works #179

Open sgbihu opened 4 years ago

sgbihu commented 4 years ago

The below two functions try to close same file descriptor twice. https://github.com/intel/gstreamer-media-SDK/blob/1be01b292336d821e38ec20e504fce835fbc7c5d/gst-libs/mfx/x11/gstmfxwindow_x11.c#L477 It will call close at write_vec in xcb_conn.c

https://github.com/intel/gstreamer-media-SDK/blob/1be01b292336d821e38ec20e504fce835fbc7c5d/gst-libs/mfx/gstmfxprimebufferproxy.c#L129

this will close at i965_release_buffer_handle in intel VA driver.

If the system try to open a new fd, it will return the Line 477 closed fd. And then it close by Line 129 again. This will make resource closed and make program has problem.

criusxu commented 3 years ago

how to fix this bug?

sgbihu commented 3 years ago

I didn't fix it. Because it called third-part library. I don't know the side effect. I use multi-process as a workaround.

criusxu commented 3 years ago

My program must display multi mfxsink in one process, do you have any idea to fix this problem?