[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Proposing a debugging method for this bug



Jérôme Marant wrote:
Le mardi 07 novembre 2006 14:30, Attilio Fiandrotti a écrit :

Jérôme Marant wrote:

Le lundi 06 novembre 2006 12:55, Attilio Fiandrotti a écrit :



Jerome, if i provide a simple patch for DFB 0.9.25, could you please rebuild the libdirectfb-udeb and see if the crash is fixed? In this case we could backport the fix from DFB 1.0-rc2 to DFB 0.9.25: would this be possible if fixes this chash?


Of course.

hi jerome

Attached to this mail you will find a patch that moves DFB's 0.9.25.1 signal handling to different signals than SIGUSR1/2 (during my tests, those were replaced to signals number 41 and 42 and everything worked correctly).

thanks in anticipation for testing.


I rebuilt libdirectfb udeb with your patch and re-generated the miniiso.

Unfortunately, nothing changed.
I can try to provide a new strace output, as soon as someone unbreaks
rootskel.


So far we stated this bug

- cannot be reproduced on a regular debian system
- does not look like it's related to the way DFB handles VT switching

One more test: could you please compile the attached gtk application (which simply runs a progressbar), pull into the d-i, run it and switch VT while the progressbar runs to see if crashes?

I was able to reproduce this bug with qemu using today's gtk miniiso, i'll try to strace the installer with qemu to see if i get something like your strace log.

cheers

Attilio

Attilio
//gcc gprogressbar_timer2.c -g -o gprogressbar_timer2 `pkg-config --cflags --libs gtk+-directfb-2.0 gthread-2.0`


#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <gtk/gtk.h>

static GCond *button_cond = NULL;   /* Must be initialized somewhere */
static GMutex *button_mutex = NULL; /* Must be initialized somewhere */

GtkWidget *window, *bar, *button, *box, *hbox, *label;
char *label_text;

static gboolean delete_event( GtkWidget *widget,
                              GdkEvent  *event,
                              gpointer   data )
{
    g_print ("delete event occurred\n");
    return TRUE;
}



static void destroy( GtkWidget *widget,
                     gpointer   data )
{
//    gtk_main_quit ();

	g_mutex_lock (button_mutex);
	g_cond_signal (button_cond);
	g_mutex_unlock (button_mutex);

}

void *eventhandler_thread()
{

	gdk_threads_enter();  // Protect from gtk main loop which also performs a gtk_entry_set_text.

	gtk_main();

    gdk_threads_leave();
}

void *updater_thread()
{

    int count=0;
    gdouble	progress = 0;

	while(count < 100) {
		count = count +1;
	    progress = progress+0.01;
		sprintf(label_text,"Count = %d\n", count);

		gdk_threads_enter();  // Protect from gtk main loop which also performs a gtk_entry_set_text.

		gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar), progress);
//        gtk_label_set_text(GTK_LABEL(label), label_text);

	    gdk_flush();
	    gdk_threads_leave();
	    
	sleep(1);
	}
}

int main(int argc, char **argv)
{
    int ret, myint;
    pthread_t thread_id;
	GThread          *Thread1, *Thread2;
	GError           *err1 = NULL, *err2 = NULL ;


    gtk_init (&argc, &argv);

    if( !g_thread_supported() )
    {
       g_thread_init(NULL);
       gdk_threads_init();                   // Called to initialize internal mutex "gdk_threads_mutex".
       printf("g_thread supported\n");
    }
    else
    {
       printf("g_thread NOT supported\n");
    }

	button_cond = g_cond_new ();
    button_mutex = g_mutex_new ();

    label_text = malloc (200);
            
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_container_set_border_width (GTK_CONTAINER (window), 10);
    gtk_widget_set_size_request (window, 700, 300);
    
    g_signal_connect (G_OBJECT (window), "delete_event",
		      G_CALLBACK (delete_event), NULL);   
    g_signal_connect (G_OBJECT (window), "destroy",
		      G_CALLBACK (destroy), NULL);

	bar = gtk_progress_bar_new ();    

	button = gtk_button_new_with_label("Click me to quit");
    g_signal_connect_swapped (G_OBJECT (button), "clicked",	G_CALLBACK (gtk_widget_destroy), G_OBJECT (window));

	label = gtk_label_new("Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah ");
    gtk_label_set_single_line_mode(label, TRUE);
    
    box = gtk_vbox_new (FALSE, 5);
    hbox = gtk_hbox_new (FALSE, 5);
    gtk_box_pack_start(GTK_BOX(box), bar, FALSE, FALSE, 5);
    gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 5);
    gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
    gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 5);


    gtk_container_add(GTK_CONTAINER(window), box);

    gtk_widget_show_all (window);

	if( (Thread1 = g_thread_create((GThreadFunc)updater_thread, NULL, TRUE, &err1)) == NULL)
	{
		printf("Thread create failed: %s!!\n", err1->message );
		g_error_free ( err1 ) ;
	}

	if( (Thread2 = g_thread_create((GThreadFunc)eventhandler_thread, NULL, TRUE, &err2)) == NULL)
	{
		printf("Thread create failed: %s!!\n", err2->message );
		g_error_free ( err2 ) ;
	}

//gtk_main();

  gdk_threads_leave ();

	g_mutex_lock (button_mutex);
	g_cond_wait (button_cond, button_mutex);
	g_mutex_unlock (button_mutex);
	
	gtk_main_quit();

    return 0;
}

Reply to: