[C] Pidgin Plugin, Abstürze Probleme

Hallo erstmal, ich bin neu hier im Forum!
Ich programmiere seit Jahren in VB6, PHP/MYSQL, seit ca 2 Jahren mit VB.Net wobei ich eigl auf Windows Mobile spezialisiert bin. Etwas C hab ich eigl relativ wenig gemacht, schon garnicht ohne Laufzeitdebugging :(

vor Wochen habe ich mir ein Pidgin (Messenger: http://www.pidgin.im) geschrieben um die letzten Nachrichten, die letzten User die On kommen in eine Textdatei auszugeben, bzw ob ungelesene Nachrichten vorhanden sind. Die dateien nutze ich um alles in meiner Sidebar anzuzeigen.

Leider muss ich die Plugins unter Cygwin mit gcc("make"???). Ich schreibe alles im texteditor.
Leider habe ich kaum erfahrungen in C.
Mein Plugin stürzt regelmäßig ab, immer wenn ich mich ab und dann wieder abmelde mit Pidgin. Compilieren konnte ich ohne Probleme

Wäre nett wenn jemand über meinen Source lesen könnte und mir sagen könnte wo die Fehler liegen. Tipps für bestimmte Probleme die ich sicher amateurhaft gelöst habe wären auch nett. (2 Varieblen Kombienieren z.B.)

Vielen DANK!

ps: hier das C TUT http://developer.pidgin.im/wiki/CHowTo/BasicPluginHowto


Code:
/*
* Exporter Plugin
*
* Copyright (C) 2004, Gary Kramlich <grim@guifications.org>,
* 2007, John Bailey <rekkanoryo@cpw.pidgin.im>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02111-1301, USA.
*
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

/* config.h may define PURPLE_PLUGINS; protect the definition here so that we
* don't get complaints about redefinition when it's not necessary. */
#ifndef PURPLE_PLUGINS
# define PURPLE_PLUGINS
#endif

#include <glib.h>

/* This will prevent compiler errors in some instances and is better explained in the
* how-to documents on the wiki */
#ifndef G_GNUC_NULL_TERMINATED
# if __GNUC__ >= 4
# define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
# else
# define G_GNUC_NULL_TERMINATED
# endif
#endif

#include <stdio.h>
#include <time.h>
#include <stdbool.h>

#include <notify.h>
#include <plugin.h>
#include <version.h>
#include <account.h>

#include "internal.h"
#include "buddyicon.h"
#include "cipher.h"
#include "connection.h"
#include "conversation.h"
#include "core.h"
#include "debug.h"
#include "ft.h"
#include "signals.h"
#include "version.h"
#include "status.h"
#include "sound.h"

#include "gtkconv.h"


static char *de_tag(char *string);
static gchar * displayName (PurpleBuddy *buddy);
PurplePlugin *exporter_plugin = NULL;


static char *de_tag(char *str)
{
// many thanks to Martin for this nice piece of code
// de_tag removes all html/xml from a string
// used for stripping down styled messages
char *p, *q;
while( (p=strchr(str, '<')) && (q=strchr(p, '>')) )
{
memmove(p, q+1, strlen(q));
}
return str;
}

static char *PidginPath(char *filename)
{
char path[4096];
/*
strcpy(path, purple_user_dir());
strcat(path, G_DIR_SEPARATOR_S);
strcat(path, filename);
*/
//sprintf(filename, "%s" G_DIR_SEPARATOR_S "pidglet-cmd", purple_user_dir());
g_snprintf(path, sizeof(path), "%s%s%s", purple_user_dir(), G_DIR_SEPARATOR_S, filename);

return path;
}

static gchar * displayName(PurpleBuddy *buddy)
{
if (buddy->alias) {
return buddy->alias;
} else if (buddy->server_alias) {
return buddy->server_alias;
} else if (buddy->name) {
return buddy->name;
} else {
return 'empty';
}
}

/* we're adding this here and assigning it in plugin_load because we need
* a valid plugin handle for our call to purple_notify_message() in the
* plugin_action_test_cb() callback function */


/* we tell libpurple in the PurplePluginInfo struct to call this function to
* get a list of plugin actions to use for the plugin. This function gives
* libpurple that list of actions. */
static GList *
plugin_actions (PurplePlugin * plugin, gpointer context)
{
/* some C89 (a.k.a. ANSI C) compilers will warn if any variable declaration
* includes an initilization that calls a function. To avoid that, we
* generally initialize our variables first with constant values like NULL
* or 0 and assign to them with function calls later */
GList *list = NULL;
PurplePluginAction *action = NULL;


/* libpurple requires a GList of plugin actions, even if there is only one
* action in the list. We append the action to a GList here. */
list = g_list_append (list, action);

/* Once the list is complete, we send it to libpurple. */
return list;
}

static void
buddy_signed_on_cb(PurpleBuddy *buddy, void *data)
{

char oldText[100];
char oldTextFixed[100];
bool duplicate=FALSE;
char newText[400];
char currentUsername[100];

if (buddy != NULL)
{
FILE *fileR;
fileR=fopen(PidginPath("LastLogons.txt"),"a+");
if (!fileR)
{
purple_debug_misc("Exporter Debugger", "Read Error in buddy_signed_on_cb");
return;
}

strcpy(newText, "");
strcpy(currentUsername, displayName(buddy));

int x=0;
while (x<3)
{
fgets(oldText, sizeof(oldText), fileR);

strcpy(oldTextFixed, oldText);
char *newline = strchr(oldTextFixed, 'n'); // check for trailing 'n'
if (newline)
{
*newline = '0'; // overwrite the 'n' with a terminating null
}


if (currentUsername[0] == oldTextFixed[0] && currentUsername[1] == oldTextFixed[1] && strlen(currentUsername) == strlen(oldTextFixed))
{
duplicate = TRUE;

int y=0;
while (y<strlen(currentUsername) && duplicate == TRUE) {
if (currentUsername[y] == oldTextFixed[y])
{
//duplicate = TRUE;
}
else
{
duplicate = FALSE;
}
y++;
}
}

purple_debug_misc("Exporter Debugger", "-Buddyname:"%s"- oldText:"%s"-n", currentUsername, oldTextFixed);
strcat(newText, oldText);

x++;
}
fclose(fileR);

if (duplicate == FALSE)
{
FILE *fileW;
fileW=fopen(PidginPath("LastLogons.txt"),"w+");
if (!fileW)
{
purple_debug_misc("Exporter Debugger", "Write Error in buddy_signed_on_cb");
return;
}
fprintf(fileW,"%s",displayName(buddy));
fprintf(fileW,"%s","n");
fprintf(fileW,"%s",newText);
fclose(fileW);
}
else
{
purple_debug_misc("Exporter Debugger", "Duplicate FOUND!");
}
}

}

GList *get_pending_list(guint max) {
GList *l_im = NULL;


l_im = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM, PIDGIN_UNSEEN_TEXT, FALSE, max);

//l_im = purple_get_ims;

if (l_im != NULL)
{
return l_im;
}

}

static void
NewMessage(gboolean state)
{
FILE *fileW;
fileW = fopen(PidginPath("NewMessage.txt"),"w+");
if (!fileW)
{
purple_debug_misc("Exporter Debugger", "Write Error in NewMessage");
return;
}

if(state)
{
fprintf(fileW,"%s","1");
//fputs("1", fileW);
}
else
{
fprintf(fileW,"%s","0");
//fputs("0", fileW);
}
fclose(fileW); /*done!*/
}

static void
conversation_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type)
{
GList *list = NULL;

if(type == PURPLE_CONV_UPDATE_UNSEEN) {

list=get_pending_list(1);
if(list == NULL)
{
NewMessage(FALSE);
}
else if(list != NULL)
{
NewMessage(TRUE);
g_list_free(list);
}

}
}

