Re: segmentation fault -- Help!



randylhess netscape net wrote:

Hello,

Here is a copy of the function that is being called.  The destroy
function and the show function worked before adding code to actually get
it to authenticate.  It is crashing when it reaches the end of the
function whether or not the login is valid.  It appears to function
perfectly until the end of the function in either scenario.  It just
does not have time to show the main_menu before segfault.  I am using
gtk 1.2 for this, but I also have 2.0 installed.  Will that cause any
problems?  The glade code is for 1.2 and won't work as-is on 2.0.  The
default is still 1.2.  I hope this helps.  Any help you can give will be
greatly appreciated.

Randy Hess


This sounds like a stack overflow issue. I bet you have't allocated
enough 
space in the check_login_and_password() function to hold the password
string
or something. Since you say it worked before adding that call, I'd have
a look at that code.

void
on_mbllogin_clicked                    (GtkButton       *button,
                                        gpointer         user_data)
{
  gboolean valid;
  g_print("\nEnter call to username and password verification code here.");

  /* Remove the valid = TRUE; line once code is inserted for
authentication */

  valid = FALSE;
  server = read_server_name();
  valid = check_login_and_password ();
  if (valid)
  {
    g_print("\nInsert code to set all windows buttons to match
permissions.");
    gtk_widget_destroy (mblogin_window);
    gtk_widget_show (main_menu);
    /*mblogin_window = create_mblogin_window ();*/
  }
  else
  {
    g_print("\nInsert call to statusbar update with value of,Invalid
Login or Username.");
    set_message(mblogin_window, "mblmessageslabel", "Invalid Login or
username.");
  }
  g_print("\nExiting on_mbllogin_clicked function.  Should have
main_menu on screen.");
}

-- 
---------------------------------------------------------------------
Paolo Costabel                Visit The Internet Comic Books Database 
Sony Imageworks                           http://www.comicsdb.com



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