❯ apt-cache policy gjs                                  
gjs:
  Installed: 1.72.4-0ubuntu0.22.04.1
  Candidate: 1.72.4-0ubuntu0.22.04.1
  Version table:
 *** 1.72.4-0ubuntu0.22.04.1 400
        400 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1.72.2-0ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     1.72.0-1 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

No variant leak (the other detected is a mozjs issue, but likely a wrong
valgrind detection):

❯  env G_SLICE=always-malloc valgrind --leak-check=full \
    --suppressions=/usr/share/glib-2.0/valgrind/glib.supp \
    gjs -c "const GLib=imports.gi['GLib'];function leak(){const 
l=GLib.Variant['new']('i',1)};leak();imports.system.gc();"
==356489== Memcheck, a memory error detector
==356489== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==356489== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==356489== Command: gjs -c const\ GLib=imports.gi['GLib'];function\ 
leak(){const\ l=GLib.Variant['new']('i',1)};leak();imports.system.gc();
==356489== 
==356489== Warning: set address range perms: large range [0x2204b34b7000, 
0x2205330b7000) (noaccess)
==356489== Warning: set address range perms: large range [0x2204b34b7000, 
0x2205330b7000) (noaccess)
==356489== 
==356489== HEAP SUMMARY:
==356489==     in use at exit: 193,115 bytes in 2,445 blocks
==356489==   total heap usage: 19,931 allocs, 17,486 frees, 9,251,399 bytes 
allocated
==356489== 
==356489== 352 bytes in 1 blocks are possibly lost in loss record 1,965 of 2,008
==356489==    at 0x484DA83: calloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==356489==    by 0x40147D9: calloc (rtld-malloc.h:44)
==356489==    by 0x40147D9: allocate_dtv (dl-tls.c:375)
==356489==    by 0x40147D9: _dl_allocate_tls (dl-tls.c:634)
==356489==    by 0x5008834: allocate_stack (allocatestack.c:430)
==356489==    by 0x5008834: pthread_create@@GLIBC_2.34 (pthread_create.c:647)
==356489==    by 0x5A36794: mozilla::TimeStamp::ComputeProcessUptime() (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==356489==    by 0x5A36856: mozilla::TimeStamp::ProcessCreation(bool*) (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==356489==    by 0x5444A7F: JS::detail::InitWithFailureDiagnostic(bool) (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==356489==    by 0x48A2363: ??? (in /usr/lib/x86_64-linux-gnu/libgjs.so.0.0.0)
==356489==    by 0x400647D: call_init.part.0 (dl-init.c:70)
==356489==    by 0x4006567: call_init (dl-init.c:33)
==356489==    by 0x4006567: _dl_init (dl-init.c:117)
==356489==    by 0x40202E9: ??? (in 
/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
==356489==    by 0x2: ???
==356489==    by 0x1FFEFFFBBE: ???
==356489== 
==356489== LEAK SUMMARY:
==356489==    definitely lost: 0 bytes in 0 blocks
==356489==    indirectly lost: 0 bytes in 0 blocks
==356489==      possibly lost: 352 bytes in 1 blocks
==356489==    still reachable: 77,254 bytes in 965 blocks
==356489==         suppressed: 97,829 bytes in 1,292 blocks
==356489== Reachable blocks (those to which a pointer was found) are not shown.
==356489== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==356489== 
==356489== For lists of detected and suppressed errors, rerun with: -s
==356489== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 1 from 1)

-------------

env GJS_DEBUG_TOPICS= valgrind --leak-check=full \
  --suppressions=/usr/share/glib-2.0/valgrind/glib.supp \
  /usr/libexec/installed-tests/gjs/minijasmine \
  /usr/libexec/installed-tests/gjs/js/testGIMarshalling.js

==357068== Warning: set address range perms: large range [0xbabd0a0c000, 
0xbac5060c000) (noaccess)
==357068== 
==357068== HEAP SUMMARY:
==357068==     in use at exit: 231,169 bytes in 3,087 blocks
==357068==   total heap usage: 155,879 allocs, 152,792 frees, 28,688,797 bytes 
allocated
==357068== 
==357068== 0 bytes in 1 blocks are definitely lost in loss record 1 of 2,526
==357068==    at 0x4848899: malloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==357068==    by 0x4005A22: malloc (rtld-malloc.h:56)
==357068==    by 0x4005A22: _dl_find_object_update (dl-find_object.c:791)
==357068==    by 0x400ECCF: dl_open_worker_begin (dl-open.c:735)
==357068==    by 0x4EC0C27: _dl_catch_exception (dl-error-skeleton.c:208)
==357068==    by 0x400DF99: dl_open_worker (dl-open.c:782)
==357068==    by 0x4EC0C27: _dl_catch_exception (dl-error-skeleton.c:208)
==357068==    by 0x400E34D: _dl_open (dl-open.c:883)
==357068==    by 0x4DDC6BB: dlopen_doit (dlopen.c:56)
==357068==    by 0x4EC0C27: _dl_catch_exception (dl-error-skeleton.c:208)
==357068==    by 0x4EC0CF2: _dl_catch_error (dl-error-skeleton.c:227)
==357068==    by 0x4DDC1AD: _dlerror_run (dlerror.c:138)
==357068==    by 0x4DDC747: dlopen_implementation (dlopen.c:71)
==357068==    by 0x4DDC747: dlopen@@GLIBC_2.34 (dlopen.c:81)
==357068== 
==357068== 44 (40 direct, 4 indirect) bytes in 1 blocks are definitely lost in 
loss record 1,567 of 2,526
==357068==    at 0x4848899: malloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==357068==    by 0x4A12738: g_malloc (gmem.c:128)
==357068==    by 0x4A29B74: g_slice_alloc (gslice.c:1072)
==357068==    by 0x49D80C3: g_array_sized_new (garray.c:271)
==357068==    by 0x49D82CA: g_byte_array_new_take (garray.c:2301)
==357068==    by 0x49DF3F0: g_bytes_unref_to_array (gbytes.c:539)
==357068==    by 0x48F0283: ??? (in /usr/lib/x86_64-linux-gnu/libgjs.so.0.0.0)
==357068==    by 0x48D0D74: ??? (in /usr/lib/x86_64-linux-gnu/libgjs.so.0.0.0)
==357068==    by 0x50C9F02: ??? (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x50CA48D: ??? (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x50CAB8F: ??? (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x5266861: ??? (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068== 
==357068== 72 bytes in 3 blocks are definitely lost in loss record 1,754 of 
2,526
==357068==    at 0x4848899: malloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==357068==    by 0x4A12738: g_malloc (gmem.c:128)
==357068==    by 0x4A29B74: g_slice_alloc (gslice.c:1072)
==357068==    by 0xBE0B367: 
gi_marshalling_tests_garray_boxed_struct_full_return (in 
/usr/libexec/installed-tests/gjs/libgimarshallingtests.so)
==357068==    by 0x4F7BE2D: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.8.1.0)
==357068==    by 0x4F78492: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.8.1.0)
==357068==    by 0x48BDC4B: ??? (in /usr/lib/x86_64-linux-gnu/libgjs.so.0.0.0)
==357068==    by 0x48BE446: ??? (in /usr/lib/x86_64-linux-gnu/libgjs.so.0.0.0)
==357068==    by 0x50CA1CA: ??? (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x50BB455: ??? (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x50C9A10: ??? (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x50C9FD0: ??? (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068== 
==357068== 352 bytes in 1 blocks are possibly lost in loss record 2,476 of 2,526
==357068==    at 0x484DA83: calloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==357068==    by 0x40147D9: calloc (rtld-malloc.h:44)
==357068==    by 0x40147D9: allocate_dtv (dl-tls.c:375)
==357068==    by 0x40147D9: _dl_allocate_tls (dl-tls.c:634)
==357068==    by 0x4DE1834: allocate_stack (allocatestack.c:430)
==357068==    by 0x4DE1834: pthread_create@@GLIBC_2.34 (pthread_create.c:647)
==357068==    by 0x57EC794: mozilla::TimeStamp::ComputeProcessUptime() (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x57EC856: mozilla::TimeStamp::ProcessCreation(bool*) (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x51FAA7F: JS::detail::InitWithFailureDiagnostic(bool) (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357068==    by 0x48A2363: ??? (in /usr/lib/x86_64-linux-gnu/libgjs.so.0.0.0)
==357068==    by 0x400647D: call_init.part.0 (dl-init.c:70)
==357068==    by 0x4006567: call_init (dl-init.c:33)
==357068==    by 0x4006567: _dl_init (dl-init.c:117)
==357068==    by 0x40202E9: ??? (in 
/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
==357068==    by 0x1: ???
==357068==    by 0x1FFEFFFBA6: ???
==357068== 
==357068== LEAK SUMMARY:
==357068==    definitely lost: 112 bytes in 5 blocks
==357068==    indirectly lost: 4 bytes in 1 blocks
==357068==      possibly lost: 352 bytes in 1 blocks
==357068==    still reachable: 97,650 bytes in 1,334 blocks
==357068==         suppressed: 108,387 bytes in 1,498 blocks
==357068== Reachable blocks (those to which a pointer was found) are not shown.
==357068== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==357068== 
==357068== For lists of detected and suppressed errors, rerun with: -s
==357068== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 1 from 1)

The two libgjs leaks recorded are the one expected, actually due to
gobject-introspection issues

---------------

env GJS_DEBUG_TOPICS= valgrind --leak-check=full \
  --suppressions=/usr/share/glib-2.0/valgrind/glib.supp \
  /usr/libexec/installed-tests/gjs/minijasmine \
  /usr/libexec/installed-tests/gjs/js/testRegress.js

==357933== HEAP SUMMARY:
==357933==     in use at exit: 229,044 bytes in 3,023 blocks
==357933==   total heap usage: 120,606 allocs, 117,583 frees, 24,339,973 bytes 
allocated
==357933== 
==357933== 0 bytes in 1 blocks are definitely lost in loss record 1 of 2,492
==357933==    at 0x4848899: malloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==357933==    by 0x4005A22: malloc (rtld-malloc.h:56)
==357933==    by 0x4005A22: _dl_find_object_update (dl-find_object.c:791)
==357933==    by 0x400ECCF: dl_open_worker_begin (dl-open.c:735)
==357933==    by 0x4EC0C27: _dl_catch_exception (dl-error-skeleton.c:208)
==357933==    by 0x400DF99: dl_open_worker (dl-open.c:782)
==357933==    by 0x4EC0C27: _dl_catch_exception (dl-error-skeleton.c:208)
==357933==    by 0x400E34D: _dl_open (dl-open.c:883)
==357933==    by 0x4DDC6BB: dlopen_doit (dlopen.c:56)
==357933==    by 0x4EC0C27: _dl_catch_exception (dl-error-skeleton.c:208)
==357933==    by 0x4EC0CF2: _dl_catch_error (dl-error-skeleton.c:227)
==357933==    by 0x4DDC1AD: _dlerror_run (dlerror.c:138)
==357933==    by 0x4DDC747: dlopen_implementation (dlopen.c:71)
==357933==    by 0x4DDC747: dlopen@@GLIBC_2.34 (dlopen.c:81)
==357933== 
==357933== 352 bytes in 1 blocks are possibly lost in loss record 2,443 of 2,492
==357933==    at 0x484DA83: calloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==357933==    by 0x40147D9: calloc (rtld-malloc.h:44)
==357933==    by 0x40147D9: allocate_dtv (dl-tls.c:375)
==357933==    by 0x40147D9: _dl_allocate_tls (dl-tls.c:634)
==357933==    by 0x4DE1834: allocate_stack (allocatestack.c:430)
==357933==    by 0x4DE1834: pthread_create@@GLIBC_2.34 (pthread_create.c:647)
==357933==    by 0x57EC794: mozilla::TimeStamp::ComputeProcessUptime() (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357933==    by 0x57EC856: mozilla::TimeStamp::ProcessCreation(bool*) (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357933==    by 0x51FAA7F: JS::detail::InitWithFailureDiagnostic(bool) (in 
/usr/lib/x86_64-linux-gnu/libmozjs-91.so.91.10.0)
==357933==    by 0x48A2363: ??? (in /usr/lib/x86_64-linux-gnu/libgjs.so.0.0.0)
==357933==    by 0x400647D: call_init.part.0 (dl-init.c:70)
==357933==    by 0x4006567: call_init (dl-init.c:33)
==357933==    by 0x4006567: _dl_init (dl-init.c:117)
==357933==    by 0x40202E9: ??? (in 
/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
==357933==    by 0x1: ???
==357933==    by 0x1FFEFFFBAE: ???
==357933== 
==357933== LEAK SUMMARY:
==357933==    definitely lost: 0 bytes in 1 blocks
==357933==    indirectly lost: 0 bytes in 0 blocks
==357933==      possibly lost: 352 bytes in 1 blocks
==357933==    still reachable: 98,173 bytes in 1,282 blocks
==357933==         suppressed: 106,343 bytes in 1,495 blocks
==357933== Reachable blocks (those to which a pointer was found) are not shown.
==357933== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==357933== 
==357933== For lists of detected and suppressed errors, rerun with: -s
==357933== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 1 from 1)

Nothing gjs related is leaked.

** Tags removed: verification-needed
** Tags added: verification-done

** Tags removed: verification-needed-jammy
** Tags added: verification-done-jammy

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gjs in Ubuntu.
https://bugs.launchpad.net/bugs/2012978

Title:
  Memory leak

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gjs/+bug/2012978/+subscriptions


-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to