static void
received_im_msg_cb(PurpleAccount *account, char *sender, char *buffer,
PurpleConversation *conv, PurpleMessageFlags flags, void *data)
{
char oldText[10000];
char newText[1000];
char myUsername[10000];
char *message=strdup(buffer);

struct tm *newtime;
time_t long_time;
time( &long_time );
newtime = localtime( &long_time );
//newtime->tm_hour, newtime->tm_min, newtime->tm_sec

de_tag(message);

FILE *fileR;
fileR=fopen(PidginPath("LastMessage.txt"),"a+");

if (!fileR)
{
purple_debug_misc("Exporter Debugger", "Read Error in received_im_msg_cb");
return;
}

char line [1000]; /* or other suitable maximum line size */
strcpy(oldText, "");
while (fgets(line, sizeof(line), fileR) != NULL) /* read a line */
{
strcat(oldText, line);
}
fclose(fileR); /*done!*/

int x=0;
while (x<1000)
{
newText[x] = oldText[x];
x++;
}

FILE *fileW;
fileW=fopen(PidginPath("LastMessage.txt"),"w+");
if (!fileW)
{
purple_debug_misc("Exporter Debugger", "Write Error in received_im_msg_cb");
return;
}

strcpy(myUsername, purple_conversation_get_title(conv));

if (myUsername == NULL)
{
strcpy(myUsername, '(null)');
}

if (newtime->tm_hour < 10)
{
fprintf(fileW,"0%d", newtime->tm_hour);
}
else
{
fprintf(fileW,"%d", newtime->tm_hour);
}
fprintf(fileW,":", newtime->tm_hour);

if (newtime->tm_min < 10)
{
fprintf(fileW,"0%d", newtime->tm_min);
}
else
{
fprintf(fileW,"%d", newtime->tm_min);
}
//fprintf(fileW,":", newtime->tm_hour);

if (newtime->tm_sec < 10)
{
//fprintf(fileW,"0%d", newtime->tm_sec);
}
else
{
//fprintf(fileW,"%d", newtime->tm_sec);
}

fprintf(fileW,"-");
//fprintf(fileW,"%s",sender); /*writes*/
fprintf(fileW,"%s", myUsername); /*writes*/
fprintf(fileW,"%s","n"); /*writes*/
fprintf(fileW,"%s", message); /*writes*/
fprintf(fileW,"%s","nn"); /*writes*/
fprintf(fileW, newText); /*writes*/
fclose(fileW); /*done!*/


free(message);


purple_debug_misc("Message Writer", "received-im-msg (%s, %s, %s, %s, %d)n",
purple_account_get_username(account), sender, buffer,
(conv != NULL) ? purple_conversation_get_title(conv) : "(null)", flags);

}


