Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

valum leaks memory #211

Open
grindhold opened this issue Jun 15, 2017 · 12 comments
Open

valum leaks memory #211

grindhold opened this issue Jun 15, 2017 · 12 comments
Labels
Milestone

Comments

@grindhold
Copy link

grindhold commented Jun 15, 2017

i compiled a minimal example in the following gist
https://gist.github.com/grindhold/664f54c743e49d1a39b2255061fd3d37

When i start the client-script it starts making requests to the server, while doing so the server will start to use more and more memory (about 3MB/s on my testing machine with local connections) and not free it after the requests are finished.

Tested with current git-master on debian stretch

@arteymix
Copy link
Member

Looks like it was missing a null-check. The memory leak was caused by an invalid hash table insertion of the negotiated charset into the Content-Type parameters.

@grindhold
Copy link
Author

i deployed your latest changes but apparently they did not solve the problem. i did some tests with valgrind on the issue and added a massif-outputfile to the gist in case it is of any help.

@arteymix arteymix reopened this Jun 15, 2017
@arteymix
Copy link
Member

arteymix commented Jun 15, 2017

I'll investigate the issue tomorrow. If you do a valgrind --leak-check=full and install libvsgi with debug symbols, you should have a better idea of where this is coming from.

The easiest way is to use dependency(..., fallback: ['valum', 'valum']) and clone/symlink valum into subprojects/valum and compile the whole thing with debug enabled.

@grindhold
Copy link
Author

grindhold commented Jun 21, 2017

i executed the check

another thing to say is that i experience those (testweb:1877): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed a lot

