dMZX Forums: Segfault attempting to load_robot from an unset string. -> Archived MegaZeux Bugs -> Tracker

Jump to content

Report ID 720 Title Segfault attempting to load_robot from an unset string.
Product Archived MegaZeux Bugs Status Fixed (Severity 5 - Critical)
Version 2.91e Fixed in 2.91f
Introduced In Version 2.90Operating System Windows 10 x64

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #720: Segfault attempting to load_robot from an unset string.

#1 User is offline  
GetDizzy 

  • Touch Fuzzy.
  • Group: DigiStaff
  • Posts: 3,576
  • Joined: 22-November 01
  • Gender:Other
  • Location:MA

Posted 08 September 2018 - 03:02 PM

When attempting to load_robot from an unset string (as in, specifically a string that has never been set before, not a string set to ""), megazeux reliably immediately segfaults. Code to reproduce and a bt full are below.


set "$idontexist" to "load_robot"





(gdb) bt full
#0  0x00000000619401bf in set_string (mzx_world=0x411520 <mzx_world>,
    name=0x6bd200 "$idontexist", src=0x6bcfa0, id=1) at src/str.c:1045
        new_program = 0x7ffed308b1f5 <ig9icd64!DrvRealizeLayerPalette+370533> "L\215▒$P\r"
        new_size = 0
        offset_specified = false
        size_specified = false
        offset = 0
        size = 0
        input_offset = 0
        src_length = 10
        src_value = 0x6bd000 "load_robot"
        dest = 0x0
        next = 0
        error = false
#1  0x000000006192be6d in run_robot (mzx_world=0x411520 <mzx_world>, id=1,
    x=1, y=0) at src/run_robot.c:1380
        dest = {sh = {tbl = 0x0, prev = 0x0, next = 0x0, hh_prev = 0x0,
            hh_next = 0x0, key = 0x0, keylen = 0, hashv = 0}, list_ind = 0,
          length = 10, allocated_length = 0, value = 0x6bd000 "load_robot",
          name = ""}
        dest_string = 0x724054 "$idontexist"
        src_string = 0x724060 "\vload_robot"
        src_buffer = "load_robot", '\000' <repeats 111 times>, "c▒\v", '\000' <repeats 28 times>, "PB▒\v", '\000' <repeats 116 times>...
        dest_buffer = "$idontexist", '\000' <repeats 205 times>...
        src_board = 0x720b50
        cur_robot = 0x723e60
        cmd = 10
        lines_run = 0
        gotoed = 0
        old_pos = 1
        last_label = -1
        _bl = {1, 0, 0, 1}
        program = 0x724050 "▒\032\n\f$idontexist"
        cmd_ptr = 0x724052 "\n\f$idontexist"
        done = 0 '\000'
        update_blocked = 0 '\000'
        first_cmd = 1 '\001'
        level_id = 0x7216e0 "\177|"
        level_param = 0x730510 ""
        level_color = 0x732c50 '\a' <repeats 200 times>...
        level_under_id = 0x735390 ""
        board_width = 100
        board_height = 100
#2  0x00000000618d4942 in update_board (mzx_world=0x411520 <mzx_world>)
    at src/game2.c:250
        i = 1
        x = 1
        y = 0
        level_offset = 1
        src_board = 0x720b50
        cur_robot = 0x723e60
        level_id = 0x7216e0 "\177|"
        level_param = 0x730510 ""
        level_color = 0x732c50 '\a' <repeats 200 times>...
        level_under_id = 0x735390 ""
        level_under_color = 0x73a210 '\a' <repeats 200 times>...
        board_width = 100
        board_height = 100
        slow_down = 1
        current_id = ROBOT
        current_param = 1 '\001'
        current_color = 0 '\000'
        current_under_id = SPACE
        update_done = 0x725da0 ""
#3  0x00000000618dc3a3 in update (mzx_world=0x411520 <mzx_world>, game=1,
    fadein=0x6be944) at src/game.c:1621
        entrance = 1
        d_offset = 0
        start_ticks = 21628
        time_remaining = 0
        reload = 0
        slowed = 0
        tmp_str = "\000\000\000\000\000\000\000\000\000"
        src_board = 0x720b50
        volume = 255
        volume_inc = 0
        volume_target = 255
        board_width = 100
        board_height = 100
        level_id = 0x7216e0 "\177|"
        level_color = 0x732c50 '\a' <repeats 200 times>...
        level_under_id = 0x735390 ""
        level_under_color = 0x73a210 '\a' <repeats 200 times>...
        level_under_param = 0x737ad0 ""
        total_ticks = 0