static gboolean
plugin_load (PurplePlugin * plugin)
{

//void *core_handle = purple_get_core();
void *blist_handle = purple_blist_get_handle();
//void *conn_handle = purple_connections_get_handle();
void *conv_handle = purple_conversations_get_handle();
//void *accounts_handle = purple_accounts_get_handle();
//void *ciphers_handle = purple_ciphers_get_handle();
//void *ft_handle = purple_xfers_get_handle();
//void *sound_handle = purple_sounds_get_handle();
//void *notify_handle = purple_notify_get_handle();

purple_signal_connect(conv_handle, "received-im-msg", plugin, PURPLE_CALLBACK(received_im_msg_cb), NULL);
purple_signal_connect(conv_handle, "conversation-updated", plugin, PURPLE_CALLBACK(conversation_updated_cb), NULL);
purple_signal_connect(blist_handle, "buddy-signed-on", plugin, PURPLE_CALLBACK(buddy_signed_on_cb), NULL);

exporter_plugin = plugin;

return TRUE;
}

static gboolean plugin_unload(PurplePlugin *plugin)
{
NewMessage(FALSE);

//void *core_handle = purple_get_core();
void *blist_handle = purple_blist_get_handle();
//void *conn_handle = purple_connections_get_handle();
void *conv_handle = purple_conversations_get_handle();
//void *accounts_handle = purple_accounts_get_handle();
//void *ciphers_handle = purple_ciphers_get_handle();
//void *ft_handle = purple_xfers_get_handle();
//void *sound_handle = purple_sounds_get_handle();
//void *notify_handle = purple_notify_get_handle();

purple_signal_disconnect(conv_handle, "received-im-msg", plugin, PURPLE_CALLBACK(received_im_msg_cb));
purple_signal_disconnect(conv_handle, "conversation-updated", plugin, PURPLE_CALLBACK(conversation_updated_cb));
purple_signal_disconnect(blist_handle, "buddy-signed-on", plugin, PURPLE_CALLBACK(buddy_signed_on_cb));

return TRUE;
}

