From: Robert A. <ro...@gm...> - 2025-06-27 16:47:46
|
Hi Dima, Confirmed, I tested this on Debian 12 with fltk 1.3.8 and got the exact same results as you. I really can't understand why adding a simple function creates the error message. Importing your Fl_Gl_Image_Widget module may cause an issue, as it runs any code in the module, but that doesn't explain why removing the func() function silences the error message. I also changed the functions to def foo(): pass with the exact same results. Also tried changing "from fltk import *" to "import fltk". And used fltk.Fl_Window(... and fltk.Fl.run() no difference, same results. Also ran the python process with valgrind and it definitely seems to indicate that the error message is real. see output below: valgrind python3 dima-test.py ==5954== Memcheck, a memory error detector ==5954== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. ==5954== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info ==5954== Command: python3 dima-test.py ==5954== ==5954== Invalid read of size 8 ==5954== at 0x4023B8C: strncmp (strcmp-sse2.S:160) ==5954== by 0x4004B9E: is_dst (dl-load.c:216) ==5954== by 0x400596E: _dl_dst_count (dl-load.c:253) ==5954== by 0x4005B47: expand_dynamic_string_token (dl-load.c:395) ==5954== by 0x4005CB2: fillin_rpath.isra.0 (dl-load.c:483) ==5954== by 0x4005FA2: decompose_rpath (dl-load.c:654) ==5954== by 0x400815B: _dl_map_object (dl-load.c:2111) ==5954== by 0x4002260: openaux (dl-deps.c:64) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x40025C9: _dl_map_object_deps (dl-deps.c:232) ==5954== by 0x400BA6C: dl_open_worker_begin (dl-open.c:592) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== Address 0x56f34e1 is 1 bytes inside a block of size 8 alloc'd ==5954== at 0x48417B4: malloc (vg_replace_malloc.c:381) ==5954== by 0x402397A: malloc (rtld-malloc.h:56) ==5954== by 0x402397A: strdup (strdup.c:42) ==5954== by 0x4005F34: decompose_rpath (dl-load.c:629) ==5954== by 0x400815B: _dl_map_object (dl-load.c:2111) ==5954== by 0x4002260: openaux (dl-deps.c:64) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x40025C9: _dl_map_object_deps (dl-deps.c:232) ==5954== by 0x400BA6C: dl_open_worker_begin (dl-open.c:592) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B1C5: dl_open_worker (dl-open.c:782) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B5B7: _dl_open (dl-open.c:884) ==5954== ==5954== Invalid read of size 8 ==5954== at 0x4023B94: strncmp (strcmp-sse2.S:162) ==5954== by 0x4004B9E: is_dst (dl-load.c:216) ==5954== by 0x400596E: _dl_dst_count (dl-load.c:253) ==5954== by 0x4005B47: expand_dynamic_string_token (dl-load.c:395) ==5954== by 0x4005CB2: fillin_rpath.isra.0 (dl-load.c:483) ==5954== by 0x4005FA2: decompose_rpath (dl-load.c:654) ==5954== by 0x400815B: _dl_map_object (dl-load.c:2111) ==5954== by 0x4002260: openaux (dl-deps.c:64) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x40025C9: _dl_map_object_deps (dl-deps.c:232) ==5954== by 0x400BA6C: dl_open_worker_begin (dl-open.c:592) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== Address 0x56f34e9 is 1 bytes after a block of size 8 alloc'd ==5954== at 0x48417B4: malloc (vg_replace_malloc.c:381) ==5954== by 0x402397A: malloc (rtld-malloc.h:56) ==5954== by 0x402397A: strdup (strdup.c:42) ==5954== by 0x4005F34: decompose_rpath (dl-load.c:629) ==5954== by 0x400815B: _dl_map_object (dl-load.c:2111) ==5954== by 0x4002260: openaux (dl-deps.c:64) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x40025C9: _dl_map_object_deps (dl-deps.c:232) ==5954== by 0x400BA6C: dl_open_worker_begin (dl-open.c:592) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B1C5: dl_open_worker (dl-open.c:782) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B5B7: _dl_open (dl-open.c:884) ==5954== ==5954== Invalid read of size 8 ==5954== at 0x4023B8C: strncmp (strcmp-sse2.S:160) ==5954== by 0x4004B9E: is_dst (dl-load.c:216) ==5954== by 0x4005A0D: _dl_dst_substitute (dl-load.c:295) ==5954== by 0x4005CB2: fillin_rpath.isra.0 (dl-load.c:483) ==5954== by 0x4005FA2: decompose_rpath (dl-load.c:654) ==5954== by 0x400815B: _dl_map_object (dl-load.c:2111) ==5954== by 0x4002260: openaux (dl-deps.c:64) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x40025C9: _dl_map_object_deps (dl-deps.c:232) ==5954== by 0x400BA6C: dl_open_worker_begin (dl-open.c:592) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B1C5: dl_open_worker (dl-open.c:782) ==5954== Address 0x56f34e1 is 1 bytes inside a block of size 8 alloc'd ==5954== at 0x48417B4: malloc (vg_replace_malloc.c:381) ==5954== by 0x402397A: malloc (rtld-malloc.h:56) ==5954== by 0x402397A: strdup (strdup.c:42) ==5954== by 0x4005F34: decompose_rpath (dl-load.c:629) ==5954== by 0x400815B: _dl_map_object (dl-load.c:2111) ==5954== by 0x4002260: openaux (dl-deps.c:64) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x40025C9: _dl_map_object_deps (dl-deps.c:232) ==5954== by 0x400BA6C: dl_open_worker_begin (dl-open.c:592) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B1C5: dl_open_worker (dl-open.c:782) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B5B7: _dl_open (dl-open.c:884) ==5954== ==5954== Invalid read of size 8 ==5954== at 0x4023B94: strncmp (strcmp-sse2.S:162) ==5954== by 0x4004B9E: is_dst (dl-load.c:216) ==5954== by 0x4005A0D: _dl_dst_substitute (dl-load.c:295) ==5954== by 0x4005CB2: fillin_rpath.isra.0 (dl-load.c:483) ==5954== by 0x4005FA2: decompose_rpath (dl-load.c:654) ==5954== by 0x400815B: _dl_map_object (dl-load.c:2111) ==5954== by 0x4002260: openaux (dl-deps.c:64) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x40025C9: _dl_map_object_deps (dl-deps.c:232) ==5954== by 0x400BA6C: dl_open_worker_begin (dl-open.c:592) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B1C5: dl_open_worker (dl-open.c:782) ==5954== Address 0x56f34e9 is 1 bytes after a block of size 8 alloc'd ==5954== at 0x48417B4: malloc (vg_replace_malloc.c:381) ==5954== by 0x402397A: malloc (rtld-malloc.h:56) ==5954== by 0x402397A: strdup (strdup.c:42) ==5954== by 0x4005F34: decompose_rpath (dl-load.c:629) ==5954== by 0x400815B: _dl_map_object (dl-load.c:2111) ==5954== by 0x4002260: openaux (dl-deps.c:64) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x40025C9: _dl_map_object_deps (dl-deps.c:232) ==5954== by 0x400BA6C: dl_open_worker_begin (dl-open.c:592) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B1C5: dl_open_worker (dl-open.c:782) ==5954== by 0x4AE41D9: _dl_catch_exception (dl-error-skeleton.c:208) ==5954== by 0x400B5B7: _dl_open (dl-open.c:884) ==5954== swig/python detected a memory leak of type 'Fl_Window *', no destructor found. ==5954== ==5954== HEAP SUMMARY: ==5954== in use at exit: 2,464,217 bytes in 2,466 blocks ==5954== total heap usage: 30,151 allocs, 27,685 frees, 29,696,663 bytes allocated ==5954== ==5954== LEAK SUMMARY: ==5954== definitely lost: 0 bytes in 0 blocks ==5954== indirectly lost: 0 bytes in 0 blocks ==5954== possibly lost: 189,405 bytes in 100 blocks ==5954== still reachable: 2,274,812 bytes in 2,366 blocks ==5954== suppressed: 0 bytes in 0 blocks ==5954== Rerun with --leak-check=full to see details of leaked memory ==5954== ==5954== For lists of detected and suppressed errors, rerun with: -s ==5954== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0) On Thu, Jun 26, 2025 at 3:18 PM Dima Kogan <di...@se...> wrote: > > Hello! > > Can one of you help debugging a mystery error please? I have this > script, that does more-or-less nothing: > > import Fl_Gl_Image_Widget > from fltk import * > > def func(): > 5 > > window = Fl_Window(100,200,"xxx") > window.end() > window.show() > > Fl.run() > > I run it, the window pops up, I press Escape, the application exits. > This is right. But as it exits it prints to the console: > > swig/python detected a memory leak of type 'Fl_Window *', no destructor found. > > Does this mean something to any of you? I can make this message go away > by doing unrelated-looking things. I can remove the definition of func() > above (which doesn't do anything anyway). Or I can remove the "import > Fl_Gl_Image_Widget" (which also doesn't do anything). Doing any of these > silences the error. > > This is on a very recent Debian, running everything from packages: > > dima@shorty:~/projects/mrcam$ dpkg -l python3-fltk python3-gl-image-display libfltk1.4 > ii python3-fltk:amd64 1.4.2.0-2 amd64 Python wrapper for the Fast Light Toolkit > ii python3-gl-image-display 0.23-1 amd64 OpenGL-based image visualizer > ii libfltk1.4:amd64 1.4.3-1 amd64 Fast Light Toolkit - main shared library > > I just upgraded libfltk1.4 from 1.4.2-7; it made no difference. > > python3-gl-image-display is mine: > > https://github.com/dkogan/GL_image_display > > It also uses swig. Note that here I'm just doing the import; I'm NOT > actually using it. > > Suggestions? Since unrelated-looking things make the problem disappear > for me, I wouldn't be surprised if yall have trouble reproducing. > > Suggestions? > > Thanks! > > > _______________________________________________ > Pyfltk-user mailing list > Pyf...@li... > https://lists.sourceforge.net/lists/listinfo/pyfltk-user |