- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 SDL2,当我使用 valgrind 运行它时,我得到了这个内存错误
:
==19367== Memcheck, a memory error detector
==19367== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19367== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==19367== Command: ./test
==19367==
==19367== Invalid read of size 8
==19367== at 0x40286C8: strncmp (strcmp.S:172)
==19367== by 0x400668D: is_dst (dl-load.c:216)
==19367== by 0x400810E: _dl_dst_count (dl-load.c:253)
==19367== by 0x400810E: expand_dynamic_string_token (dl-load.c:395)
==19367== by 0x40082B7: fillin_rpath.isra.0 (dl-load.c:483)
==19367== by 0x4008602: decompose_rpath (dl-load.c:654)
==19367== by 0x400ABF5: cache_rpath (dl-load.c:696)
==19367== by 0x400ABF5: cache_rpath (dl-load.c:677)
==19367== by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==19367== by 0x4003494: openaux (dl-deps.c:64)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==19367== by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x400DF99: dl_open_worker (dl-open.c:782)
==19367== Address 0x68c9269 is 9 bytes inside a block of size 15 alloc'd
==19367== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19367== by 0x40271FF: malloc (rtld-malloc.h:56)
==19367== by 0x40271FF: strdup (strdup.c:42)
==19367== by 0x4008594: decompose_rpath (dl-load.c:629)
==19367== by 0x400ABF5: cache_rpath (dl-load.c:696)
==19367== by 0x400ABF5: cache_rpath (dl-load.c:677)
==19367== by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==19367== by 0x4003494: openaux (dl-deps.c:64)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==19367== by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x400DF99: dl_open_worker (dl-open.c:782)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x400E34D: _dl_open (dl-open.c:883)
==19367==
==19367== Invalid read of size 8
==19367== at 0x40286C8: strncmp (strcmp.S:172)
==19367== by 0x400668D: is_dst (dl-load.c:216)
==19367== by 0x4007F79: _dl_dst_substitute (dl-load.c:295)
==19367== by 0x40082B7: fillin_rpath.isra.0 (dl-load.c:483)
==19367== by 0x4008602: decompose_rpath (dl-load.c:654)
==19367== by 0x400ABF5: cache_rpath (dl-load.c:696)
==19367== by 0x400ABF5: cache_rpath (dl-load.c:677)
==19367== by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==19367== by 0x4003494: openaux (dl-deps.c:64)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==19367== by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x400DF99: dl_open_worker (dl-open.c:782)
==19367== Address 0x68c9269 is 9 bytes inside a block of size 15 alloc'd
==19367== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19367== by 0x40271FF: malloc (rtld-malloc.h:56)
==19367== by 0x40271FF: strdup (strdup.c:42)
==19367== by 0x4008594: decompose_rpath (dl-load.c:629)
==19367== by 0x400ABF5: cache_rpath (dl-load.c:696)
==19367== by 0x400ABF5: cache_rpath (dl-load.c:677)
==19367== by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==19367== by 0x4003494: openaux (dl-deps.c:64)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==19367== by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x400DF99: dl_open_worker (dl-open.c:782)
==19367== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19367== by 0x400E34D: _dl_open (dl-open.c:883)
==19367==
==19367==
==19367== HEAP SUMMARY:
==19367== in use at exit: 303,614 bytes in 3,333 blocks
==19367== total heap usage: 70,133 allocs, 66,800 frees, 12,517,414 bytes allocated
==19367==
==19367== LEAK SUMMARY:
==19367== definitely lost: 11,984 bytes in 270 blocks
==19367== indirectly lost: 44,148 bytes in 923 blocks
==19367== possibly lost: 0 bytes in 0 blocks
==19367== still reachable: 247,482 bytes in 2,140 blocks
==19367== suppressed: 0 bytes in 0 blocks
==19367== Rerun with --leak-check=full to see details of leaked memory
==19367==
==19367== For lists of detected and suppressed errors, rerun with: -s
==19367== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
为了隔离造成伤害的原因,我将其减少到最低限度:
#include <stdio.h>
#include <SDL2/SDL.h>
int main(void)
{
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) != 0)
{
printf("error initializing SDL: %s\n", SDL_GetError());
return 1;
}
SDL_Window* win = SDL_CreateWindow("Test",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
640, 480, 0);
if (!win)
{
printf("error creating window: %s\n", SDL_GetError());
SDL_Quit();
return 1;
}
SDL_Renderer* rend = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
if (!rend)
{
printf("error creating renderer: %s\n", SDL_GetError());
SDL_DestroyWindow(win);
SDL_Quit();
return 1;
}
SDL_RenderClear(rend);
SDL_DestroyRenderer(rend);
SDL_DestroyWindow(win);
SDL_Quit();
}
里面没有我的代码。所以我可能错误地使用了 sdl api,但看着片段我无法弄清楚是什么。还有一个 so question 有类似的问题 Uncaught exception at SDL_Quit ,但是没有答案而且测试的代码也很不一样。
这是完整的泄漏检查
输出:
==19704== Memcheck, a memory error detector
==19704== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19704== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==19704== Command: ./test
==19704==
==19704== Invalid read of size 8
==19704== at 0x40286C8: strncmp (strcmp.S:172)
==19704== by 0x400668D: is_dst (dl-load.c:216)
==19704== by 0x400810E: _dl_dst_count (dl-load.c:253)
==19704== by 0x400810E: expand_dynamic_string_token (dl-load.c:395)
==19704== by 0x40082B7: fillin_rpath.isra.0 (dl-load.c:483)
==19704== by 0x4008602: decompose_rpath (dl-load.c:654)
==19704== by 0x400ABF5: cache_rpath (dl-load.c:696)
==19704== by 0x400ABF5: cache_rpath (dl-load.c:677)
==19704== by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==19704== by 0x4003494: openaux (dl-deps.c:64)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==19704== by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x400DF99: dl_open_worker (dl-open.c:782)
==19704== Address 0x68ca699 is 9 bytes inside a block of size 15 alloc'd
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x40271FF: malloc (rtld-malloc.h:56)
==19704== by 0x40271FF: strdup (strdup.c:42)
==19704== by 0x4008594: decompose_rpath (dl-load.c:629)
==19704== by 0x400ABF5: cache_rpath (dl-load.c:696)
==19704== by 0x400ABF5: cache_rpath (dl-load.c:677)
==19704== by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==19704== by 0x4003494: openaux (dl-deps.c:64)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==19704== by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x400DF99: dl_open_worker (dl-open.c:782)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x400E34D: _dl_open (dl-open.c:883)
==19704==
==19704== Invalid read of size 8
==19704== at 0x40286C8: strncmp (strcmp.S:172)
==19704== by 0x400668D: is_dst (dl-load.c:216)
==19704== by 0x4007F79: _dl_dst_substitute (dl-load.c:295)
==19704== by 0x40082B7: fillin_rpath.isra.0 (dl-load.c:483)
==19704== by 0x4008602: decompose_rpath (dl-load.c:654)
==19704== by 0x400ABF5: cache_rpath (dl-load.c:696)
==19704== by 0x400ABF5: cache_rpath (dl-load.c:677)
==19704== by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==19704== by 0x4003494: openaux (dl-deps.c:64)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==19704== by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x400DF99: dl_open_worker (dl-open.c:782)
==19704== Address 0x68ca699 is 9 bytes inside a block of size 15 alloc'd
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x40271FF: malloc (rtld-malloc.h:56)
==19704== by 0x40271FF: strdup (strdup.c:42)
==19704== by 0x4008594: decompose_rpath (dl-load.c:629)
==19704== by 0x400ABF5: cache_rpath (dl-load.c:696)
==19704== by 0x400ABF5: cache_rpath (dl-load.c:677)
==19704== by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==19704== by 0x4003494: openaux (dl-deps.c:64)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==19704== by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x400DF99: dl_open_worker (dl-open.c:782)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x400E34D: _dl_open (dl-open.c:883)
==19704==
==19704==
==19704== HEAP SUMMARY:
==19704== in use at exit: 303,614 bytes in 3,333 blocks
==19704== total heap usage: 70,139 allocs, 66,806 frees, 12,517,934 bytes allocated
==19704==
==19704== 8 bytes in 1 blocks are definitely lost in loss record 5 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x59ADA59: ???
==19704== by 0x498615B: X11_InitKeyboard (SDL_x11keyboard.c:321)
==19704== by 0x498A97D: X11_VideoInit (SDL_x11video.c:470)
==19704== by 0x495E409: SDL_VideoInit_REAL (SDL_video.c:501)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704== by 0x10925E: main (hw.c:6)
==19704==
==19704== 32 bytes in 1 blocks are definitely lost in loss record 375 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x59986D3: ???
==19704== by 0x5993228: ???
==19704== by 0x5993BF0: ???
==19704== by 0x5970B2C: ???
==19704== by 0x5970D85: ???
==19704== by 0x4988590: GetXftDPI (SDL_x11modes.c:541)
==19704== by 0x4988590: X11_InitModes_StdXlib.isra.0 (SDL_x11modes.c:617)
==19704== by 0x498A965: X11_VideoInit (SDL_x11video.c:456)
==19704== by 0x495E409: SDL_VideoInit_REAL (SDL_video.c:501)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704== by 0x10925E: main (hw.c:6)
==19704==
==19704== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 376 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x59A94A7: ???
==19704== by 0x59A9562: ???
==19704== by 0x4986146: X11_InitKeyboard (SDL_x11keyboard.c:319)
==19704== by 0x498A97D: X11_VideoInit (SDL_x11video.c:470)
==19704== by 0x495E409: SDL_VideoInit_REAL (SDL_video.c:501)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704== by 0x10925E: main (hw.c:6)
==19704==
==19704== 40 bytes in 1 blocks are definitely lost in loss record 1,122 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x5975809: ???
==19704== by 0x4989DC4: X11_CreateDevice (SDL_x11video.c:165)
==19704== by 0x495E530: SDL_VideoInit_REAL (SDL_video.c:469)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704== by 0x10925E: main (hw.c:6)
==19704==
==19704== 40 bytes in 1 blocks are definitely lost in loss record 1,123 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x5975826: ???
==19704== by 0x4989DC4: X11_CreateDevice (SDL_x11video.c:165)
==19704== by 0x495E530: SDL_VideoInit_REAL (SDL_video.c:469)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704== by 0x10925E: main (hw.c:6)
==19704==
==19704== 40 bytes in 1 blocks are definitely lost in loss record 1,124 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x5975843: ???
==19704== by 0x4989DC4: X11_CreateDevice (SDL_x11video.c:165)
==19704== by 0x495E530: SDL_VideoInit_REAL (SDL_video.c:469)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704== by 0x10925E: main (hw.c:6)
==19704==
==19704== 48 (16 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 1,742 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x59A740D: ???
==19704== by 0x59A9470: ???
==19704== by 0x59A98AE: ???
==19704== by 0x5993884: ???
==19704== by 0x5993BC2: ???
==19704== by 0x5970B2C: ???
==19704== by 0x5970D85: ???
==19704== by 0x4988590: GetXftDPI (SDL_x11modes.c:541)
==19704== by 0x4988590: X11_InitModes_StdXlib.isra.0 (SDL_x11modes.c:617)
==19704== by 0x498A965: X11_VideoInit (SDL_x11video.c:456)
==19704== by 0x495E409: SDL_VideoInit_REAL (SDL_video.c:501)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704==
==19704== 64 bytes in 1 blocks are definitely lost in loss record 2,046 of 2,194
==19704== at 0x4849013: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x746A7DD: ???
==19704== by 0x6D02593: ???
==19704== by 0x400647D: call_init.part.0 (dl-init.c:70)
==19704== by 0x4006567: call_init (dl-init.c:33)
==19704== by 0x4006567: _dl_init (dl-init.c:117)
==19704== by 0x4BAEC84: _dl_catch_exception (dl-error-skeleton.c:182)
==19704== by 0x400DFF5: dl_open_worker (dl-open.c:808)
==19704== by 0x400DFF5: dl_open_worker (dl-open.c:771)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x400E34D: _dl_open (dl-open.c:883)
==19704== by 0x4ACA6BB: dlopen_doit (dlopen.c:56)
==19704== by 0x4BAEC27: _dl_catch_exception (dl-error-skeleton.c:208)
==19704== by 0x4BAECF2: _dl_catch_error (dl-error-skeleton.c:227)
==19704==
==19704== 80 (40 direct, 40 indirect) bytes in 1 blocks are definitely lost in loss record 2,135 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x599F7B2: ???
==19704== by 0x59A22DF: ???
==19704== by 0x59A20D6: ???
==19704== by 0x599C0EC: ???
==19704== by 0x59C16D9: ???
==19704== by 0x59A9495: ???
==19704== by 0x59A9562: ???
==19704== by 0x4986146: X11_InitKeyboard (SDL_x11keyboard.c:319)
==19704== by 0x498A97D: X11_VideoInit (SDL_x11video.c:470)
==19704== by 0x495E409: SDL_VideoInit_REAL (SDL_video.c:501)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704==
==19704== 1,203 (16 direct, 1,187 indirect) bytes in 1 blocks are definitely lost in loss record 2,171 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x599D429: ???
==19704== by 0x59A0C10: ???
==19704== by 0x59A20E2: ???
==19704== by 0x599C0EC: ???
==19704== by 0x59C16D9: ???
==19704== by 0x59A9495: ???
==19704== by 0x59A9562: ???
==19704== by 0x4986146: X11_InitKeyboard (SDL_x11keyboard.c:319)
==19704== by 0x498A97D: X11_VideoInit (SDL_x11video.c:470)
==19704== by 0x495E409: SDL_VideoInit_REAL (SDL_video.c:501)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704==
==19704== 2,048 bytes in 1 blocks are definitely lost in loss record 2,177 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x599F8B2: ???
==19704== by 0x59A22DF: ???
==19704== by 0x59A20D6: ???
==19704== by 0x599C0EC: ???
==19704== by 0x59C16D9: ???
==19704== by 0x59A9495: ???
==19704== by 0x59A98AE: ???
==19704== by 0x5993884: ???
==19704== by 0x5993BC2: ???
==19704== by 0x5970B2C: ???
==19704== by 0x5970D85: ???
==19704==
==19704== 4,096 bytes in 1 blocks are definitely lost in loss record 2,183 of 2,194
==19704== at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x597EE1A: ???
==19704== by 0x5992AB3: ???
==19704== by 0x5970B1B: ???
==19704== by 0x5970D85: ???
==19704== by 0x4988590: GetXftDPI (SDL_x11modes.c:541)
==19704== by 0x4988590: X11_InitModes_StdXlib.isra.0 (SDL_x11modes.c:617)
==19704== by 0x498A965: X11_VideoInit (SDL_x11video.c:456)
==19704== by 0x495E409: SDL_VideoInit_REAL (SDL_video.c:501)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704== by 0x10925E: main (hw.c:6)
==19704==
==19704== 5,348 bytes in 255 blocks are definitely lost in loss record 2,185 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x4AE260E: strdup (strdup.c:42)
==19704== by 0x653E741: ???
==19704== by 0x653E4E4: ???
==19704== by 0x64DE550: ???
==19704== by 0x6443E46: ???
==19704== by 0x6444C8A: ???
==19704== by 0x64C04BB: ???
==19704== by 0x4948A75: SDL_EGL_MakeCurrent (SDL_egl.c:1124)
==19704== by 0x4948A75: SDL_EGL_MakeCurrent (SDL_egl.c:1096)
==19704== by 0x4948CD5: SDL_EGL_CreateContext (SDL_egl.c:1056)
==19704== by 0x498979E: X11_GLES_CreateContext (SDL_x11opengles.c:100)
==19704== by 0x495C9B7: SDL_GL_CreateContext_REAL (SDL_video.c:4047)
==19704==
==19704== 7,616 (52 direct, 7,564 indirect) bytes in 1 blocks are definitely lost in loss record 2,186 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x599D65F: ???
==19704== by 0x599DA7F: ???
==19704== by 0x59A2196: ???
==19704== by 0x59A20D6: ???
==19704== by 0x599C0EC: ???
==19704== by 0x59C16D9: ???
==19704== by 0x59A9495: ???
==19704== by 0x59A98AE: ???
==19704== by 0x5993884: ???
==19704== by 0x5993BC2: ???
==19704== by 0x5970B2C: ???
==19704==
==19704== 16,416 (64 direct, 16,352 indirect) bytes in 1 blocks are definitely lost in loss record 2,191 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x597EFB6: ???
==19704== by 0x5992AB3: ???
==19704== by 0x5970B1B: ???
==19704== by 0x5970D85: ???
==19704== by 0x4988590: GetXftDPI (SDL_x11modes.c:541)
==19704== by 0x4988590: X11_InitModes_StdXlib.isra.0 (SDL_x11modes.c:617)
==19704== by 0x498A965: X11_VideoInit (SDL_x11video.c:456)
==19704== by 0x495E409: SDL_VideoInit_REAL (SDL_video.c:501)
==19704== by 0x487DEAE: SDL_InitSubSystem_REAL.part.0 (SDL.c:251)
==19704== by 0x10925E: main (hw.c:6)
==19704==
==19704== 19,021 (64 direct, 18,957 indirect) bytes in 1 blocks are definitely lost in loss record 2,192 of 2,194
==19704== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==19704== by 0x599D9A6: ???
==19704== by 0x59A8B6B: ???
==19704== by 0x59C0A15: ???
==19704== by 0x59A9495: ???
==19704== by 0x59A98AE: ???
==19704== by 0x5993884: ???
==19704== by 0x5993BC2: ???
==19704== by 0x5970B2C: ???
==19704== by 0x5970D85: ???
==19704== by 0x4988590: GetXftDPI (SDL_x11modes.c:541)
==19704== by 0x4988590: X11_InitModes_StdXlib.isra.0 (SDL_x11modes.c:617)
==19704== by 0x498A965: X11_VideoInit (SDL_x11video.c:456)
==19704==
==19704== LEAK SUMMARY:
==19704== definitely lost: 11,984 bytes in 270 blocks
==19704== indirectly lost: 44,148 bytes in 923 blocks
==19704== possibly lost: 0 bytes in 0 blocks
==19704== still reachable: 247,482 bytes in 2,140 blocks
==19704== suppressed: 0 bytes in 0 blocks
==19704== Reachable blocks (those to which a pointer was found) are not shown.
==19704== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==19704==
==19704== For lists of detected and suppressed errors, rerun with: -s
==19704== ERROR SUMMARY: 18 errors from 18 contexts (suppressed: 0 from 0)
最佳答案
@John Bollinger 给了你正确的答案。
这已在 this 中修复提交。
您需要从源代码构建 Valgrind(按照说明 here )。
或者 3.20 将在几周后发布(目标是 2022 年 10 月 22 日)。
我无法对泄密事件发表评论。任何库的调试版本都会给你“???”在调用堆栈中会有帮助。
关于c - 如何在使用 SDL2 的程序中查找 valgrind 检测到的内存错误的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73900136/
我在网上搜索但没有找到任何合适的文章解释如何使用 javascript 使用 WCF 服务,尤其是 WebScriptEndpoint。 任何人都可以对此给出任何指导吗? 谢谢 最佳答案 这是一篇关于
我正在编写一个将运行 Linux 命令的 C 程序,例如: cat/etc/passwd | grep 列表 |剪切-c 1-5 我没有任何结果 *这里 parent 等待第一个 child (chi
所以我正在尝试处理文件上传,然后将该文件作为二进制文件存储到数据库中。在我存储它之后,我尝试在给定的 URL 上提供文件。我似乎找不到适合这里的方法。我需要使用数据库,因为我使用 Google 应用引
我正在尝试制作一个宏,将下面的公式添加到单元格中,然后将其拖到整个列中并在 H 列中复制相同的公式 我想在 F 和 H 列中输入公式的数据 Range("F1").formula = "=IF(ISE
问题类似于this one ,但我想使用 OperatorPrecedenceParser 解析带有函数应用程序的表达式在 FParsec . 这是我的 AST: type Expression =
我想通过使用 sequelize 和 node.js 将这个查询更改为代码取决于在哪里 select COUNT(gender) as genderCount from customers where
我正在使用GNU bash,版本5.0.3(1)-发行版(x86_64-pc-linux-gnu),我想知道为什么简单的赋值语句会出现语法错误: #/bin/bash var1=/tmp
这里,为什么我的代码在 IE 中不起作用。我的代码适用于所有浏览器。没有问题。但是当我在 IE 上运行我的项目时,它发现错误。 而且我的 jquery 类和 insertadjacentHTMl 也不
我正在尝试更改标签的innerHTML。我无权访问该表单,因此无法编辑 HTML。标签具有的唯一标识符是“for”属性。 这是输入和标签的结构:
我有一个页面,我可以在其中返回用户帖子,可以使用一些 jquery 代码对这些帖子进行即时评论,在发布新评论后,我在帖子下插入新评论以及删除 按钮。问题是 Delete 按钮在新插入的元素上不起作用,
我有一个大约有 20 列的“管道分隔”文件。我只想使用 sha1sum 散列第一列,它是一个数字,如帐号,并按原样返回其余列。 使用 awk 或 sed 执行此操作的最佳方法是什么? Accounti
我需要将以下内容插入到我的表中...我的用户表有五列 id、用户名、密码、名称、条目。 (我还没有提交任何东西到条目中,我稍后会使用 php 来做)但由于某种原因我不断收到这个错误:#1054 - U
所以我试图有一个输入字段,我可以在其中输入任何字符,但然后将输入的值小写,删除任何非字母数字字符,留下“。”而不是空格。 例如,如果我输入: 地球的 70% 是水,-!*#$^^ & 30% 土地 输
我正在尝试做一些我认为非常简单的事情,但出于某种原因我没有得到想要的结果?我是 javascript 的新手,但对 java 有经验,所以我相信我没有使用某种正确的规则。 这是一个获取输入值、检查选择
我想使用 angularjs 从 mysql 数据库加载数据。 这就是应用程序的工作原理;用户登录,他们的用户名存储在 cookie 中。该用户名显示在主页上 我想获取这个值并通过 angularjs
我正在使用 autoLayout,我想在 UITableViewCell 上放置一个 UIlabel,它应该始终位于单元格的右侧和右侧的中心。 这就是我想要实现的目标 所以在这里你可以看到我正在谈论的
我需要与 MySql 等效的 elasticsearch 查询。我的 sql 查询: SELECT DISTINCT t.product_id AS id FROM tbl_sup_price t
我正在实现代码以使用 JSON。 func setup() { if let flickrURL = NSURL(string: "https://api.flickr.com/
我尝试使用for循环声明变量,然后测试cols和rols是否相同。如果是,它将运行递归函数。但是,我在 javascript 中执行 do 时遇到问题。有人可以帮忙吗? 现在,在比较 col.1 和
我举了一个我正在处理的问题的简短示例。 HTML代码: 1 2 3 CSS 代码: .BB a:hover{ color: #000; } .BB > li:after {
我是一名优秀的程序员,十分优秀!