#4  0x00000000618ddbd9 in play_game (mzx_world=0x411520 <mzx_world>)
    at src/game.c:2267
        exit = 0
        confirm_exit = 0
        key = -1
        key_status = 0
        keylbl = "KEY?"
        src_board = 0x100000000
        fadein = 1
        conf = 0x412e88 <mzx_world+6504>
#5  0x000000007041b1fb in __edit_world (mzx_world=0x411520 <mzx_world>,
    reload_curr_file=1) at src/editor/edit.c:4137
        world_version = 603
        return_dir = 0x740650 "C:\\megazeux\\debug"
        fade = 0
        current_board_id = 0
        src_board = 0x720b50
        copy_robot = {world_version = 603, program_source_length = 0,
          program_source = 0x0, program_bytecode_length = 30,
          program_bytecode = 0x740600 "▒\032\n\f$idontexist",
          robot_name = '\000' <repeats 14 times>, robot_char = 2 '\002',
          cur_prog_line = 1, pos_within_line = 0, robot_cycle = 0,
          cycle_count = 0, bullet_type = 1 '\001', is_locked = 0 '\000',
          can_lavawalk = 0 '\000', can_goopwalk = 0 '\000', walk_dir = IDLE,
          last_touch_dir = IDLE, last_shot_dir = IDLE, xpos = 1, ypos = 0,
          status = 0 '\000', used = 1 '\001', loop_count = 0, num_labels = 0,
          label_list = 0x0, stack_size = 0, stack_pointer = 0, stack = 0x0,
          local = {0 <repeats 32 times>}, command_map = 0x0,
          command_map_length = 0, commands_total = 0, commands_cycle = 0,
          commands_caught = -1163005939}
        copy_scroll = {num_lines = 0,
          mesg = 0x7fff00000001 <error: Cannot access memory at address 0x7fff00000001>, mesg_size = 0, used = 0 '\000'}
        copy_sensor = {
          sensor_name = "v\a1\000\000\000\000\000\002\001\000\000\000\000",
          sensor_char = 0 '\000',
          robot_to_mesg = "e\000\000\000\000\000\000\000\001\000\022\000\000\000", used = 0 '\000'}
        i = 0
        key = 116
        fade = 32767
        exit = 0
        modified = 1
        prev_modified = 1
        new_board = -1
        first_board_prompt = 0
        overlay_edit = 0
        board_width = 100
        board_height = 100
        cursor_board_x = 1
        cursor_board_y = 0
        cursor_move_x = 0
        cursor_move_y = 0
        cursor_x = 1
        cursor_y = 0
        scroll_x = 0
        scroll_y = 0
        level_id = 0x7216e0 "\177|"
        level_param = 0x730510 ""
        level_color = 0x732c50 '\a' <repeats 200 times>...
        overlay = 0x73c950 ' ' <repeats 200 times>...
        overlay_color = 0x740f80 '\a' <repeats 200 times>...
        vlayer_chars = 0x718b20 ' ' <repeats 200 times>...
        vlayer_colors = 0x7284e0 '\a' <repeats 200 times>...
        cursor_vlayer_x = 0
        cursor_vlayer_y = 0
        vscroll_x = 0
        vscroll_y = 0
        current_id = ROBOT
        current_color = 7
        current_param = 1
        use_default_color = 1
        draw_mode = 0
        text_place = 0
        text_start_x = -1
        block_command = -1
        block_edit = -1
        block_x = -1
        block_y = -1
        block_width = -1
        block_height = -1
        block_board = 0x0
        clear_board_history = 1
        clear_overlay_history = 1
        clear_vlayer_history = 1
        continue_mouse_history = 0
        saved_overlay_mode = 1
        edit_screen_height = 24
        current_menu = 0
        show_level = 1
        debug_x = 60
        backup_count = 3
        backup_interval = 60
        backup_name = 0x41390c <mzx_world+9196> "backup"
        backup_ext = 0x413a0c <mzx_world+9452> ".mzx"
        backup_timestamp = 4851
        backup_num = 0
        current_world = "C:\\megazeux\\debug\\__test.mzx", '\000' <repeats 483 times>
        mzm_name_buffer = '\000' <repeats 511 times>
        current_listening_dir = "C:\\megazeux\\debug", '\000' <repeats 494 times>
        current_listening_mod = '\000' <repeats 511 times>
        listening_flag = 0
        mzb_ext = {0x704531a3 <drawmode_help+547> ".MZB", 0x0}
        mzm_ext = {0x704531a8 <drawmode_help+552> ".MZM", 0x0}
        sfx_ext = {0x704531ad <drawmode_help+557> ".SFX", 0x0}
        chr_ext = {0x704531b2 <drawmode_help+562> ".CHR", 0x0}
        pal_ext = {0x704531b7 <drawmode_help+567> ".PAL", 0x0}
        idx_ext = {0x704531bc <drawmode_help+572> ".PALIDX", 0x0}