/* For specific notes on the meanings of each of these members, consult the C Plugin Howto
* on the website. */
static PurplePluginInfo info = {
PURPLE_PLUGIN_MAGIC,
PURPLE_MAJOR_VERSION,
PURPLE_MINOR_VERSION,
PURPLE_PLUGIN_STANDARD,
NULL,
0,
NULL,
PURPLE_PRIORITY_DEFAULT,

"core-exporter",
"SciLor's MaLotF",
"0.4",

"SciLor's Message and Last online to File",
"Dumps new messages, a new message indicator and the last onlines to files in the .purple dir (LastMessages.txt, NewMessage.txt, LastLogons.txt)",
"SciLor", /* correct author */
"", /* Website */


plugin_load,
plugin_unload,
NULL,

NULL,
NULL,
NULL,
NULL, //plugin_actions, //this tells libpurple the address of the function to call
//to get the list of plugin actions.
NULL,
NULL,
NULL,
NULL
};

static void
init_plugin (PurplePlugin * plugin)
{
}



PURPLE_INIT_PLUGIN (exporter, init_plugin, info)
 
ich habe zwar für pidgin noch keine plugins geschrieben und finde den client auch sonst nicht so prickelnd, aber du solltest velleicht mal nen debugger nehmen oder versuchen durch das bewährte cerr/cout^^ nach dem verursacher zu suchen. ich über lege grade ob ich mir den source mal anschaue.

edit:
hmm, rücke den code erstmal ein und poste mal nur die wichtigen funktionen die in frage kommen könnten. du wirt schon herausfinden welche das sind, wenn du nen buglog oder debugger nutzt.
btw., so wie du mit NULL pointern hantierst, wette ich, dass es an so einen liegen wird^^
 
Ok
NULL was könnten das denn da für Probleme sein

Code:
static char *de_tag(char *string);
static gchar * displayName (PurpleBuddy *buddy);
PurplePlugin *exporter_plugin = NULL;


static char *de_tag(char *str)
{
    // many thanks to Martin for this nice piece of code
    // de_tag removes all html/xml from a string
    // used for stripping down styled messages
    char *p, *q;
    while( (p=strchr(str, '<')) && (q=strchr(p, '>')) )
    {
            memmove(p, q+1, strlen(q));
    }
    return str;
}


Code:
static void
conversation_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type)
{
	GList *list = NULL;

	if(type == PURPLE_CONV_UPDATE_UNSEEN) {

        list=get_pending_list(1);
        if(list == NULL)
        {
            NewMessage(FALSE);
        }
        else if(list != NULL)
        {
            NewMessage(TRUE);
             g_list_free(list);
        }

    }
}

ab jetzt meine

Code:
static char *PidginPath(char *filename)
{
	char path[4096];
    /*
    strcpy(path, purple_user_dir());
    strcat(path, G_DIR_SEPARATOR_S);
    strcat(path, filename);
    */
    g_snprintf(path, sizeof(path), "%s%s%s", purple_user_dir(), G_DIR_SEPARATOR_S, filename);

    return path;
}

Code:
static void
buddy_signed_on_cb(PurpleBuddy *buddy, void *data)
{

	char oldText[100];
	char oldTextFixed[100];
	bool duplicate=FALSE;
	char newText[400];
	char currentUsername[100];

	if (buddy != NULL)
	{
        FILE *fileR;
        fileR=fopen(PidginPath("LastLogons.txt"),"a+");
        if (!fileR)
        {
            purple_debug_misc("Exporter Debugger", "Read Error in buddy_signed_on_cb");
            return;
        }

        strcpy(newText, "");
        strcpy(currentUsername, displayName(buddy));

        int x=0;
        while (x<3)
        {
            fgets(oldText, sizeof(oldText), fileR);

            strcpy(oldTextFixed, oldText);
            char *newline = strchr(oldTextFixed, '\n'); // check for trailing '\n'
            if (newline)
            {
                *newline =  '\0'; // overwrite the '\n' with a terminating null
            }


            if (currentUsername[0] == oldTextFixed[0] && currentUsername[1] == oldTextFixed[1] && strlen(currentUsername) == strlen(oldTextFixed))
            {
                duplicate = TRUE;

                int y=0;
                while (y<strlen(currentUsername) && duplicate == TRUE) {
                    if (currentUsername[y] == oldTextFixed[y])
                    {
                        //duplicate = TRUE;
                    }
                    else
                    {
                        duplicate = FALSE;
                    }
                y++;
            }
        }

            purple_debug_misc("Exporter Debugger", "-Buddyname:\"%s\"- oldText:\"%s\"-\n", currentUsername, oldTextFixed);
            strcat(newText, oldText);

            x++;
        }
        fclose(fileR);

        if (duplicate == FALSE)
        {
            FILE *fileW;
            fileW=fopen(PidginPath("LastLogons.txt"),"w+");
            if (!fileW)
            {
                purple_debug_misc("Exporter Debugger", "Write Error in buddy_signed_on_cb");
                return;
			}
            fprintf(fileW,"%s",displayName(buddy));
            fprintf(fileW,"%s","\n");
            fprintf(fileW,"%s",newText);
            fclose(fileW);
        }
        else
        {
        	purple_debug_misc("Exporter Debugger", "Duplicate FOUND!");
        }
	}

}

