[go: up one dir, main page]

Menu

#2013 Attaching an AR or AP cart .bin with incorrect size "silently" fails

v3.x
pending-fixed
compyx
None
User Interface
2024-04-10
2024-04-06
No

Manually attaching an Action Replay V5 or Atomic Power doing "Attach cartridge-image..." using a .bin silently fails (there is log output, but no dialogue) if the .bin size is incorrectly 64KiB.

x64sc r45089

Discussion

  • gpz

    gpz - 2024-04-06

    I'm not sure i get the problem.... attaching an image with wrong size should fail of course. Its the missing error message?

     
  • gpz

    gpz - 2024-04-06

    This one is ODD

    The error is correctly produced and distributed. And then vice_gtk3_message_error() is called to show the error message - but it doesn't show the error message!

     
  • gpz

    gpz - 2024-04-06
    • assigned_to: compyx
    • Category: --> User Interface
     
  • gpz

    gpz - 2024-04-09

    This seems to be an unhandled race condition in our GTK code. This "fixes" it:

    Index: src/arch/gtk3/uicart.c
    ===================================================================
    --- src/arch/gtk3/uicart.c      (Revision 45100)
    +++ src/arch/gtk3/uicart.c      (Arbeitskopie)
    @@ -311,6 +311,7 @@
                     gboolean result;
    
                     result = attach_cart_image(get_cart_type(), get_cart_id(), filename_locale);
    +                gtk_widget_destroy(dialog);
                     if (!result) {
                         vice_gtk3_message_error("VICE Error",
                                 "Failed to smart-attach '%s'", filename);
    @@ -322,10 +323,12 @@
                     }
                     g_free(filename);
                     g_free(filename_locale);
    +            } else {
    +                gtk_widget_destroy(dialog);
                 }
    -            gtk_widget_destroy(dialog);
                 break;
         }
    +                    // vice_gtk3_message_error("VICE Error", "Failed to fail");
    
         /* FIXME: hack to avoid the 'normal' dialog (via the menu) triggering the
          *        extra callback meant for the default cart setting page.
    

    ie it looks like the error message is not shown, when the parent dialog is destroyed after creating the error message. I am not familiar with how this stuff should work and in particular what stuff should be blocking, or running in what context.... so no idea how to fix it properly. I am sure though that similar cases exist in the code, so this is probably not the only affected error message.

     
  • compyx

    compyx - 2024-04-10

    I've fixed this in trunk. Indeed the error message was destroyed along with the attach dialog, so it never showed up.

    The vice_gtk3_message_error() function now accepts a parent argument so we can set the correct parent for the message box. If we cannot provide a proper parent (due to calling from a UI action or a vsync callback, or via ui_error() from the VICE thread) the parent is assumed to be the current emulator window.
    I'll be updating vice_gtk3_message_info() and vice_gtk3_message_confirm() as well to allow to set proper parentage.

     
  • compyx

    compyx - 2024-04-10
    • status: open --> pending-fixed
     

Log in to post a comment.