I'm getting a crash in gimp when trying the Outline tutorial from
http://www.obscurasite.com/artstuff/tutorials/gimp-text-outline/

When doing the Edit Stroke command : (brush selected circle 3).

/usr2/gimp/bin/gimp: fatal error: sigbus caught
/usr2/gimp/bin/gimp (pid:1152): [E]xit, [H]alt, show [S]tack trace or
[P]roceed: fg
/usr2/gimp/bin/gimp
S
#0  0xfef8a35c in g_on_error_stack_trace ()
#1  0xfef8a16c in g_on_error_query ()
#2  0xba3a0 in gimp_fatal_error ()
#3  0x1576a8 in on_signal ()
#4  <signal handler called>
#5  0x177858 in color_pixels ()
#6  0x18ceb0 in paintbrush_motion ()
#7  0x18d2d8 in paintbrush_non_gui_paint_func ()
#8  0x18d524 in paintbrush_non_gui_default ()
#9  0x1eca54 in paintbrush_default_invoker ()
#10 0x1b8778 in procedural_db_execute ()
#11 0x1b8c04 in procedural_db_run_proc ()
#12 0xdadc8 in gimage_mask_stroke ()
#13 0x8a7bc in edit_stroke_cmd_callback ()
#14 0xff1c1724 in gtk_item_factory_callback_marshal ()
#15 0xff1e9160 in gtk_marshal_NONE__NONE ()
#16 0xff260228 in gtk_handlers_run ()
#17 0xff25e38c in gtk_signal_real_emit ()
#18 0xff2595bc in gtk_signal_emit ()
#19 0xff2e08d8 in gtk_widget_activate ()
#20 0xff1fcce0 in gtk_menu_shell_activate_item ()
#21 0xff1fa8dc in gtk_menu_shell_button_release ()
#22 0xff1e8730 in gtk_marshal_BOOL__POINTER ()
#23 0xff25e434 in gtk_signal_real_emit ()
#24 0xff2595bc in gtk_signal_emit ()
#25 0xff2e04d8 in gtk_widget_event ()
#26 0xff1e83fc in gtk_propagate_event ()
#27 0xff1e5f48 in gtk_main_do_event ()
#28 0xff02c9b0 in gdk_event_dispatch ()
#29 0xfef945dc in g_main_dispatch ()
#30 0xfef953d0 in g_main_iterate ()
#31 0xfef9576c in g_main_run ()
#32 0xff1e4eb4 in gtk_main ()
#33 0x157550 in main ()


Under the debugger :
(dbx) cont
signal BUS (invalid address alignment) in color_pixels at 0x177858
color_pixels+0x110:     ld      [%l0], %i1
(dbx) where
=>[1] color_pixels(0x847bb0, 0xffbedbb2, 0x19, 0x4, 0x0, 0x0), at
0x177858
  [2] paintbrush_motion(0x329110, 0x7bf940, 0x287758, 0x0, 0x0, 0x0), at
0x18cea8
  [3] paintbrush_non_gui_paint_func(0x329110, 0x7bf940, 0x0, 0x0,
0x4052c000, 0x0), at 0x18d2d0
  [4] paintbrush_non_gui_default(0x7bf940, 0x52, 0x8d5cb8, 0x0, 0x0,
0x0), at 0x18d51c
  [5] paintbrush_default_invoker(0x847b18, 0x2bfea8, 0xfed36000, 0x23c0,
0x21dc0, 0xfecc0d48), at 0x1eca4c
  [6] procedural_db_execute(0x2bfea8, 0x847b18, 0x0, 0x0, 0x0,
0x8d25f0), at 0x1b8770
  [7] procedural_db_run_proc(0x2bfea8, 0xffbedf0c, 0x10, 0x3, 0x0,
0xa4), at 0x1b8bfc
  [8] gimage_mask_stroke(0x70d6b0, 0x7bf940, 0x1, 0x0, 0x20478,
0x5f85c0), at 0xdadc0
  [9] edit_stroke_cmd_callback(0x5fd140, 0x0, 0x0, 0x0, 0x0, 0x0), at