==1877== Memcheck, a memory error detector
==1877== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==1877== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==1877== Command: ./testweb
==1877== 
** Message: vsgi-application.vala:250: Listening on 'http://127.0.0.1:3003/'.
** Message: vsgi-application.vala:250: Listening on 'http://[::1]:3003/'.
==1877== Thread 3 pool:
==1877== Invalid write of size 8
==1877==    at 0x5410885: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0xC5F87CC: vsgi_http_message_body_output_stream_real_flush (vsgi-http.vala:67)
==1877==    by 0x65A90D9: g_output_stream_flush (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x65A6FFD: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x65A930C: g_output_stream_close (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x58EB3D8: vsgi_response_real_expand (vsgi-response.vala:422)
==1877==    by 0x58EB569: vsgi_response_expand (vsgi-response.vala:417)
==1877==    by 0x58EB828: vsgi_response_expand_utf8 (vsgi-response.vala:444)
==1877==    by 0x108DDE: testweb_rewrite (testweb.vala:14)
==1877==    by 0x108EE1: _testweb_rewrite_valum_handler_callback (testweb.c:81)
==1877==    by 0x56A77C2: valum_route_fire (valum-route.vala:67)
==1877==    by 0x56AC2EC: valum_router_perform_routing (valum-router.vala:372)
==1877==  Address 0xc29fc38 is 168 bytes inside a block of size 240 free'd
==1877==    at 0x4C2CDDB: free (vg_replace_malloc.c:530)
==1877==    by 0x540EBA1: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x54104FF: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x54106DA: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4E82A5F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4E82B0B: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x65D872C: g_application_run (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x58F2F9D: vsgi_server_run (vsgi-server.vala:173)
==1877==    by 0x109064: testweb_main (testweb.vala:25)
==1877==    by 0x1090C6: main (testweb.vala:17)
==1877==  Block was alloc'd at
==1877==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==1877==    by 0x4E87E08: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EA0342: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EA096D: g_slice_alloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x540EA7E: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x5410711: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x5411773: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x515EFFF: g_cclosure_marshal_VOID__OBJECTv (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515C1A3: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51768CC: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5176FBE: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x54244DF: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877== 

(testweb:1877): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:1877): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:1877): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:1877): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:1877): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:1877): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed
==1877== 
==1877== Process terminating with default action of signal 2 (SIGINT)
==1877==    at 0x5BE06AD: ??? (syscall-template.S:84)
==1877==    by 0x4E829F5: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4E82B0B: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x65D872C: g_application_run (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x58F2F9D: vsgi_server_run (vsgi-server.vala:173)
==1877==    by 0x109064: testweb_main (testweb.vala:25)
==1877==    by 0x1090C6: main (testweb.vala:17)
==1877== 
==1877== HEAP SUMMARY:
==1877==     in use at exit: 49,628,345 bytes in 922,112 blocks
==1877==   total heap usage: 5,506,448 allocs, 4,584,336 frees, 797,352,767 bytes allocated
==1877== 
==1877== Thread 1:
==1877== 16 bytes in 1 blocks are possibly lost in loss record 525 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179430: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D2AB: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 16 bytes in 1 blocks are possibly lost in loss record 526 of 1,850
==1877==    at 0x4C2BADF: malloc (vg_replace_malloc.c:298)
==1877==    by 0x4C2DE5F: realloc (vg_replace_malloc.c:785)
==1877==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179300: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D2AB: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 16 bytes in 1 blocks are possibly lost in loss record 527 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179430: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D311: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 16 bytes in 1 blocks are possibly lost in loss record 528 of 1,850
==1877==    at 0x4C2BADF: malloc (vg_replace_malloc.c:298)
==1877==    by 0x4C2DE5F: realloc (vg_replace_malloc.c:785)
==1877==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179300: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D311: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 16 bytes in 1 blocks are possibly lost in loss record 529 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179430: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51669D4: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157151: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 16 bytes in 1 blocks are possibly lost in loss record 530 of 1,850
==1877==    at 0x4C2BADF: malloc (vg_replace_malloc.c:298)
==1877==    by 0x4C2DE5F: realloc (vg_replace_malloc.c:785)
==1877==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179300: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51669D4: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157151: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 16 bytes in 1 blocks are possibly lost in loss record 531 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179430: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5161B0B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157156: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 16 bytes in 1 blocks are possibly lost in loss record 532 of 1,850
==1877==    at 0x4C2BADF: malloc (vg_replace_malloc.c:298)
==1877==    by 0x4C2DE5F: realloc (vg_replace_malloc.c:785)
==1877==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179300: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5161B0B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157156: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 24 bytes in 1 blocks are possibly lost in loss record 638 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x517C677: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517BDA4: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516AFD7: g_param_spec_flags (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x56A8408: valum_route_class_init (valum-route.vala:30)
==1877==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517BDA4: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516316B: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51633B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x569E6E7: valum_matcher_route_construct (valum-matcher-route.vala:30)
==1877==    by 0x569E826: valum_matcher_route_new (valum-matcher-route.vala:29)
==1877== 
==1877== 32 bytes in 1 blocks are possibly lost in loss record 945 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x517C677: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517BDA4: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516AEE7: g_param_spec_enum (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x659707B: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516316B: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51633B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x659774A: g_inet_address_new_loopback (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x54187A9: soup_server_listen_local (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0xC5FC62A: vsgi_http_server_real_listen (vsgi-http.vala:322)
==1877== 
==1877== 40 bytes in 1 blocks are possibly lost in loss record 1,038 of 1,850
==1877==    at 0x4C2DDCF: realloc (vg_replace_malloc.c:785)
==1877==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x51788B7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517E2BC: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D4DD: g_flags_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x54046B6: soup_message_flags_get_type (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x5409BF4: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516316B: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51633B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5416EF7: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x515EFFF: g_cclosure_marshal_VOID__OBJECTv (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877== 
==1877== 64 bytes in 1 blocks are possibly lost in loss record 1,152 of 1,850
==1877==    at 0x4C2DDCF: realloc (vg_replace_malloc.c:785)
==1877==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x51788B7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517E2BC: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D3DD: g_enum_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5404876: soup_encoding_get_type (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x53F4D90: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516316B: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51633B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x53F5AB7: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x540F643: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877== 
==1877== 80 bytes in 1 blocks are possibly lost in loss record 1,339 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x517C677: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517BDA4: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517F247: g_type_create_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5166FB2: g_param_spec_internal (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516B4F1: g_param_spec_object (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x569D1F0: valum_context_class_init (valum-context.vala:31)
==1877==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5162CA7: g_object_newv (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51633C3: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x569C360: valum_context_construct (valum-context.vala:48)
==1877== 
==1877== 80 bytes in 2 blocks are possibly lost in loss record 1,340 of 1,850
==1877==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==1877==    by 0x4E87E08: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EA1EE7: g_memdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0xC5FA407: _vala_array_dup2 (vsgi-http.vala:192)
==1877==    by 0xC5FA5DA: vsgi_http_connection_construct (vsgi-http.vala:192)
==1877==    by 0xC5FA73A: vsgi_http_connection_new (vsgi-http.vala:189)
==1877==    by 0xC5FBBE8: __lambda4_ (vsgi-http.vala:277)
==1877==    by 0xC5FC306: ___lambda4__soup_server_callback (vsgi-http.vala:276)
==1877==    by 0x54172DE: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x515BF74: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516DF81: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5176BDB: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877== 
==1877== 96 bytes in 1 blocks are possibly lost in loss record 1,598 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515707A: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 96 bytes in 1 blocks are possibly lost in loss record 1,599 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF72: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D2AB: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 96 bytes in 1 blocks are possibly lost in loss record 1,600 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF72: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D311: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 96 bytes in 1 blocks are possibly lost in loss record 1,601 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF72: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51669D4: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157151: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 96 bytes in 1 blocks are possibly lost in loss record 1,602 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DF72: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5161B0B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157156: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 132 bytes in 1 blocks are possibly lost in loss record 1,670 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179D5F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DFD0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D2AB: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 132 bytes in 1 blocks are possibly lost in loss record 1,671 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179D5F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DFD0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515D311: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 148 bytes in 1 blocks are possibly lost in loss record 1,679 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179B22: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DFD0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x51669D4: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157151: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 148 bytes in 1 blocks are possibly lost in loss record 1,680 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x5179B22: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517DFD0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5161B0B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5157156: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 184 bytes in 1 blocks are possibly lost in loss record 1,706 of 1,850
==1877==    at 0x4C2DDCF: realloc (vg_replace_malloc.c:785)
==1877==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x51788B7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517E2BC: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5168659: g_param_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516A983: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x515715B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==1877==    by 0x400F75A: call_init (dl-init.c:30)
==1877==    by 0x400F75A: _dl_init (dl-init.c:120)
==1877==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==1877== 
==1877== 184 bytes in 1 blocks are possibly lost in loss record 1,707 of 1,850
==1877==    at 0x4C2DDCF: realloc (vg_replace_malloc.c:785)
==1877==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x51788B7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517E2BC: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x517E684: g_type_register_static_simple (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x65C372F: g_task_get_type (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x65C3868: g_task_new (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x659D517: g_io_scheduler_push_job (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x56AF023: valum_router_real_handle_async_co (valum-router.vala:471)
==1877==    by 0x56AE960: valum_router_real_handle_async (valum-router.vala:27)
==1877==    by 0x58D9260: vsgi_handler_handle_async (vsgi-handler.vala:21)
==1877==    by 0xC5FC259: __lambda4_ (vsgi-http.vala:297)
==1877== 
==1877== 368 bytes in 1 blocks are possibly lost in loss record 1,746 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4011CE1: allocate_dtv (dl-tls.c:322)
==1877==    by 0x401266D: _dl_allocate_tls (dl-tls.c:539)
==1877==    by 0x611B00B: allocate_stack (allocatestack.c:580)
==1877==    by 0x611B00B: pthread_create@@GLIBC_2.2.5 (pthread_create.c:539)
==1877==    by 0x4EC7ECF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EAA6DE: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EAA797: g_thread_new (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4E838D0: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4E83922: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4E839D8: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EC75B9: g_unix_signal_add_full (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x58D2EA7: vsgi_application_real_command_line (vsgi-application.vala:257)
==1877== 
==1877== 368 bytes in 1 blocks are possibly lost in loss record 1,747 of 1,850
==1877==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==1877==    by 0x4011CE1: allocate_dtv (dl-tls.c:322)
==1877==    by 0x401266D: _dl_allocate_tls (dl-tls.c:539)
==1877==    by 0x611B00B: allocate_stack (allocatestack.c:580)
==1877==    by 0x611B00B: pthread_create@@GLIBC_2.2.5 (pthread_create.c:539)
==1877==    by 0x4EC7ECF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EAA6DE: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EAAA6C: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EAB08A: g_thread_pool_push (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x65C3FEA: g_task_run_in_thread (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x659D555: g_io_scheduler_push_job (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==1877==    by 0x56AF023: valum_router_real_handle_async_co (valum-router.vala:471)
==1877==    by 0x56AE960: valum_router_real_handle_async (valum-router.vala:27)
==1877== 
==1877== 100,272 bytes in 16,712 blocks are definitely lost in loss record 1,801 of 1,850
==1877==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==1877==    by 0x4E87E08: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EA1EAE: g_strdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x58E9234: _vsgi_response_mark_content_as_utf8 (vsgi-response.vala:325)
==1877==    by 0x58EB7D5: vsgi_response_expand_utf8 (vsgi-response.vala:443)
==1877==    by 0x108DDE: testweb_rewrite (testweb.vala:14)
==1877==    by 0x108EE1: _testweb_rewrite_valum_handler_callback (testweb.c:81)
==1877==    by 0x56A77C2: valum_route_fire (valum-route.vala:67)
==1877==    by 0x56AC2EC: valum_router_perform_routing (valum-router.vala:372)
==1877==    by 0x56ABB63: ______lambda8_ (valum-router.vala:377)
==1877==    by 0x56ABBDB: _______lambda8__valum_next_callback (valum-router.c:2340)
==1877==    by 0x569E1CB: valum_forward (valum-forward.vala:29)
==1877== 
==1877== 668,400 bytes in 16,710 blocks are definitely lost in loss record 1,824 of 1,850
==1877==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==1877==    by 0x4E87E08: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0x4EA1EE7: g_memdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==1877==    by 0xC5FA407: _vala_array_dup2 (vsgi-http.vala:192)
==1877==    by 0xC5FA5DA: vsgi_http_connection_construct (vsgi-http.vala:192)
==1877==    by 0xC5FA73A: vsgi_http_connection_new (vsgi-http.vala:189)
==1877==    by 0xC5FBBE8: __lambda4_ (vsgi-http.vala:277)
==1877==    by 0xC5FC306: ___lambda4__soup_server_callback (vsgi-http.vala:276)
==1877==    by 0x54172DE: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==1877==    by 0x515BF74: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x516DF81: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877==    by 0x5176BDB: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==1877== 
==1877== LEAK SUMMARY:
==1877==    definitely lost: 768,672 bytes in 33,422 blocks
==1877==    indirectly lost: 0 bytes in 0 blocks
==1877==      possibly lost: 2,592 bytes in 28 blocks
==1877==    still reachable: 38,121,737 bytes in 804,795 blocks
==1877==                       of which reachable via heuristic:
==1877==                         length64           : 1,040 bytes in 20 blocks
==1877==                         newarray           : 1,744 bytes in 29 blocks
==1877==         suppressed: 0 bytes in 0 blocks
==1877== Reachable blocks (those to which a pointer was found) are not shown.
==1877== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==1877== 
==1877== For counts of detected and suppressed errors, rerun with: -v
==1877== ERROR SUMMARY: 35 errors from 30 contexts (suppressed: 0 from 0)

@Bob131
Copy link
Member

Bob131 commented Jun 21, 2017 via email

@grindhold
Copy link
Author

grindhold commented Jun 21, 2017

Okay, with G_SLICE=always-malloc valgrind --leak-check=full ./testweb > valgrind_leak.log 2>&1 i receive:

==2007== Memcheck, a memory error detector
==2007== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==2007== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==2007== Command: ./testweb
==2007== 
** Message: vsgi-application.vala:250: Listening on 'http://127.0.0.1:3003/'.
** Message: vsgi-application.vala:250: Listening on 'http://[::1]:3003/'.
==2007== Thread 3 pool:
==2007== Invalid write of size 8
==2007==    at 0x5410885: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0xC5F87CC: vsgi_http_message_body_output_stream_real_flush (vsgi-http.vala:67)
==2007==    by 0x65A90D9: g_output_stream_flush (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x65A6FFD: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x65A930C: g_output_stream_close (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x58EB3D8: vsgi_response_real_expand (vsgi-response.vala:422)
==2007==    by 0x58EB569: vsgi_response_expand (vsgi-response.vala:417)
==2007==    by 0x58EB828: vsgi_response_expand_utf8 (vsgi-response.vala:444)
==2007==    by 0x108DDE: testweb_rewrite (testweb.vala:14)
==2007==    by 0x108EE1: _testweb_rewrite_valum_handler_callback (testweb.c:81)
==2007==    by 0x56A77C2: valum_route_fire (valum-route.vala:67)
==2007==    by 0x56AC2EC: valum_router_perform_routing (valum-router.vala:372)
==2007==  Address 0xf5a41a8 is 168 bytes inside a block of size 240 free'd
==2007==    at 0x4C2CDDB: free (vg_replace_malloc.c:530)
==2007==    by 0x540EBA1: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x54104FF: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x54106DA: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4E82A5F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4E82B0B: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x65D872C: g_application_run (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x58F2F9D: vsgi_server_run (vsgi-server.vala:173)
==2007==    by 0x109064: testweb_main (testweb.vala:25)
==2007==    by 0x1090C6: main (testweb.vala:17)
==2007==  Block was alloc'd at
==2007==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==2007==    by 0x4E87E08: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EA0342: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EA096D: g_slice_alloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x540EA7E: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x5410711: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x5411773: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x541713C: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x540EBB1: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x54104FF: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x54106DA: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007== 

(testweb:2007): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:2007): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed
==2007== 
==2007== Process terminating with default action of signal 2 (SIGINT)
==2007==    at 0x5BE06AD: ??? (syscall-template.S:84)
==2007==    by 0x4E829F5: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4E82B0B: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x65D872C: g_application_run (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x58F2F9D: vsgi_server_run (vsgi-server.vala:173)
==2007==    by 0x109064: testweb_main (testweb.vala:25)
==2007==    by 0x1090C6: main (testweb.vala:17)
==2007== 
==2007== HEAP SUMMARY:
==2007==     in use at exit: 8,141,326 bytes in 149,402 blocks
==2007==   total heap usage: 883,787 allocs, 734,385 frees, 127,960,108 bytes allocated
==2007== 
==2007== Thread 1:
==2007== 16 bytes in 1 blocks are possibly lost in loss record 526 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179430: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D2AB: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 16 bytes in 1 blocks are possibly lost in loss record 527 of 1,851
==2007==    at 0x4C2BADF: malloc (vg_replace_malloc.c:298)
==2007==    by 0x4C2DE5F: realloc (vg_replace_malloc.c:785)
==2007==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179300: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D2AB: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 16 bytes in 1 blocks are possibly lost in loss record 528 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179430: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D311: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 16 bytes in 1 blocks are possibly lost in loss record 529 of 1,851
==2007==    at 0x4C2BADF: malloc (vg_replace_malloc.c:298)
==2007==    by 0x4C2DE5F: realloc (vg_replace_malloc.c:785)
==2007==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179300: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D311: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 16 bytes in 1 blocks are possibly lost in loss record 530 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179430: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51669D4: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157151: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 16 bytes in 1 blocks are possibly lost in loss record 531 of 1,851
==2007==    at 0x4C2BADF: malloc (vg_replace_malloc.c:298)
==2007==    by 0x4C2DE5F: realloc (vg_replace_malloc.c:785)
==2007==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179300: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51669D4: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157151: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 16 bytes in 1 blocks are possibly lost in loss record 532 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179430: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5161B0B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157156: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 16 bytes in 1 blocks are possibly lost in loss record 533 of 1,851
==2007==    at 0x4C2BADF: malloc (vg_replace_malloc.c:298)
==2007==    by 0x4C2DE5F: realloc (vg_replace_malloc.c:785)
==2007==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179300: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF80: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5161B0B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157156: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 24 bytes in 1 blocks are possibly lost in loss record 639 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x517C677: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517BDA4: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516AFD7: g_param_spec_flags (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x56A8408: valum_route_class_init (valum-route.vala:30)
==2007==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517BDA4: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516316B: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51633B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x569E6E7: valum_matcher_route_construct (valum-matcher-route.vala:30)
==2007==    by 0x569E826: valum_matcher_route_new (valum-matcher-route.vala:29)
==2007== 
==2007== 32 bytes in 1 blocks are possibly lost in loss record 946 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x517C677: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517BDA4: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516AEE7: g_param_spec_enum (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x659707B: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516316B: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51633B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x659774A: g_inet_address_new_loopback (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x54187A9: soup_server_listen_local (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0xC5FC62A: vsgi_http_server_real_listen (vsgi-http.vala:322)
==2007== 
==2007== 40 bytes in 1 blocks are possibly lost in loss record 1,040 of 1,851
==2007==    at 0x4C2DDCF: realloc (vg_replace_malloc.c:785)
==2007==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x51788B7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517E2BC: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D4DD: g_flags_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x54046B6: soup_message_flags_get_type (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x5409BF4: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516316B: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51633B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5416EF7: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x515EFFF: g_cclosure_marshal_VOID__OBJECTv (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007== 
==2007== 64 bytes in 1 blocks are possibly lost in loss record 1,155 of 1,851
==2007==    at 0x4C2DDCF: realloc (vg_replace_malloc.c:785)
==2007==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x51788B7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517E2BC: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D3DD: g_enum_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5404876: soup_encoding_get_type (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x53F4D90: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516316B: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51633B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x53F5AB7: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x540F643: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007== 
==2007== 80 bytes in 1 blocks are possibly lost in loss record 1,342 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x517C677: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517BDA4: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517F247: g_type_create_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5166FB2: g_param_spec_internal (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516B4F1: g_param_spec_object (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x569D1F0: valum_context_class_init (valum-context.vala:31)
==2007==    by 0x517C4F6: g_type_class_ref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5162CA7: g_object_newv (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51633C3: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x569C360: valum_context_construct (valum-context.vala:48)
==2007== 
==2007== 96 bytes in 1 blocks are possibly lost in loss record 1,601 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515707A: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 96 bytes in 1 blocks are possibly lost in loss record 1,602 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF72: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D2AB: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 96 bytes in 1 blocks are possibly lost in loss record 1,603 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF72: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D311: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 96 bytes in 1 blocks are possibly lost in loss record 1,604 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF72: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51669D4: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157151: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 96 bytes in 1 blocks are possibly lost in loss record 1,605 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5178939: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5178A23: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DF72: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5161B0B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157156: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 132 bytes in 1 blocks are possibly lost in loss record 1,675 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179D5F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DFD0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D2AB: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 132 bytes in 1 blocks are possibly lost in loss record 1,676 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179D5F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DFD0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515D311: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157147: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 148 bytes in 1 blocks are possibly lost in loss record 1,685 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179B22: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DFD0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x51669D4: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157151: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 148 bytes in 1 blocks are possibly lost in loss record 1,686 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4E87E60: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x5179B22: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517DFD0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5161B0B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5157156: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 184 bytes in 1 blocks are possibly lost in loss record 1,714 of 1,851
==2007==    at 0x4C2DDCF: realloc (vg_replace_malloc.c:785)
==2007==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x51788B7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517E2BC: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5168659: g_param_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516A983: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x515715B: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x400F649: call_init.part.0 (dl-init.c:72)
==2007==    by 0x400F75A: call_init (dl-init.c:30)
==2007==    by 0x400F75A: _dl_init (dl-init.c:120)
==2007==    by 0x4000CD9: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2007== 
==2007== 184 bytes in 1 blocks are possibly lost in loss record 1,715 of 1,851
==2007==    at 0x4C2DDCF: realloc (vg_replace_malloc.c:785)
==2007==    by 0x4E87EC7: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x51788B7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517E2BC: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x517E684: g_type_register_static_simple (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x65C372F: g_task_get_type (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x65C3868: g_task_new (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x659D517: g_io_scheduler_push_job (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x56AF023: valum_router_real_handle_async_co (valum-router.vala:471)
==2007==    by 0x56AE960: valum_router_real_handle_async (valum-router.vala:27)
==2007==    by 0x58D9260: vsgi_handler_handle_async (vsgi-handler.vala:21)
==2007==    by 0xC5FC259: __lambda4_ (vsgi-http.vala:297)
==2007== 
==2007== 368 bytes in 1 blocks are possibly lost in loss record 1,765 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4011CE1: allocate_dtv (dl-tls.c:322)
==2007==    by 0x401266D: _dl_allocate_tls (dl-tls.c:539)
==2007==    by 0x611B00B: allocate_stack (allocatestack.c:580)
==2007==    by 0x611B00B: pthread_create@@GLIBC_2.2.5 (pthread_create.c:539)
==2007==    by 0x4EC7ECF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EAA6DE: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EAA797: g_thread_new (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4E838D0: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4E83922: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4E839D8: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EC75B9: g_unix_signal_add_full (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x58D2EA7: vsgi_application_real_command_line (vsgi-application.vala:257)
==2007== 
==2007== 368 bytes in 1 blocks are possibly lost in loss record 1,766 of 1,851
==2007==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==2007==    by 0x4011CE1: allocate_dtv (dl-tls.c:322)
==2007==    by 0x401266D: _dl_allocate_tls (dl-tls.c:539)
==2007==    by 0x611B00B: allocate_stack (allocatestack.c:580)
==2007==    by 0x611B00B: pthread_create@@GLIBC_2.2.5 (pthread_create.c:539)
==2007==    by 0x4EC7ECF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EAA6DE: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EAAA6C: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EAB08A: g_thread_pool_push (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x65C3FEA: g_task_run_in_thread (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x659D555: g_io_scheduler_push_job (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
==2007==    by 0x56AF023: valum_router_real_handle_async_co (valum-router.vala:471)
==2007==    by 0x56AE960: valum_router_real_handle_async (valum-router.vala:27)
==2007== 
==2007== 16,044 bytes in 2,674 blocks are definitely lost in loss record 1,801 of 1,851
==2007==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==2007==    by 0x4E87E08: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EA1EAE: g_strdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x58E9234: _vsgi_response_mark_content_as_utf8 (vsgi-response.vala:325)
==2007==    by 0x58EB7D5: vsgi_response_expand_utf8 (vsgi-response.vala:443)
==2007==    by 0x108DDE: testweb_rewrite (testweb.vala:14)
==2007==    by 0x108EE1: _testweb_rewrite_valum_handler_callback (testweb.c:81)
==2007==    by 0x56A77C2: valum_route_fire (valum-route.vala:67)
==2007==    by 0x56AC2EC: valum_router_perform_routing (valum-router.vala:372)
==2007==    by 0x56ABB63: ______lambda8_ (valum-router.vala:377)
==2007==    by 0x56ABBDB: _______lambda8__valum_next_callback (valum-router.c:2340)
==2007==    by 0x569E1CB: valum_forward (valum-forward.vala:29)
==2007== 
==2007== 106,960 bytes in 2,674 blocks are definitely lost in loss record 1,826 of 1,851
==2007==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==2007==    by 0x4E87E08: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0x4EA1EE7: g_memdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==2007==    by 0xC5FA407: _vala_array_dup2 (vsgi-http.vala:192)
==2007==    by 0xC5FA5DA: vsgi_http_connection_construct (vsgi-http.vala:192)
==2007==    by 0xC5FA73A: vsgi_http_connection_new (vsgi-http.vala:189)
==2007==    by 0xC5FBBE8: __lambda4_ (vsgi-http.vala:277)
==2007==    by 0xC5FC306: ___lambda4__soup_server_callback (vsgi-http.vala:276)
==2007==    by 0x54172DE: ??? (in /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.8.0)
==2007==    by 0x515BF74: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x516DF81: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007==    by 0x5176BDB: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.3)
==2007== 
==2007== LEAK SUMMARY:
==2007==    definitely lost: 123,004 bytes in 5,348 blocks
==2007==    indirectly lost: 0 bytes in 0 blocks
==2007==      possibly lost: 2,512 bytes in 26 blocks
==2007==    still reachable: 6,272,466 bytes in 130,411 blocks
==2007==                       of which reachable via heuristic:
==2007==                         length64           : 1,040 bytes in 20 blocks
==2007==                         newarray           : 1,744 bytes in 29 blocks
==2007==         suppressed: 0 bytes in 0 blocks
==2007== Reachable blocks (those to which a pointer was found) are not shown.
==2007== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==2007== 
==2007== For counts of detected and suppressed errors, rerun with: -v
==2007== ERROR SUMMARY: 30 errors from 29 contexts (suppressed: 0 from 0)

@arteymix arteymix added the bug label Jun 23, 2017
@arteymix arteymix added this to the 0.3.15 milestone Jun 23, 2017
@arteymix
Copy link
Member

@grindhold could this be in _mark_content_as_utf8? I'll try fix this one, but it looks like a compiler bug.

==8247== Memcheck, a memory error detector
==8247== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==8247== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==8247== Command: ./testweb
==8247== 
** Message: vsgi-application.vala:250: Listening on 'http://127.0.0.1:3003/'.
** Message: vsgi-application.vala:250: Listening on 'http://[::1]:3003/'.
^C==8247== 
==8247== Process terminating with default action of signal 2 (SIGINT)
==8247==    at 0x5BFCDAD: ??? (in /usr/lib64/libc-2.25.so)
==8247==    by 0x52ED598: ??? (in /usr/lib64/libglib-2.0.so.0.5200.2)
==8247==    by 0x52ED6AB: g_main_context_iteration (in /usr/lib64/libglib-2.0.so.0.5200.2)
==8247==    by 0x5F67D1C: g_application_run (in /usr/lib64/libgio-2.0.so.0.5200.2)
==8247==    by 0x5094D9F: vsgi_server_run (vsgi-server.vala:173)
==8247==    by 0x400E31: testweb_main (testweb.vala:19)
==8247==    by 0x400E93: main (testweb.vala:11)
==8247== 
==8247== HEAP SUMMARY:
==8247==     in use at exit: 239,426 bytes in 3,014 blocks
==8247==   total heap usage: 6,016 allocs, 3,002 frees, 596,759 bytes allocated
==8247== 
==8247== 12 bytes in 2 blocks are definitely lost in loss record 109 of 2,403
==8247==    at 0x4C2EB6B: malloc (vg_replace_malloc.c:299)
==8247==    by 0x52F2A68: g_malloc (in /usr/lib64/libglib-2.0.so.0.5200.2)
==8247==    by 0x530BFBE: g_strdup (in /usr/lib64/libglib-2.0.so.0.5200.2)
==8247==    by 0x508BF6F: _vsgi_response_mark_content_as_utf8 (vsgi-response.vala:325)
==8247==    by 0x508E02A: vsgi_response_expand_utf8 (vsgi-response.vala:443)
==8247==    by 0x400C12: testweb_rewrite (testweb.vala:8)
==8247==    by 0x400D11: _testweb_rewrite_valum_handler_callback (testweb.c:81)
==8247==    by 0x4E50FC9: valum_route_fire (valum-route.vala:67)
==8247==    by 0x4E552D5: valum_router_perform_routing (valum-router.vala:372)
==8247==    by 0x4E54CCB: ______lambda8_ (valum-router.vala:377)
==8247==    by 0x4E54D37: _______lambda8__valum_next_callback (valum-router.c:2083)
==8247==    by 0x4E48D92: valum_forward (valum-forward.vala:29)
==8247== 
==8247== LEAK SUMMARY:
==8247==    definitely lost: 12 bytes in 2 blocks
==8247==    indirectly lost: 0 bytes in 0 blocks
==8247==      possibly lost: 2,976 bytes in 27 blocks
==8247==    still reachable: 198,102 bytes in 2,690 blocks
==8247==                       of which reachable via heuristic:
==8247==                         length64           : 1,392 bytes in 27 blocks
==8247==                         newarray           : 1,808 bytes in 33 blocks
==8247==         suppressed: 0 bytes in 0 blocks
==8247== Reachable blocks (those to which a pointer was found) are not shown.
==8247== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==8247== 
==8247== For counts of detected and suppressed errors, rerun with: -v
==8247== ERROR SUMMARY: 28 errors from 28 contexts (suppressed: 0 from 0)

@arteymix
Copy link
Member

This looks like a nasty memory case because it reuses the passed hash table and I'm pretty sure it does not have cleanup callback for keys and values. I'll try to fix that all around.

arteymix added a commit that referenced this issue Jun 23, 2017
The specific issue (#211) was caused by a leaky hash table and this is a
general situation if the 'full' constructor is not being used.

Use explicit 'full' constructor wherever possible and in particular:

 - reset and free 'GLib.Value' in context
 - fix copied hash table when setting the 'charset' parameter
@arteymix
Copy link
Member

@grindhold You can test 8f6f117, it shouldn't leak. All tests pass with valgrind except router-test, but it should just be a matter of digging the issue now.

@grindhold
Copy link
Author

now i have a pretty unstable application. that will answer ~50 requests and then throw a HTTP 500 out of nowhere.
Server outputs look like this:

$ ./testweb
** Message: vsgi-application.vala:250: Listening on 'http://127.0.0.1:3003/'.
** Message: vsgi-application.vala:250: Listening on 'http://[::1]:3003/'.

(testweb:3962): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:3962): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:3962): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:3962): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:3962): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): libsoup-CRITICAL **: soup_message_io_unpause: assertion 'io != NULL' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(testweb:3962): GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

In this conrete case, i started the client application two times. First it throws 1 to n of soup_message_io_unpause: assertion 'io != NULL' failed followed by exactly 5 g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed.

The amount of requests that I am able to send until a 500-error occurs, varies greatly between 10s and something about 1000. It feels like a race condition. Memory usage is still apearing to only rise when I repeatedly start the testscript.

Do you test with the code i provided or solely against unittests? In case you test with the gist-code, and do not encounter the same problems, maybe we have a significant difference in our environments that causes the misbehaviour. I run my code inside an lxc-container.
Is there information I can provide you with that may be of help?

Thanks for the nice work on the bug so far ;)

arteymix added a commit that referenced this issue Jul 9, 2017
@ZanderBrown
Copy link

I'm getting this but seeming lt the other way round to @grindhold

(app:27361): GLib-GObject-CRITICAL **: 12:39:58.628: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(app:27361): GLib-GObject-CRITICAL **: 12:39:58.628: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(app:27361): GLib-GObject-CRITICAL **: 12:39:58.628: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(app:27361): GLib-GObject-CRITICAL **: 12:39:58.628: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(app:27361): GLib-GObject-CRITICAL **: 12:39:58.628: g_object_notify_queue_thaw: assertion 'g_atomic_int_get(&object->ref_count) > 0' failed

(app:27361): libsoup-CRITICAL **: 12:39:59.070: soup_message_io_unpause: assertion 'io != NULL' failed

@ZanderBrown
Copy link

Opened this "upstream" valum-framework/vsgi#2

@arteymix arteymix modified the milestones: 0.3.15, 0.3.19 Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants