Hejsil / zig-nuklear

MIT License
10 stars 3 forks source link

double free or corruption (!prev) #5

Closed sukoi26 closed 2 years ago

sukoi26 commented 2 years ago

Th+ for last commit who solve the leave but still the concern about the resize of the layout received this message i check Nuklear demo with GLFW3 without concern

==13199== Invalid write of size 2 ==13199== at 0x48469E3: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:1118) ==13199== by 0x21CE64: zigNuklearMemcopy (export.zig:48) ==13199== by 0x27C2FC: nk_draw_vertex_color (nuklear.h:0) ==13199== by 0x27C2FC: nk_draw_vertex (nuklear.h:9649) ==13199== by 0x27EF4D: nk_draw_list_push_rect_uv (nuklear.h:10347) ==13199== by 0x27F2C2: nk_draw_list_add_text (nuklear.h:10410) ==13199== by 0x280611: nk_convert (nuklear.h:10543) ==13199== by 0x227DAC: .nuklear.src.vertex.convert (vertex.zig:14) ==13199== by 0x21BE0B: render (main.zig:215) ==13199== by 0x21928C: main.0 (main.zig:69) ==13199== by 0x230477: std.start.callMain (start.zig:574) ==13199== by 0x21C7E7: std.start.initEventLoopAndCallMain (start.zig:508) ==13199== by 0x21C7E7: std.start.callMainWithArgs (start.zig:458) ==13199== by 0x21C592: main (start.zig:473) ==13199== Address 0x90c0d18 is 0 bytes after a block of size 65,544 alloc'd ==13199== at 0x4844990: memalign (vg_replace_malloc.c:1516) ==13199== by 0x4844AEE: posix_memalign (vg_replace_malloc.c:1688) ==13199== by 0x225F63: std.heap.CAllocator.alignedAlloc (heap.zig:62) ==13199== by 0x21421B: std.heap.CAllocator.alloc (heap.zig:110) ==13199== by 0x254FCF: std.mem.Allocator.rawAlloc (Allocator.zig:167) ==13199== by 0x254FCF: std.mem.Allocator.allocAdvancedWithRetAddr.176 (Allocator.zig:314) ==13199== by 0x24ADA9: std.mem.Allocator.allocAdvanced (Allocator.zig:282) ==13199== by 0x22F36E: .nuklear.heap.alloc (nuklear.zig:594) ==13199== by 0x274D81: nk_buffer_realloc (nuklear.h:8169) ==13199== by 0x274D81: nk_buffer_alloc (nuklear.h:8231) ==13199== by 0x27C595: nk_draw_list_fill_poly_convex (nuklear.h:9942) ==13199== by 0x27DB39: nk_draw_list_path_fill (nuklear.h:10164) ==13199== by 0x27DEFA: nk_draw_list_fill_rect (nuklear.h:10207) ==13199== by 0x27FA3D: nk_convert (nuklear.h:10469)

Hejsil commented 2 years ago

I did not manage to reproduce this problem, but I did find that I was not calling glfwTerminate on exit. Fixed in 784b252e8272896b69bd2326f9842f29bcf469ac. Could you post more info in how you hit this? Full valgrind command. Things you did with the ui.

sukoi26 commented 2 years ago

i pull the commit , for me i unusual to call the last line code at the beginning of main . "Defer is used to execute a statement while exiting the current block."

if i resize the window no bug if i move the layout name "showcase" no bug if i shrink the layout "showcase" by moving the triangle no bug the error occur when i extend the layout "showcase" by moving the triangle. But it looks random either doing it slow or fast. in fast it happens immediately.

under valgrind no corruption occur