#6  0x00000000618df892 in title_screen (mzx_world=0x411520 <mzx_world>)
    at src/game.c:3130
        reload_curr_world_in_editor = 1
        exit = 0
        confirm_exit = 0
        fadein = 1
        key = 101
        key_status = 1
        fade = 0
        file_info = {st_dev = 0, st_ino = 0, st_mode = 0, st_nlink = 0,
          st_uid = 0, st_gid = 0, st_rdev = 0, st_size = 0, st_atime = 0,
          st_mtime = 0, st_ctime = 0}
        src_board = 0x0
        conf = 0x412e88 <mzx_world+6504>
#7  0x000000000040412e in SDL_main (argc=1, argv=0x10b5240) at src/main.c:195
        _backup_argv = {0x40d990 "./megazeux"}
        err = 1
        mzx_world = {active = 1, name = '\000' <repeats 24 times>,
          version = 603, status_counters_shown = {'\000' <repeats 14 times>,
            '\000' <repeats 14 times>, '\000' <repeats 14 times>,
            '\000' <repeats 14 times>, '\000' <repeats 14 times>,
            '\000' <repeats 14 times>}, keys = '\177' <repeats 16 times>,
          blind_dur = 0, firewalker_dur = 0, freeze_time_dur = 0,
          slow_time_dur = 0, wind_dur = 0, pl_saved_x = {0, 0, 0, 0, 0, 0, 0,
            0}, pl_saved_y = {0, 0, 0, 0, 0, 0, 0, 0}, pl_saved_board = {0,
            0, 0, 0, 0, 0, 0, 0}, saved_pl_color = 27, was_zapped = 0,
          under_player_id = 0, under_player_color = 7,
          under_player_param = 0, mesg_edges = 1, scroll_base_color = 143,
          scroll_corner_color = 135, scroll_pointer_color = 128,
          scroll_title_color = 143, scroll_arrow_color = 142,
          real_mod_playing = '\000' <repeats 511 times>, max_samples = -1,
          smzx_message = 1, edge_color = 8, first_board = 0,
          endgame_board = 255, death_board = 255, endgame_x = 0,
          endgame_y = 0, game_over_sfx = 1, death_x = 0, death_y = 0,
          starting_lives = 7, lives_limit = 99, starting_health = 100,
          health_limit = 200, enemy_hurt_enemy = 0, clear_on_exit = 0,
          only_from_swap = 0, player_restart_x = 0, player_restart_y = 0,
          num_counters = 15, num_counters_allocated = 32,
          counter_list = 0x740c00, num_strings = 0,
          num_strings_allocated = 0, string_list = 0x0, num_sprites = 256,
          num_sprites_allocated = 0, sprite_num = 0, sprite_list = 0x710800,
          active_sprites = 0, sprite_y_order = 0, collision_count = 0,
          collision_list = 0x7186f0, multiplier = 10000, divider = 10000,
          c_divisions = 360, fread_delimiter = 42, fwrite_delimiter = 42,
          bi_shoot_status = 1, bi_mesg_status = 1,
          output_file_name = '\000' <repeats 511 times>, output_file = 0x0,
          input_file_name = '\000' <repeats 511 times>, input_file = 0x0,
          input_is_dir = false, input_directory = {d = 0x0, entries = 0,
            pos = 0}, temp_input_pos = 0, temp_output_pos = 0, commands = 40,
          commands_stop = 2000000, vlayer_size = 32768, vlayer_width = 256,
          vlayer_height = 128,
          vlayer_chars = 0x718b20 ' ' <repeats 200 times>...,
          vlayer_colors = 0x7284e0 '\a' <repeats 200 times>...,
          num_boards = 1, num_boards_allocated = 1, board_list = 0x6ff0e0,
          current_board = 0x720b50, current_board_id = 0,
          temporary_board = 0, global_robot = {world_version = 603,
            program_source_length = 0, program_source = 0x0,
            program_bytecode_length = 2, program_bytecode = 0x711650 "▒",
            robot_name = '\000' <repeats 14 times>, robot_char = 2 '\002',
            cur_prog_line = 1, pos_within_line = 0, robot_cycle = 0,
            cycle_count = 0, bullet_type = 1 '\001', is_locked = 0 '\000',
            can_lavawalk = 0 '\000', can_goopwalk = 0 '\000',
            walk_dir = IDLE, last_touch_dir = IDLE, last_shot_dir = IDLE,
            xpos = -1, ypos = -1, status = 0 '\000', used = 1 '\001',
            loop_count = 0, num_labels = 0, label_list = 0x0, stack_size = 0,
            stack_pointer = 0, stack = 0x0, local = {0 <repeats 32 times>},
            command_map = 0x0, command_map_length = 0, commands_total = 0,
            commands_cycle = 0, commands_caught = 0}, custom_sfx_on = 0,
          custom_sfx = '\000' <repeats 3449 times>, player_x = 0,
          player_y = 0, target_where = TARGET_NONE, target_board = 0,
          target_x = 0, target_y = 0, target_id = SPACE, target_color = 0,
          target_d_id = SPACE, target_d_color = 0, dead = 0, bomb_type = 1,
          slow_down = 1, key_up_delay = 0, key_down_delay = 0,
          key_right_delay = 0, key_left_delay = 0, first_prefix = 0,
          mid_prefix = 0, last_prefix = 0,
          special_counter_return = FOPEN_NONE, robotic_save_type = SAVE_NONE,
          robotic_save_path = '\000' <repeats 511 times>,
          change_game_state = 0, mzx_speed = 4, lock_speed = 0, conf = {
            fullscreen = false, resolution_width = 1920,
            resolution_height = 1080, window_width = 1280,
            window_height = 700, allow_resize = true,
            video_output = "glsl", '\000' <repeats 11 times>, force_bpp = 32,
            video_ratio = RATIO_MODERN_64_35,
            gl_filter_method = "linear\000\000\000\000\000\000\000\000\000",
            gl_scaling_shader = '\000' <repeats 31 times>, gl_vsync = 0,
            output_frequency = 44100, buffer_size = 4096,
            oversampling_on = 0, resample_mode = 1,
            modplug_resample_mode = 2, max_simultaneous_samples = -1,
            music_volume = 8, sam_volume = 8, pc_speaker_volume = 8,
            music_on = 1, pc_speaker_on = 1,
            startup_path = '\000' <repeats 255 times>,
            startup_file = "caverns.mzx", '\000' <repeats 244 times>,
            default_save_name = "saved.sav", '\000' <repeats 246 times>,
            mzx_speed = 4, disassemble_extras = 1, disassemble_base = 10,
            startup_editor = 0, standalone_mode = 0, no_titlescreen = 0,
            mask_midchars = 1, system_mouse = false, network_enabled = true,
            socks_host = '\000' <repeats 255 times>, socks_port = 1080,
            update_host_count = 3, update_hosts = 0x6c9ba0,
            update_branch_pin = "Stable", '\000' <repeats 249 times>,
            update_auto_check = 2, update_available = 0}, editor_conf = {
            editor_space_toggles = 0, bedit_hhelp = 1,
            editor_tab_focuses_view = 0, editor_load_board_assets = 0,
            editor_thing_menu_places = 1, viewport_x = 0, viewport_y = 0,
            viewport_w = 80, viewport_h = 25, board_width = 100,
            board_height = 100, can_shoot = 1, can_bomb = 1,
            fire_burns_spaces = 0, fire_burns_fakes = 1,
            fire_burns_trees = 1, fire_burns_brown = 0,
            fire_burns_forever = 0, forest_to_floor = 0, collect_bombs = 0,
            restart_if_hurt = 0, reset_on_entry = 0, player_locked_ns = 0,
            player_locked_ew = 0, player_locked_att = 0, time_limit = 0,
            explosions_leave = 1, saving_enabled = 0, overlay_enabled = 1,
            charset_path = '\000' <repeats 511 times>,
            palette_path = '\000' <repeats 511 times>, pedit_hhelp = 0,
            undo_history_size = 100, editor_enter_splits = true,
            color_codes = "\v\n\n\016▒\003\v\002\016\000\017\v\a\017\001\002\003", '\000' <repeats 14 times>, color_coding_on = 1,
            default_invalid_status = 1, redit_hhelp = 1, backup_count = 3,
            backup_interval = 60,
            backup_name = "backup", '\000' <repeats 249 times>,
            backup_ext = ".mzx", '\000' <repeats 251 times>,
            default_macros = {"char ", '\000' <repeats 58 times>,
              "color ", '\000' <repeats 57 times>,
              "goto ", '\000' <repeats 58 times>,
              "send ", '\000' <repeats 58 times>,
              ": playershot^", '\000' <repeats 50 times>},
            num_extended_macros = 0, num_macros_allocated = 0,
            extended_macros = 0x0, saved_board = {0, 0, 0, 0, 0, 0, 0, 0, 0,
              0}, saved_cursor_x = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
            saved_cursor_y = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
            saved_scroll_x = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
            saved_scroll_y = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, saved_debug_x = {
              60, 60, 60, 60, 60, 60, 60, 60, 60, 60}}, editor_conf_backup = {
            editor_space_toggles = 0, bedit_hhelp = 1,
            editor_tab_focuses_view = 0, editor_load_board_assets = 0,
            editor_thing_menu_places = 1, viewport_x = 0, viewport_y = 0,
            viewport_w = 80, viewport_h = 25, board_width = 100,
            board_height = 100, can_shoot = 1, can_bomb = 1,
            fire_burns_spaces = 0, fire_burns_fakes = 1,
            fire_burns_trees = 1, fire_burns_brown = 0,
            fire_burns_forever = 0, forest_to_floor = 0, collect_bombs = 0,
            restart_if_hurt = 0, reset_on_entry = 0, player_locked_ns = 0,
            player_locked_ew = 0, player_locked_att = 0, time_limit = 0,
            explosions_leave = 1, saving_enabled = 0, overlay_enabled = 1,
            charset_path = '\000' <repeats 511 times>,
            palette_path = '\000' <repeats 511 times>, pedit_hhelp = 0,
            undo_history_size = 100, editor_enter_splits = true,
            color_codes = "\v\n\n\016▒\003\v\002\016\000\017\v\a\017\001\002\003", '\000' <repeats 14 times>, color_coding_on = 1,
            default_invalid_status = 1, redit_hhelp = 1, backup_count = 3,
            backup_interval = 60,
            backup_name = "backup", '\000' <repeats 249 times>,
            backup_ext = ".mzx", '\000' <repeats 251 times>,
            default_macros = {"char ", '\000' <repeats 58 times>,
              "color ", '\000' <repeats 57 times>,
              "goto ", '\000' <repeats 58 times>,
              "send ", '\000' <repeats 58 times>,
              ": playershot^", '\000' <repeats 50 times>},
            num_extended_macros = 0, num_macros_allocated = 0,
            extended_macros = 0x0, saved_board = {0, 0, 0, 0, 0, 0, 0, 0, 0,
              0}, saved_cursor_x = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
            saved_cursor_y = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
            saved_scroll_x = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
            saved_scroll_y = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, saved_debug_x = {
              60, 60, 60, 60, 60, 60, 60, 60, 60, 60}}, editing = true,
          raw_world_info = 0x0, raw_world_info_size = 0,
          help_file = 0x7fff2358fa90 <msvcrt!_iob+144>,
          update_done = 0x725da0 "", update_done_size = 10000,
          full_exit = false}
