• Bug#261848: inkscape: segfaults on startup (Alpha) (1/2)

    From Wolfram Quester@1:229/2 to Thimo Neubauer on Thu Aug 19 23:30:16 2004
    From: [email protected]

    --TB36FDmn/VVEgNH/
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable

    Hi Thimo!

    On Mon, Aug 16, 2004 at 12:14:51PM +0200, Thimo Neubauer wrote:
    Hi,

    On Sun, Aug 08, 2004 at 03:36:05PM +0200, Wolfram Quester wrote:
    I forwarded your report to the inkscape developer ML and
    one replay was

    On Fri, 2004-08-06 at 23:40, MenTaLguY wrote:
    On Fri, 2004-08-06 at 07:38, Wolfram Quester wrote:
    #0 0x0000020000a3cba8 in g_type_is_a (type=540847136, iface_type=4835814432)
    at gtype.c:2730
    #1 0x0000000120095a34 in sp_object_repr_build_tree ()
    #2 0x0000000120050690 in SPDocument::collectOrphans ()
    #3 0x0000000120050e98 in sp_document_new ()
    #4 0x0000000120054efc in sp_file_new ()
    #5 0x000000012004f078 in sp_main_gui ()
    #6 0x000000012004ed50 in main ()

    Hmm. That backtrace looks a little suspect to me, SPDocument::collectOrphans() never calls sp_object_repr_build_tree() directly.

    By "suspect", I mean it looks like the stack may have been corrupted.
    Is this from a core dump or a live gdb session? The latter is sometimes more reliable in capturing the stack.

    It was a live session, I didn't fake the gdb-call and run-command in
    my report :) Maybe the effect is due to a cunning g++-optimization,
    The results so far were with the original binary and the -dbg-libs.

    Ok, now a new debug-build (noopt, nostrip) is ready but the backtrace
    is nearly the same:

    Thanks for your reports and info!
    Using warnings like
    dialogs/export.cpp:259: warning: cast to pointer from integer of different size dialogs/export.cpp:584: warning: cast from pointer to integer of different size in debian's alpha buildlog I created the attached patch. It is an ugly
    hack but could you please apply it and test the result? I doubt it helps
    since it does not touch the files mentioned in your backtraces, but
    perhaps it fixes other pieces where the mentioned stack corruptions
    occur. I don't see what could be wrong around the sites mentioned, but probably this is due to my inexperience with debugging such errors.
    Please mail me a log of your build process too.

    Thanks for your help,

    Wolfi

    --TB36FDmn/VVEgNH/
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: attachment; filename="inkscape.alpha.diff" Content-Transfer-Encoding: quoted-printable

    diff -ur inkscape-0.39.orig/src/dialogs/export.cpp inkscape-0.39/src/dialogs/export.cpp
    --- inkscape-0.39.orig/src/dialogs/export.cpp 2004-08-17 14:21:55.000000000 +0200
    +++ inkscape-0.39/src/dialogs/export.cpp 2004-08-19 21:20:28.338848336 +0200
    @@ -256,7 +256,7 @@

    for (int i = 0; i < SELECTION_NUMBER_OF; i++) {
    b = gtk_toggle_button_new_with_label (_(selection_labels[i]));
    - gtk_object_set_data (GTK_OBJECT (b), "key", (void *)i);
    + gtk_object_set_data (GTK_OBJECT (b), "key", GINT_TO_POINTER(i));
    gtk_object_set_data (GTK_OBJECT (dlg), selection_names[i], b);
    gtk_box_pack_start (GTK_BOX (hb), b, FALSE, TRUE, 0);
    gtk_signal_connect ( GTK_OBJECT (b), "clicked",
    @@ -581,7 +581,7 @@
    // std::cout << "Selection Changed" << std::endl;
    static bool was_empty = TRUE;
    selection_type current_key;
    - current_key = (selection_type)((int)gtk_object_get_data(GTK_OBJECT(base), "selection-type"));
    + current_key = (selection_type)(GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(base), "selection-type")));

    if ((curren