dvp/zig-nuklear$ valgrind --leak-check=full --track-origins=yes zig-out/bin/examples ==14678== Memcheck, a memory error detector ==14678== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==14678== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info ==14678== Command: zig-out/bin/examples ==14678== ==14678== Invalid write of size 2 ==14678== at 0x48469E3: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:1118) ==14678== by 0x21CED4: zigNuklearMemcopy (export.zig:48) ==14678== by 0x27C36C: nk_draw_vertex_color (nuklear.h:0) ==14678== by 0x27C36C: nk_draw_vertex (nuklear.h:9649) ==14678== by 0x27EFBD: nk_draw_list_push_rect_uv (nuklear.h:10347) ==14678== by 0x27F332: nk_draw_list_add_text (nuklear.h:10410) ==14678== by 0x280681: nk_convert (nuklear.h:10543) ==14678== by 0x227E1C: .nuklear.src.vertex.convert (vertex.zig:14) ==14678== by 0x21BE7B: render (main.zig:216) ==14678== by 0x2192F6: main.0 (main.zig:70) ==14678== by 0x2304E7: std.start.callMain (start.zig:574) ==14678== by 0x21C857: std.start.initEventLoopAndCallMain (start.zig:508) ==14678== by 0x21C857: std.start.callMainWithArgs (start.zig:458) ==14678== by 0x21C602: main (start.zig:473) ==14678== Address 0x9096558 is 0 bytes after a block of size 65,544 alloc'd ==14678== at 0x4844990: memalign (vg_replace_malloc.c:1516) ==14678== by 0x4844AEE: posix_memalign (vg_replace_malloc.c:1688) ==14678== by 0x225FD3: std.heap.CAllocator.alignedAlloc (heap.zig:62) ==14678== by 0x21427B: std.heap.CAllocator.alloc (heap.zig:110) ==14678== by 0x25503F: std.mem.Allocator.rawAlloc (Allocator.zig:167) ==14678== by 0x25503F: std.mem.Allocator.allocAdvancedWithRetAddr.176 (Allocator.zig:314) ==14678== by 0x24AE19: std.mem.Allocator.allocAdvanced (Allocator.zig:282) ==14678== by 0x22F3DE: .nuklear.heap.alloc (nuklear.zig:594) ==14678== by 0x274DF1: nk_buffer_realloc (nuklear.h:8169) ==14678== by 0x274DF1: nk_buffer_alloc (nuklear.h:8231) ==14678== by 0x27C605: nk_draw_list_fill_poly_convex (nuklear.h:9942) ==14678== by 0x27DBA9: nk_draw_list_path_fill (nuklear.h:10164) ==14678== by 0x27DF6A: nk_draw_list_fill_rect (nuklear.h:10207) ==14678== by 0x27FAAD: nk_convert (nuklear.h:10469) ==14678== ==14678== Conditional jump or move depends on uninitialised value(s) ==14678== at 0x5D0E535: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x7348CDD: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7320997: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x73237F7: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x5D0C9E9: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D0D19E: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5DA8008: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x4AE1F76: __run_exit_handlers (exit.c:108) ==14678== by 0x4AE2119: exit (exit.c:139) ==14678== by 0x4ACA803: (below main) (libc-start.c:366) ==14678== Uninitialised value was created by a heap allocation ==14678== at 0x483F7B5: malloc (vg_replace_malloc.c:381) ==14678== by 0x7281E44: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x5D0E349: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x73215ED: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7321F03: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x731653E: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7269354: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x5D0F1C2: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D4A8AA: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x4D6A7E2: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0) ==14678== by 0x4D6B144: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0) ==14678== by 0x4D6C3CF: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0) ==14678== ==14678== ==14678== HEAP SUMMARY: ==14678== in use at exit: 217,595 bytes in 1,656 blocks ==14678== total heap usage: 15,768 allocs, 14,112 frees, 270,269,653 bytes allocated ==14678== ==14678== 128 bytes in 1 blocks are definitely lost in loss record 372 of 485 ==14678== at 0x48445EF: calloc (vg_replace_malloc.c:1328) ==14678== by 0x72822AB: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7277849: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x72762CE: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7286458: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x5D0CC68: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D72C45: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D0C1DA: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== ==14678== 589 (128 direct, 461 indirect) bytes in 1 blocks are definitely lost in loss record 404 of 485 ==14678== at 0x48445EF: calloc (vg_replace_malloc.c:1328) ==14678== by 0x72822AB: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7277849: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x72747F8: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7275E7C: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7286422: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x5D0CC68: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D72C45: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D0C1DA: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== ==14678== 27,443 (6,024 direct, 21,419 indirect) bytes in 1 blocks are definitely lost in loss record 483 of 485 ==14678== at 0x48445EF: calloc (vg_replace_malloc.c:1328) ==14678== by 0x72822AB: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7279285: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x72747E0: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7275E7C: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7286422: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x5D0CC68: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D72C45: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D0C1DA: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== ==14678== 122,447 (896 direct, 121,551 indirect) bytes in 1 blocks are definitely lost in loss record 485 of 485 ==14678== at 0x484482F: realloc (vg_replace_malloc.c:1437) ==14678== by 0x7281552: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x72778E0: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7274F4E: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x7287168: ??? (in /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.86) ==14678== by 0x5D0CC68: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D72C45: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== by 0x5D0C1DA: ??? (in /usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.470.86) ==14678== ==14678== LEAK SUMMARY: ==14678== definitely lost: 7,176 bytes in 4 blocks ==14678== indirectly lost: 143,431 bytes in 792 blocks ==14678== possibly lost: 0 bytes in 0 blocks ==14678== still reachable: 66,988 bytes in 860 blocks ==14678== suppressed: 0 bytes in 0 blocks ==14678== Reachable blocks (those to which a pointer was found) are not shown. ==14678== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==14678== ==14678== For lists of detected and suppressed errors, rerun with: -s ==14678== ERROR SUMMARY: 7 errors from 6 contexts (suppressed: 0 from 0)