#8  0x00000000004059c8 in main_getcmdline ()
No symbol table info available.
#9  0x00000000004013a5 in __tmainCRTStartup ()
    at C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:339
        lock_free = <optimized out>
        fiberid = <optimized out>
        nested = <optimized out>
        lpszCommandLine = <optimized out>
        StartupInfo = {cb = 0, lpReserved = 0x0, lpDesktop = 0x0,
          lpTitle = 0x0, dwX = 0, dwY = 0, dwXSize = 0, dwYSize = 0,
          dwXCountChars = 0, dwYCountChars = 0, dwFillAttribute = 0,
          dwFlags = 0, wShowWindow = 0, cbReserved2 = 0, lpReserved2 = 0x0,
          hStdInput = 0x0, hStdOutput = 0x0, hStdError = 0x0}
        inDoubleQuote = <optimized out>
#10 0x000000000040150b in mainCRTStartup ()
    at C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:223
        ret = 255

- Your Jumpy Neighborhood Admin

<@Tixus> Anyway, I set the year to 1988 for some reason.
<@Tixus> And set the microwave to run for a minute and 28 seconds.
<@Tixus> But it failed to send me back in time, and I was disappointed.
<Insidious> Tixus accidentally microwaved the 80s
<Insidious> that is my takeaway from this


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 2)

#2 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,943
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 09 September 2018 - 01:59 AM

Updating status to: Fixed
Updating severity to: 5 - Critical
Issue fixed in: 2.91f
Updating Introduced In Version to: 2.90

Fixed in GIT e2ff8b4e.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#3 User is offline  
Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,966
  • Joined: 12-October 00
  • Gender:Male

Posted 17 September 2018 - 05:00 AM

Moving to: Archived MegaZeux Bugs


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2025  IPS, Inc.