Re: [dev] surf/webkit2gtk-2.38.0 file descriptors

2022-10-21 Thread Petr Vaněk
Hi,

On Sun, Oct 16, 2022 at 05:48:44PM +0200, Quentin Rameau wrote:
> I've hacked some solution to the problem of passing the socket pair
> to the web-extension.
> 
> It is pushed to git but not released yet,
> please test it and report if it works or if you get any issue with it.

I have tested it with both webkit-2.{36.8,38.0} but it segfaults with
following message

** (WebKitWebProcess:30255): CRITICAL **: 15:56:37.467: const char* 
webkit_user_message_get_name(WebKitUserMessage*): assertion 
'WEBKIT_IS_USER_MESSAGE(message)' failed

which is printed from webext-surf.so, however it is most probably
because of dying surf. The webkit_web_page_send_message_to_view_finish
function in pageusermessagereply returns NULL with an error message:
"Operation was cancelled", the following function
webkit_user_message_get_name fails because it does not expect NULL.

The segfault happens here:

   r = webkit_user_message_new_with_fd_list("surf-pipe", NULL, gfd);

because invalid gfd, which contains weird values like: 0xc376b480.

This is related to error messages from gcc-11.3.0:

surf.c: In function 'viewusrmsgrcv':
surf.c:1594:15: warning: implicit declaration of function 
'g_unix_fd_list_new_from_array' [-Wimplicit-function-declaration]
 1594 | gfd = g_unix_fd_list_new_from_array([1], 1);
  |   ^
surf.c:1594:13: warning: assignment to 'GUnixFDList *' {aka 'struct 
_GUnixFDList *'} from 'int' makes pointer from integer without a cast 
[-Wint-conversion]
 1594 | gfd = g_unix_fd_list_new_from_array([1], 1);
  | ^

because of missing gio/gunixfdlist.h includes. I will send fix commit
soon to hackers mailing list.

Petr



[dev] surf/webkit2gtk-2.38.0 file descriptors

2022-10-16 Thread Quentin Rameau
Hi,

Sorry for not answering directly,
but as there has been several threads about it,
I'm making a global answer here.

I've hacked some solution to the problem of passing the socket pair
to the web-extension.

It is pushed to git but not released yet,
please test it and report if it works or if you get any issue with it.

Cheers!

P.S.: I know there are several others pending patches but I don't have
a lot of free time those days.
I promise I'm interested in merging them but I don't hesitate to "bump"
them again so that I can trace those still relevant.