GList *get_pending_list(guint max) {
	GList *l_im = NULL;


	l_im = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM, PIDGIN_UNSEEN_TEXT, FALSE, max);

	//l_im = purple_get_ims;

	if (l_im != NULL)
	{
		return l_im;
	}

}


Code:
static void
NewMessage(gboolean state)
{
    FILE *fileW;
    fileW = fopen(PidginPath("NewMessage.txt"),"w+");
    if (!fileW)
    {
        purple_debug_misc("Exporter Debugger", "Write Error in NewMessage");
        return;
    }

    if(state)
    {
    	fprintf(fileW,"%s","1");
		//fputs("1", fileW);
	}
	else
	{
		fprintf(fileW,"%s","0");
		//fputs("0", fileW);
	}
    fclose(fileW); /*done!*/
}


Code:
static void
received_im_msg_cb(PurpleAccount *account, char *sender, char *buffer,
				   PurpleConversation *conv, PurpleMessageFlags flags, void *data)
{
	char oldText[10000];
	char newText[1000];
	char myUsername[10000];
	char *message=strdup(buffer);

    struct tm *newtime;
    time_t long_time;
    time( &long_time );
    newtime = localtime( &long_time );
    //newtime->tm_hour, newtime->tm_min, newtime->tm_sec

	de_tag(message);

        FILE *fileR;
        fileR=fopen(PidginPath("LastMessage.txt"),"a+");

    	if (!fileR)
        {
			purple_debug_misc("Exporter Debugger", "Read Error in received_im_msg_cb");
			return;
		}

          char line [1000]; /* or other suitable maximum line size */
          strcpy(oldText, "");
          while (fgets(line, sizeof(line), fileR) != NULL) /* read a line */
          {
  			strcat(oldText, line);
          }
          fclose(fileR); /*done!*/

       		int x=0;
            while (x<1000)
            {
            newText[x] = oldText[x];
            x++;
            }

        FILE *fileW;
        fileW=fopen(PidginPath("LastMessage.txt"),"w+");
        if (!fileW)
        {
       		purple_debug_misc("Exporter Debugger", "Write Error in received_im_msg_cb");
        	return;
        }
        
        strcpy(myUsername, purple_conversation_get_title(conv)); 
		
		if (myUsername == NULL)
		{
			strcpy(myUsername, '(null)'); 
		}
		
        if (newtime->tm_hour < 10)
        {
            fprintf(fileW,"0%d", newtime->tm_hour);
        }
		else
		{
			fprintf(fileW,"%d", newtime->tm_hour);
		}
		fprintf(fileW,":", newtime->tm_hour);

        if (newtime->tm_min < 10)
        {
            fprintf(fileW,"0%d", newtime->tm_min);
        }
		else
		{
			fprintf(fileW,"%d", newtime->tm_min);
		}
		//fprintf(fileW,":", newtime->tm_hour);

        if (newtime->tm_sec < 10)
        {
            //fprintf(fileW,"0%d", newtime->tm_sec);
        }
		else
		{
			//fprintf(fileW,"%d", newtime->tm_sec);
		}

        fprintf(fileW,"-");
        //fprintf(fileW,"%s",sender); /*writes*/
        fprintf(fileW,"%s", myUsername); /*writes*/
        fprintf(fileW,"%s","\n"); /*writes*/
        fprintf(fileW,"%s", message); /*writes*/
        fprintf(fileW,"%s","\n\n"); /*writes*/
        fprintf(fileW, newText); /*writes*/
        fclose(fileW); /*done!*/


	free(message);


	purple_debug_misc("Message Writer", "received-im-msg (%s, %s, %s, %s, %d)\n",
					purple_account_get_username(account), sender, buffer,
					(conv != NULL) ? purple_conversation_get_title(conv) : "(null)", flags);

}
 
