~mil/mepo-tickets#81: 
Crash at zoom level 17

From ML: https://lists.sr.ht/~mil/mepo-devel/%3CD4DN7EUBWN1O.193BD9PV10FG@gnzler.io%3E

JSON config (use with cat cfg.json | mepo -i): https://paste.sr.ht/~robertgzr/32e5e50df45a3d27172f344321bd33d3bcdbf711

Crash log:

thread 20380 panic: integer cast truncated bits
/home/m/mepo/src/blit/blit.zig:391:13: 0x10d89d0 in blit_pin (mepo)
            @intCast(pin_target_x),
            ^
/home/m/mepo/src/blit/blit.zig:230:33: 0x10da3dc in blit_tile_pinlayer (mepo)
                    try blit_pin(mepo, pin, if (prev_pin != null) prev_pin else null, @intCast(pin_group_i), is_active_path, .{ .x = tile_x, .y = tile_y, .z =
zoom });
                                ^
/home/m/mepo/src/blit/blit.zig:51:39: 0x10dae54 in blit_tiles_all (mepo)
                try blit_tile_pinlayer(mepo, tilex_int, tiley_int, zoom, vpx, vpy, bbox);
                                      ^
/home/m/mepo/src/blit/blit.zig:847:23: 0x10e69d6 in blit (mepo)
    try blit_tiles_all(
                      ^
/home/m/mepo/src/Mepo.zig:741:24: 0x10e7674 in blit (mepo)
    return blitfns.blit(mepo);
                       ^
/home/m/mepo/src/Mepo.zig:511:26: 0x10e7c8d in sdl_event_loop (mepo)
            try mepo.blit();
                         ^
/home/m/mepo/src/Mepo.zig:498:19: 0x1093cb1 in mepo_sdl_loop_thread_boot (mepo)
    sdl_event_loop(mepo) catch unreachable;
                  ^
???:?:?: 0x7f6ca01c127e in ??? (libSDL2-2.0.so.0)
Unwind information for `libSDL2-2.0.so.0:0x7f6ca01c127e` was not available, trace may be incomplete

Need to re-examine logic & casts within blit_pin function. Using @truncate instead of @intCast in call to sdl.aalineColor resolves the immediate crash but there maybe more cleanup to do as well. Using @truncate instead of @intCast for

Status
REPORTED
Submitter
~mil
Assigned to
No-one
Submitted
4 months ago
Updated
4 months ago
Labels
bug