sukoi26 commented 2 years ago

with GDB Starting program: dvp/zig-nuklear/zig-out/bin/examples [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". double free or corruption (!prev)

Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49 49 ../sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type. (gdb) bt

0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49

1 0x00007ffff7bb9546 in __GI_abort () at abort.c:79

2 0x00007ffff7c10eb8 in __libc_message (action=action@entry=do_abort,

fmt=fmt@entry=0x7ffff7d2ea78 "%s\n") at ../sysdeps/posix/libc_fatal.c:155

3 0x00007ffff7c1891a in malloc_printerr (

str=str@entry=0x7ffff7d30fa0 "double free or corruption (!prev)") at malloc.c:5628

4 0x00007ffff7c1a1ac in _int_free (av=0x7ffff7d65ba0 , p=0x7b82d0,

have_lock=<optimized out>) at malloc.c:4550

5 0x00007ffff7c1d9b4 in __GI___libc_free (mem=) at malloc.c:3309

6 0x0000000000226225 in std.heap.CAllocator.alignedFree (

ptr=0x7b82e0 '\252' <repeats 200 times>...) at dvp/zig/lib/std/heap.zig:82

7 0x00000000002144a1 in std.heap.CAllocator.free (_=0x0, buf=..., buf_align=1,

return_address=2291193) at dvp/zig/lib/std/heap.zig:155

8 0x00000000002472cb in std.mem.Allocator.rawFree (buf=..., buf_align=1, ret_addr=2291193,

self=...) at dvp/zig/lib/std/mem/Allocator.zig:177

9 std.mem.Allocator.free (self=..., memory=...)

at dvp/zig/lib/std/mem/Allocator.zig:505

10 0x000000000022f5f9 in .nuklear.heap.free (handle=..., m_old=0x7b82e8)

at dvp/zig-nuklear/nuklear.zig:613

11 0x0000000000274e3d in nk_buffer_realloc (b=0x7fffffff7a00, capacity=131072,

size=0x7fffffff7a48) at src/c/nuklear/nuklear.h:8176

12 nk_buffer_alloc (b=0x7fffffff7a00, type=type@entry=NK_BUFFER_FRONT, size=80,

align=<optimized out>) at src/c/nuklear/nuklear.h:8231

13 0x000000000027bbc7 in nk_draw_list_alloc_vertices (list=list@entry=0x7fffffffc390,

count=count@entry=4) at src/c/nuklear/nuklear.h:9464

14 0x000000000027edcc in nk_draw_list_push_rect_uv (list=list@entry=0x7fffffffc390, a=..., c=...,

uva=..., uvc=..., color=...) at src/c/nuklear/nuklear.h:10336

15 0x000000000027f333 in nk_draw_list_add_text (list=list@entry=0x7fffffffc390,

font=<optimized out>, rect=..., text=..., font_height=13, fg=...)
at src/c/nuklear/nuklear.h:10410

16 0x0000000000280682 in nk_convert (ctx=0x7fffffff7af8, cmds=0x7fffffff7988,

vertices=0x7fffffff7a00, elements=0x7fffffff7a78, config=<optimized out>)
at src/c/nuklear/nuklear.h:10543

17 0x0000000000227e1d in .nuklear.src.vertex.convert (ctx=0x7fffffff7af8, cmds=0x7fffffff7988,

vertices=0x7fffffff7a00, elements=0x7fffffff7a78, 
config=<error reading variable: Cannot access memory at address 0x0>)
at dvp/zig-nuklear/src/vertex.zig:14

18 0x000000000021be7c in render (program=0x7fffffff7960) at main.zig:216

--Type for more, q to quit, c to continue without paging--

19 0x00000000002192f7 in main () at main.zig:70

20 0x00000000002304e8 in std.start.callMain () at dvp/zig/lib/std/start.zig:574

21 0x000000000021c858 in std.start.initEventLoopAndCallMain ()

at dvp/zig/lib/std/start.zig:508

22 std.start.callMainWithArgs (argc=1, argv=0x7fffffffe148, envp=...)

at dvp/zig/lib/std/start.zig:458

23 0x000000000021c603 in std.start.main (c_argc=1, c_argv=0x7fffffffe148, c_envp=0x7fffffffe158)

at dvp/zig/lib/std/start.zig:473
sukoi26 commented 2 years ago

if i build with Drelease-safe , it bugs :

thread 23363 panic: reached unreachable code Abandon

==23364== Conditional jump or move depends on uninitialised value(s) ==23364== at 0x213942: std.debug.assert (debug.zig:234) ==23364== by 0x213942: zigNuklearAssert (export.zig:11) ==23364== by 0x258B8B: nk_begin_titled (nuklear.h:19967) ==23364== by 0x2110F9: .nuklear.src.window.begin (window.zig:14) ==23364== by 0x2110F9: examples.showcase (examples.zig:25) ==23364== by 0x2110F9: main.0 (main.zig:69) ==23364== by 0x213802: std.start.callMain (start.zig:574) ==23364== by 0x213802: std.start.initEventLoopAndCallMain (start.zig:508) ==23364== by 0x213802: std.start.callMainWithArgs (start.zig:458) ==23364== by 0x213802: main (start.zig:473) ==23364== thread 23364 panic: reached unreachable code ==23364== Syscall param msync(start) points to uninitialised byte(s) ==23364== at 0x4A95743: msync (msync.c:25) ==23364== by 0x22A5B5: std.debug.StackIterator.next_internal (os.zig:4422) ==23364== by 0x22FD74: std.debug.StackIterator.next (debug.zig:415) ==23364== by 0x22FD74: std.debug.writeCurrentStackTrace (debug.zig:512) ==23364== by 0x22FD74: std.debug.dumpCurrentStackTrace (debug.zig:125) ==23364== by 0x22FD74: std.debug.panicImpl (debug.zig:311) ==23364== by 0x22F6C5: std.builtin.default_panic (builtin.zig:831) ==23364== by 0x213953: std.debug.assert (debug.zig:234) ==23364== by 0x213953: zigNuklearAssert (export.zig:11) ==23364== by 0x258B8B: nk_begin_titled (nuklear.h:19967) ==23364== by 0x2110F9: .nuklear.src.window.begin (window.zig:14) ==23364== by 0x2110F9: examples.showcase (examples.zig:25) ==23364== by 0x2110F9: main.0 (main.zig:69) ==23364== by 0x213802: std.start.callMain (start.zig:574) ==23364== by 0x213802: std.start.initEventLoopAndCallMain (start.zig:508) ==23364== by 0x213802: std.start.callMainWithArgs (start.zig:458) ==23364== by 0x213802: main (start.zig:473) ==23364== Address 0x1ffeff3000 is on thread 1's stack ==23364== in frame #1, created by std.debug.StackIterator.next_internal (os.zig:471) ==23364== ==23364== Conditional jump or move depends on uninitialised value(s) ==23364== at 0x22A5E9: std.debug.StackIterator.next_internal (debug.zig:488) ==23364== by 0x22FD74: std.debug.StackIterator.next (debug.zig:415) ==23364== by 0x22FD74: std.debug.writeCurrentStackTrace (debug.zig:512) ==23364== by 0x22FD74: std.debug.dumpCurrentStackTrace (debug.zig:125) ==23364== by 0x22FD74: std.debug.panicImpl (debug.zig:311) ==23364== by 0x22F6C5: std.builtin.default_panic (builtin.zig:831) ==23364== by 0x213953: std.debug.assert (debug.zig:234) ==23364== by 0x213953: zigNuklearAssert (export.zig:11) ==23364== by 0x258B8B: nk_begin_titled (nuklear.h:19967) ==23364== by 0x2110F9: .nuklear.src.window.begin (window.zig:14) ==23364== by 0x2110F9: examples.showcase (examples.zig:25) ==23364== by 0x2110F9: main.0 (main.zig:69) ==23364== by 0x213802: std.start.callMain (start.zig:574) ==23364== by 0x213802: std.start.initEventLoopAndCallMain (start.zig:508) ==23364== by 0x213802: std.start.callMainWithArgs (start.zig:458) ==23364== by 0x213802: main (start.zig:473) ==23364== ==23364== Conditional jump or move depends on uninitialised value(s) ==23364== at 0x22A563: std.debug.StackIterator.next_internal (debug.zig:479) ==23364== by 0x22FDAA: std.debug.StackIterator.next (debug.zig:419) ==23364== by 0x22FDAA: std.debug.writeCurrentStackTrace (debug.zig:512) ==23364== by 0x22FDAA: std.debug.dumpCurrentStackTrace (debug.zig:125) ==23364== by 0x22FDAA: std.debug.panicImpl (debug.zig:311) ==23364== by 0x22F6C5: std.builtin.default_panic (builtin.zig:831) ==23364== by 0x213953: std.debug.assert (debug.zig:234) ==23364== by 0x213953: zigNuklearAssert (export.zig:11) ==23364== by 0x258B8B: nk_begin_titled (nuklear.h:19967) ==23364== by 0x2110F9: .nuklear.src.window.begin (window.zig:14) ==23364== by 0x2110F9: examples.showcase (examples.zig:25) ==23364== by 0x2110F9: main.0 (main.zig:69) ==23364== by 0x213802: std.start.callMain (start.zig:574) ==23364== by 0x213802: std.start.initEventLoopAndCallMain (start.zig:508) ==23364== by 0x213802: std.start.callMainWithArgs (start.zig:458) ==23364== by 0x213802: main (start.zig:473) ==23364== ==23364== ==23364== Process terminating with default action of signal 6 (SIGABRT) ==23364== at 0x4ADF8A1: raise (raise.c:50) ==23364== by 0x4AC9545: abort (abort.c:79) ==23364== by 0x22FFC5: std.os.abort (os.zig:471) ==23364== by 0x22FE26: std.debug.panicImpl (debug.zig:338) ==23364== by 0x22F6C5: std.builtin.default_panic (builtin.zig:831) ==23364== by 0x213953: std.debug.assert (debug.zig:234) ==23364== by 0x213953: zigNuklearAssert (export.zig:11) ==23364== by 0x258B8B: nk_begin_titled (nuklear.h:19967) ==23364== by 0x2110F9: .nuklear.src.window.begin (window.zig:14) ==23364== by 0x2110F9: examples.showcase (examples.zig:25) ==23364== by 0x2110F9: main.0 (main.zig:69) ==23364== by 0x213802: std.start.callMain (start.zig:574) ==23364== by 0x213802: std.start.initEventLoopAndCallMain (start.zig:508) ==23364== by 0x213802: std.start.callMainWithArgs (start.zig:458) ==23364== by 0x213802: main (start.zig:473) ==23364== ==23364== HEAP SUMMARY: ==23364== in use at exit: 5,156,004 bytes in 4,869 blocks ==23364== total heap usage: 9,314 allocs, 4,445 frees, 384,210,966 bytes allocated ==23364== ==23364== LEAK SUMMARY: ==23364== definitely lost: 7,176 bytes in 4 blocks ==23364== indirectly lost: 143,431 bytes in 792 blocks ==23364== possibly lost: 594,104 bytes in 26 blocks ==23364== still reachable: 4,411,293 bytes in 4,047 blocks ==23364== of which reachable via heuristic: ==23364== length64 : 68,640 bytes in 8 blocks ==23364== newarray : 16 bytes in 1 blocks ==23364== multipleinheritance: 104 bytes in 1 blocks ==23364== suppressed: 0 bytes in 0 blocks ==23364== Rerun with --leak-check=full to see details of leaked memory ==23364== ==23364== Use --track-origins=yes to see where uninitialised values come from ==23364== For lists of detected and suppressed errors, rerun with: -s ==23364== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0) Abandon

sukoi26 commented 2 years ago

i patch this line 8230 in nuklear.h to add +1 to increase on byte, solve but i dont understand the reason. capacity = NK_MAX(capacity, nk_round_up_pow2((nk_uint)(b->allocated + size)))+1;

sukoi26 commented 2 years ago

i close, with the zig master 0.10.0-dev.3079+5dd59a542 i am not able to reproduce .