oj je, also ich habe jetzt nur flüchtig gelesen.
>Ist der snprintf richtig?, kann ich die 3 Variablen einfacher zusammenführen?
ich denke, du kannst std::stringsverwenden und den path oder was das machen soll einfach zusammensetzen...
str = str1 + str2 + str2
oder du verwendest stringstreams und schreibst die chars bis zum nullterminator zusammen.

>Wieder Textdatei
FILE *fileW;
fileW = fopen(PidginPath("NewMessage.txt"),"w+");
if (!fileW)

das ist ein pointer und kein bool. wenn das fileW NULL sein sollte stürzts vielleicht ab.
korrigier das erstmal und teste (kommt sehr oft vor). wenn das prog dann immernoch abschmiert dann bau mal couts ein oder nimm mal nen debugger.
 
Original von petrLo
>Wieder Textdatei
FILE *fileW;
fileW = fopen(PidginPath("NewMessage.txt"),"w+");
if (!fileW)

das ist ein pointer und kein bool. wenn das fileW NULL sein sollte stürzts vielleicht ab.
korrigier das erstmal und teste (kommt sehr oft vor). wenn das prog dann immernoch abschmiert dann bau mal couts ein oder nimm mal nen debugger.

Das funktioniert schon so, da !fileW genau dann true ist, wenn fopen NULL zurückgibt, was es im Fehlerfall auch tun sollte: http://www.cplusplus.com/reference/clibrary/cstdio/fopen.html
Daher sollte ein solcher Fehler dadurch richtig abgefangen werden.

Was mir aber noch aufgefallen ist, ist folgendes(Habe aber auch nicht alles gelesen):
Code:
static char *PidginPath(char *filename)
{
	char path[4096];
    /*
    strcpy(path, purple_user_dir());
    strcat(path, G_DIR_SEPARATOR_S);
    strcat(path, filename);
    */
    g_snprintf(path, sizeof(path), "%s%s%s", purple_user_dir(), G_DIR_SEPARATOR_S, filename);

    return path;
}
Du legst hier deinen Buffer auf dem Stack an(path) und gibst dann einen Pointer darauf zurück, was so nicht unbedingt funktioniert, da du dich nicht darauf verlassen kannst, dass Variablen auf dem Stack nach dem Verlassen erhalten bleiben. Stattdessen solltest du den Speicher lieber per malloc reservieren.
 
@Lesco
du hast mit dem ndefinierten verhalten vollkommen recht. das objekt wird zerstört und der rückagabewert führt zu undefierten verhalten
 
Danke für die Antworten!

Code:
	purple_debug_misc("Exporter Debugger", "PidginPath :D");
	char *path = malloc(1024);

    return path;

hab ich jetzte draus gemacht, leider immer noch abstürze, ist das überhaupt richtig?!

und ich sehe in meiner log das es viele read/write probs gibt.
Abstürze des Plugins gibt es immer wenn Pidgin Angemeldet war, aus dem Internet war und sich wieder anmelden will

Code:
D:\Programme\Pidgin\pidgin.exe caused an Access Violation at location 685fffb3 in module D:\Programme\GTK\2.0\bin\libglib-2.0-0.dll Reading from location 000afe48.

Registers:
eax=00000001 ebx=003e5bc0 ecx=000afe48 edx=040fa1a8 esi=00000001 edi=003e5bb8
eip=685fffb3 esp=0022eef0 ebp=0022ef48 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010206

Call stack:
         D:\Programme\GTK\2.0\bin\libglib-2.0-0.dll [2.16.6.0]
685FFFB3 D:\Programme\GTK\2.0\bin\libglib-2.0-0.dll  g_slice_alloc
685DB34C D:\Programme\GTK\2.0\bin\libglib-2.0-0.dll  g_hash_table_lookup_extended
6889041E D:\Programme\Pidgin\liboscar.dll  snachandler  c:/devel/pidgin-devel/pidgin-2.5.2/libpurple/protocols/oscar/family_oservice.c:340
688949F6 D:\Programme\Pidgin\liboscar.dll  flap_connection_recv_cb  c:/devel/pidgin-devel/pidgin-2.5.2/libpurple/protocols/oscar/flap_connection.c:739
         D:\Programme\Pidgin\pidgin.dll [2.5.2.0]
