Libpurple can't connect - purple_presence_is_online failed
Asked Answered
N

4

29

I am writing myself a small jabber client. I have used code from Libpurple.com and on Linux (Mint) everything works fine. With libraries linked program compiles with no errors and receives messages.

But when I use the same code on Windows 7, link all neccessary libraries and with Cygwin installed and PATH set, program compiles with no errors, but then NetBeans (IDE I use in Windows and Linux) says 'RUN FAILED'

When I run program from windows command line it says:

libpurple initialized. Running version 2.10.7.
** <myclient.exe:6500>: CRITICAL **: purple_presence_is_online: assertion 'presence != NULL' failed

and then it freeze. I already tried going back to libpurple 2.10.3 (the version I have in Linux) but still the same. Turning firewall off did'n help either.

Newmann answered 5/5, 2013 at 15:22 Comment(8)
You should enable the logging facility (developer.pidgin.im/wiki/CHowTo/DebugAPIHowTo) and try to find out why purple_presence_is_online got a NULL ptrStarlike
You are going to have to post more information. A different environment can introduce race conditions or other problems. Obviously libpurple isn't in the state you are expecting and you'd need to look at what needs guarding to protect that.Vendee
@Starlike How should I do that? I added purple_debug_set_enabled(TRUE) to my main function but not a single debug info on output. The link you posted shows how I can log my own debug messages...but that's not the thing I need, is it?Newmann
You really need to provide more information. Apart from "on myclient.exe:6500, presence is NULL", we don't have much to go on.Schoolboy
My crystal ball says the error is on line 42 (i.e., without seeing the relevant source, all we can do is take wild guesses).Automatize
Is your windows 7 firewall opened ?Ditchwater
@Ditchwater I don't remember. I moved that project to "one day I will finish it" and I don't have Windows 7 anymore.Newmann
I would check why presence is NULL, did you check the caller graph ? pidgin.sourcearchive.com/documentation/2.8.0-1/…Marj
S
1

Few things to note:

  1. Each OS has its own issues when a program is deployed. So, ignore the fact that your client is working in Linux. Start with the fact, that your program / libpurple didn't work in Windows.

  2. Try to see if there is a client ( pidgin etc ) which uses the same code path ( the function where the assertion fails ), and succeeds. This is to do basic sanity check that the libpurple code is in fact usable in that environment ( Cygwin )

  3. If there is any traffic between your client and the server, try getting a wireshark traffic dump, and compare it between working ( Linux ) and failing ( Cygwin ) environment.

Selfsacrifice answered 31/3, 2015 at 7:40 Comment(0)
H
0

Why not use a simple XMPP client library like GLOOX (http://camaya.net/gloox) instead of libPurple. GLOOX is a cross platform library that do not need CYGWIN on Windows to compile. And its complete, providing implementation for all the essentail XMPP estensions.

However, if you want to connect to other non-XMPP networks like Yahoo, Facebook, then libPurple will definitely is the answer.

Hygrograph answered 7/3, 2015 at 2:20 Comment(0)
H
0

Since your issue is hard to reproduce, I'd suggest you use the debugger to investigate where that "presence" pointer comes from, and which code block sets it to NULL. Then you could ask "why purple_stupid_function() returns a NULL pointer" which is much easier to answer.

Hostetter answered 9/3, 2015 at 12:45 Comment(0)
O
0

The last time I looked at LibPurple (years ago) I could only get it working with MinGW, not Cygwin.

Odense answered 9/3, 2015 at 21:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.