<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: Î¢ÈíÑźÚ; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>hello everyone !<div><br></div><div>I am new here, and i got a question.</div><div>I was trying to work with libwebkitgtk-4.0, I want to use it with no GUI program like a web&nbsp;<span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">crawler.&nbsp;</span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;"><br></span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">But when i try to use code below not in the main thread(main thread means end with gtk_main()), it got crash</span></div><div><br></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;"><b>GtkWidget *webView = webkit_web_view_new();</b></span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;"><b><br></b></span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-weight: bold;">Program received signal SIGSEGV, Segmentation fault.</span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-weight: bold;"><br></span></div><div>i use gdb to debug, it tells me this&nbsp;<span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">backtrace.</span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;"><br></span></div><div><span style="background-color: rgba(0, 0, 0, 0);">#0  set_para_values (layout=layout@entry=0x7fff88004410, base_dir=base_dir@entry=PANGO_DIRECTION_RTL, style=style@entry=0x0, display=display@entry=0x65b2e0) at gtktextlayout.c:1341
<br>#1  0x00007fffee941613 in gtk_text_layout_get_line_display (layout=layout@entry=0x7fff88004410, line=line@entry=0x7fff88024840, size_only=size_only@entry=1) at gtktextlayout.c:2209
<br>#2  0x00007fffee941d32 in gtk_text_layout_real_wrap (layout=0x7fff88004410, line=0x7fff88024840, line_data=0x61aae0) at gtktextlayout.c:1165
<br>#3  0x00007fffee9231ba in gtk_text_btree_node_validate (view=view@entry=0x7fff8802a410, node=&lt;optimized out&gt;, view_id=view_id@entry=0x7fff88004410, state=state@entry=0x7fffffffe150) at gtktextbtree.c:5103
<br>#4  0x00007fffee927400 in _gtk_text_btree_validate (tree=0x7fff88029800, view_id=view_id@entry=0x7fff88004410, max_pixels=max_pixels@entry=2000, y=y@entry=0x7fffffffe1b4, 
<br>    old_height=old_height@entry=0x7fffffffe1b8, new_height=new_height@entry=0x7fffffffe1bc) at gtktextbtree.c:5255
<br>#5  0x00007fffee93ff57 in gtk_text_layout_validate (layout=0x7fff88004410, max_pixels=max_pixels@entry=2000) at gtktextlayout.c:1137
<br>#6  0x00007fffee94ecb5 in incremental_validate_callback (data=0x7fff880251e0) at gtktextview.c:3883
<br>#7  0x00007fffeb949fb8 in gdk_threads_dispatch (data=0x7fff880167a0) at gdk.c:788
<br>#8  0x00007fffec1c59e5 in g_main_dispatch (context=0x63b820) at gmain.c:3064
<br>#9  g_main_context_dispatch (context=context@entry=0x63b820) at gmain.c:3663
<br>#10 0x00007fffec1c5d48 in g_main_context_iterate (context=0x63b820, block=block@entry=1, dispatch=dispatch@entry=1, self=&lt;optimized out&gt;) at gmain.c:3734
<br>#11 0x00007fffec1c600a in g_main_loop_run (loop=0x667cd0) at gmain.c:3928
<br>#12 0x00007fffee88f905 in gtk_main () at gtkmain.c:1162
<br>#13 0x0000000000402174 in main (argc=1, argv=0x7fffffffe468) at main.c:42</span></div><div><span style="background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="background-color: rgba(0, 0, 0, 0);"><br></span></div><div>Can anyone figure me out, what should i do next, to get multithreading use WebKitWebView objects without GUI ?</div><div><br></div><div>Thank you very much !</div><div>Thanks for your reading !</div></body></html>