64A77942 D:\Programme\Pidgin\pidgin.dll  pidgin_io_invoke  c:/devel/pidgin-devel/pidgin-2.5.2/pidgin/gtkeventloop.c:82
         D:\Programme\GTK\2.0\bin\libglib-2.0-0.dll [2.16.6.0]
685E7077 D:\Programme\GTK\2.0\bin\libglib-2.0-0.dll  g_main_context_dispatch
685E854B D:\Programme\GTK\2.0\bin\libglib-2.0-0.dll  g_main_context_acquire
685E873A D:\Programme\GTK\2.0\bin\libglib-2.0-0.dll  g_main_loop_run
         D:\Programme\GTK\2.0\bin\libgtk-win32-2.0-0.dll [2.12.12.0]
6188974E D:\Programme\GTK\2.0\bin\libgtk-win32-2.0-0.dll  gtk_main
         D:\Programme\Pidgin\pidgin.dll [2.5.2.0]
64A906C1 D:\Programme\Pidgin\pidgin.dll  pidgin_main  c:/devel/pidgin-devel/pidgin-2.5.2/pidgin/gtkmain.c:895
         D:\Programme\Pidgin\pidgin.exe [2.5.2.0]
00402362 D:\Programme\Pidgin\pidgin.exe  WinMain  c:/devel/pidgin-devel/pidgin-2.5.2/pidgin/win32/winpidgin.c:736
004029AA D:\Programme\Pidgin\pidgin.exe  WinMain  c:/devel/pidgin-devel/pidgin-2.5.2/pidgin/win32/winpidgin.c:523
00401247 D:\Programme\Pidgin\pidgin.exe
004012B8 D:\Programme\Pidgin\pidgin.exe
         C:\WINDOWS\system32\kernel32.dll [5.1.2600.5512]
7C817067 C:\WINDOWS\system32\kernel32.dll  RegisterWaitForInputIdle
hier die das Report file von pidgin bei abstürzen


Code:
(22:24:39) Exporter Debugger: start conversation_updated_cb
(22:24:39) Exporter Debugger: end conversation_updated_cb
(22:24:39) pidgin-encryption: Using pre-existing menu icon for conv 03F46190, win 03FD2220, item 03FC7068
(22:24:39) Exporter Debugger: start conversation_updated_cb
(22:24:39) Exporter Debugger: start get_pending_list
(22:24:39) Exporter Debugger: end get_pending_list
(22:24:39) Exporter Debugger: start NewMessage
(22:24:39) Exporter Debugger: PidginPath :D before 
(22:24:39) Exporter Debugger: PidginPath :D return 
(22:24:39) Exporter Debugger: Write Error in NewMessage
das war das vor nem Absturz in meiner Log, die letzten male immer
ist das richtig:
Code:
	purple_debug_misc("Exporter Debugger", "start NewMessage\n");
    FILE *fileW;
    fileW = fopen(PidginPath("NewMessage.txt"),"w+");
    if (!fileW)
    {
        purple_debug_misc("Exporter Debugger", "Write Error in NewMessage\n");
        return;
    }
müsste eigl richtig sein, da wenn ich die routine rausnehm es trotzdem abschmeirt

Ich hab noch weiter geschaut und durch die Logs gesehen, das es hier sein muss, weil
(22:24:39) Exporter Debugger: start conversation_updated_cb
geführt wird, dann das newMessage, welches ja ok sein muss.

Code:
conversation_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type)
{
purple_debug_misc("Exporter Debugger", "start conversation_updated_cb\n");
	GList *list = NULL;

	if(type == PURPLE_CONV_UPDATE_UNSEEN) {

        list=get_pending_list(1);
        if(list == NULL)
        {
            NewMessage(FALSE);
        }
        else if(list != NULL)
        {
            NewMessage(TRUE);
             g_list_free(list);
        }

    }
purple_debug_misc("Exporter Debugger", "end conversation_updated_cb\n");
}
edit:der Fehler lag bei der g_list_free hab ich auskommentiert -> ok
Jetzt stürzt Pidgin nichtmehr mit ner Fehlermeldung ab, sonder ist einfach weg

Weiter gehts
buddy_signed_on ist es auch nicht :(
 
Zurück
Oben