0x8a7b4
  [10] gtk_item_factory_callback_marshal(0x5fd140, 0x5ed940, 0x0, 0x0,
0x0, 0x5fb060), at 0xff1c171c
  [11] gtk_marshal_NONE__NONE(0x5fd140, 0xff1c1658, 0x5ed940,
0xffbee218, 0x214e0, 0xfee9b410), at 0xff1e9158
  [12] gtk_handlers_run(0x5fcf50, 0xffbee184, 0x5fd140, 0xffbee218, 0x0,
0xffbee510), at 0xff260220
  [13] gtk_signal_real_emit(0x5fd140, 0x5b, 0xffbee218, 0x1, 0x0,
0xffbee218), at 0xff25e384
  [14] gtk_signal_emit(0x5fd140, 0x5b, 0x0, 0xffbeece4, 0x20, 0x330fd0),
at 0xff2595b4
  [15] gtk_widget_activate(0x5fd140, 0x5f59c0, 0x330ff0, 0x330fd0,
0x32d458, 0x0), at 0xff2e08d0
  [16] gtk_menu_shell_activate_item(0x5f9970, 0x5fd140, 0x1, 0x0,
0x20478, 0x5f85c0), at 0xff1fccd8
  [17] gtk_menu_shell_button_release(0x5f9970, 0x3c0de8, 0x0, 0x74b610,
0x0, 0x6a4735), at 0xff1fa8d4
  [18] gtk_marshal_BOOL__POINTER(0x5f9970, 0xff1fa4a8, 0x0, 0xffbee820,
0x0, 0x0), at 0xff1e8728
  [19] gtk_signal_real_emit(0x5f9970, 0x15, 0xffbee820, 0x0, 0x0,
0xffbee838), at 0xff25e42c
  [20] gtk_signal_emit(0x5f9970, 0x15, 0x3c0de8, 0xffbeeba0, 0x0,
0xfeea6134), at 0xff2595b4
  [21] gtk_widget_event(0x5f9970, 0x3c0de8, 0x0, 0x8, 0x0, 0x7c00462),
at 0xff2e04d0
  [22] gtk_propagate_event(0x5fd140, 0x3c0de8, 0x32d458, 0xffbeece4,
0x20, 0x330fd0), at 0xff1e83f4
  [23] gtk_main_do_event(0x3c0de8, 0x0, 0x330ff0, 0x330fd0, 0x32d458,
0x0), at 0xff1e5f40
  [24] gdk_event_dispatch(0x0, 0xffbeee48, 0x0, 0x0, 0x20478,
0xfef95d2c), at 0xff02c9a8
  [25] g_main_dispatch(0xffbeee48, 0x3328f0, 0x1, 0x74b610, 0x0,
0x6a4735), at 0xfef945d4
  [26] g_main_iterate(0x1, 0x1, 0x0, 0x0, 0x0, 0x0), at 0xfef953c8
  [27] g_main_run(0x6a4730, 0x6a4730, 0x0, 0x0, 0x0, 0x0), at 0xfef95764

  [28] gtk_main(0x0, 0x6, 0x1575b0, 0x0, 0x33b548, 0x3305a0), at
0xff1e4eac
  [29] main(0x1, 0xffbef024, 0xffbef02c, 0x26fc00, 0x0, 0x0), at
0x157548



The comment in the code is rather explicit !!! It crashes.

void
color_pixels (unsigned char *dest,
              const unsigned char *color,
              int            w,
              int            bytes)
{
  /* dest % bytes and color % bytes must be 0 or we will crash
     when bytes = 2 or 4.
     Is this safe to assume?  Lets find out.
     This is 4-7X as fast as the simple version.
     */
  register unsigned char c0, c1, c2;
  register guint32 *longd, longc;
  register guint16 *shortd, shortc;

  switch (bytes)
  {
   case 1:
     memset(dest, *color, w);
     break;
   case 2:
     shortc = ((guint16 *)color)[0];
     shortd = (guint16 *)dest;
     while (w--)
     {
       *shortd = shortc;
       shortd++;
     }
     break;
   case 3:
     c0 = color[0];
     c1 = color[1];
     c2 = color[2];
     while (w--)
     {
       dest[0] = c0;
       dest[1] = c1;
       dest[2] = c2;
       dest += 3;
     }
     break;
   case 4:
     longc = ((guint32 *)color)[0];   <<<< Crash here !
     longd = (guint32 *)dest;
     while (w--)
     {
       *longd = longc;
       longd++;
     }
     break;
   default:
   {
     int b;
     while (w--)
     {
       for (b = 0; b < bytes; b++)
         dest[b] = color[b];

       dest += bytes;
     }
   }
  }
}


--
Ludovic Poitou
Sun Microsystems Inc.
iPlanet E-Commerce Solutions - Directory Group - Grenoble - France


Reply via email to