Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Segfault when uploading a file when the server replies an error #1764

@linkmauve

Description

@linkmauve

I tried to upload a file to my server using Dino, and the following happened:

XMPP OUT
<iq id='b84b480a-d44d-4f6c-bd87-b02c15570ed8' type='get' to='my-server'>
  <request xmlns='urn:xmpp:http:upload:0' filename='*redacted*' size='1254984' content-type='image/jpeg' />
</iq>

XMPP OUT
<r xmlns='urn:xmpp:sm:3' />

XMPP IN
<iq id='b84b480a-d44d-4f6c-bd87-b02c15570ed8' type='result' to='linkmauve@my-server/dino.7889f381' from='my-server'>
  <slot xmlns='urn:xmpp:http:upload:0'>
    <get url='https://my-server/*redacted*/*redacted*.jpeg' />
    <put url='https://my-server/*redacted*/*redacted*.jpeg'>
      <header name='Authorization'>
        Bearer *redacted*
      </header>
    </put>
  </slot>
</iq>

XMPP IN
<a xmlns='urn:xmpp:sm:3' h='20' />

XMPP OUT
<message id='027b4ce2-7b28-4b88-bd35-ee22100ebddd' to='recipient@their-server' type='chat'>
  <file-sharing xmlns='urn:xmpp:sfs:0' id='0b700143-c593-4aac-8938-843820a6cac1'>
    <file xmlns='urn:xmpp:file:metadata:0'>
      <name>
        *redacted*
      </name>
      <media_type>
        image/jpeg
      </media_type>
      <size>
        1254984
      </size>
      <date>
        2025-09-01T18:18:50+0000
      </date>
      <width>
        2550
      </width>
      <height>
        3510
      </height>
      <hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>
        qzD0RjoppjCHw/Ezo8lj8kZTqzPbvKPB/RVT7W7X1bQ=
      </hash>
      <hash xmlns='urn:xmpp:hashes:2' algo='sha-512'>
        0MLT+fLBLX/s4vcsDYEWmr5kKyfik/qefqllNWoiXc+lNuvNeIMRtxQIzmIpJxD+qR4/xdGyRT2NzNlFsTbBhA==
      </hash>
      <thumbnail xmlns='urn:xmpp:thumbs:1' uri='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAECAIAAAArjXluAAAAA3NCSVQICAjb4U/gAAAAJUlEQVQImWO8/uQzMxMT098f35j//2X59eMHw79/LBxcXMzMzADRygy2Ix/60AAAAABJRU5ErkJggg==' media-type='image/png' width='2' height='4' />
    </file>
  </file-sharing>
  <store xmlns='urn:xmpp:hints' />
  <active xmlns='http://jabber.org/protocol/chatstates' />
</message>

XMPP OUT
<r xmlns='urn:xmpp:sm:3' />

XMPP IN
<r xmlns='urn:xmpp:sm:3' />

XMPP OUT
<a xmlns='urn:xmpp:sm:3' h='709' />

XMPP IN
<a xmlns='urn:xmpp:sm:3' h='21' />


(dino:163990): libsoup-http2-WARNING **: 20:21:45.679: Unexpected state changed WRITE_DATA -> READ_DATA_START, expected to be from READ_HEADERS

(dino:163990): libdino-WARNING **: 20:21:45.680: file_manager.vala:167: Send file error: HTTP upload error: HTTP status code 413
zsh: segmentation fault (core dumped)  dino --print-xmpp=all

Here is the stack trace according to coredumpctl gdb:

Core was generated by `/usr/bin/dino --print-xmpp=all'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fc9f63d7260 in number_singletons () from /usr/lib/libgtk-4.so.1
[Current thread is 1 (Thread 0x7fc9f0e8ea00 (LWP 163990))]
(gdb) bt
#0  0x00007fc9f63d7260 in number_singletons () from /usr/lib/libgtk-4.so.1
#1  0x00007fc9f655cb18 in g_array_remove_range (farray=0x561a406aec20, index_=index_@entry=1, length=1083032655) at ../glib/glib/garray.c:889
#2  0x00007fc9f6561bd0 in g_array_set_size (farray=farray@entry=0x561a406aec20, length=length@entry=1) at ../glib/glib/garray.c:772
#3  0x00007fc9f6561e76 in g_byte_array_set_size (array=0x561a406aec20, length=length@entry=1) at ../glib/glib/garray.c:2913
#4  0x00007fc9ecebc6b0 in on_data_read (source=<optimized out>, res=<optimized out>, user_data=0x561a4641e230) at ../libsoup/libsoup/http2/soup-client-message-io-http2.c:1165
#5  0x00007fc9f5765128 in async_ready_callback_wrapper (source_object=0x561a41462740, res=0x561a42175040, user_data=0x561a4641e230) at ../glib/gio/ginputstream.c:565
#6  0x00007fc9f57981fc in g_task_return_now (task=0x561a42175040) at ../glib/gio/gtask.c:1363
#7  0x00007fc9f579dc52 in g_task_return (type=<optimized out>, task=0x561a42175040) at ../glib/gio/gtask.c:1432
#8  g_task_return (task=0x561a42175040, type=<optimized out>) at ../glib/gio/gtask.c:1389
#9  0x00007fc9f579e3dd in g_task_return_pointer (task=<optimized out>, result=<optimized out>, result_destroy=<optimized out>) at ../glib/gio/gtask.c:1874
#10 0x00007fc9f6a3f897 in dino_limit_input_stream_real_read_async_co (_data_=0x561a41a01a50) at libdino/libdino.so.0.0.p/src/util/limit_input_stream.c:479
#11 0x00007fc9f5765128 in async_ready_callback_wrapper (source_object=0x7fc9d4104000, res=0x561a4650bdd0, user_data=0x561a41a01a50) at ../glib/gio/ginputstream.c:565
#12 0x00007fc9f57981fc in g_task_return_now (task=0x561a4650bdd0) at ../glib/gio/gtask.c:1363
#13 0x00007fc9f5798245 in complete_in_idle_cb (task=0x561a4650bdd0) at ../glib/gio/gtask.c:1377
#14 0x00007fc9f659b880 in g_main_dispatch (context=0x561a40584c30) at ../glib/glib/gmain.c:3398
#15 0x00007fc9f659ccd7 in g_main_context_dispatch_unlocked (context=0x561a40584c30) at ../glib/glib/gmain.c:4249
#16 g_main_context_iterate_unlocked (context=context@entry=0x561a40584c30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4314
#17 0x00007fc9f659cee5 in g_main_context_iteration (context=context@entry=0x561a40584c30, may_block=may_block@entry=1) at ../glib/glib/gmain.c:4379
#18 0x00007fc9f57d25a6 in g_application_run (application=application@entry=0x561a405e35a0, argc=argc@entry=2, argv=argv@entry=0x7ffeaae1d888) at ../glib/gio/gapplication.c:2715
#19 0x0000561a06f7d3e8 in dino_main (args=0x7ffeaae1d888, args_length1=2) at main/dino.p/src/main.c:138
#20 main (argc=2, argv=0x7ffeaae1d888) at main/dino.p/src/main.c:178

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions