[Top][All Lists]

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

Re: [GNUnet-developers] Crashes when trying to write fsui client

From: Christian Grothoff
Subject: Re: [GNUnet-developers] Crashes when trying to write fsui client
Date: Sun, 11 Sep 2005 16:15:49 -0700
User-agent: KMail/1.7.2

You must first initialize gnunet-util.  Add a line like this:

if (OK != initUtil(argc, argv, &parser)) exit(-1);

where "parser" should be a function that parses the command line arguments 
(see any main gnunet-file for an example).

initUtil creates various locks and, most importantly, reads the configuration.
In parser, you should also put a call:


this tells the system that you are running a client (i.e. default to reading 
~/.gnunet/gnunet.conf, and not /etc/gnunetd.conf -- also has an impact on 
other minor things).

Hope this helps!


On Sunday 11 September 2005 04:30, Michael Donaghy wrote:
> I have been able to compile and link FSUI programs, but when I go to run
> them I get errors like this.
> Failure at configuration.c:640.
> Failure at configuration.c:664.
> You must specify a directory for user-data under 'GNUNETGNUNET_HOME' at the
> beginning of the configuration file.
> This happens when trying to use FSUI_start, even a simple "hello world"
> client crashes:
> #include <stdio.h>
> #include <stdlib.h>
> #include <gnunet_fsui_lib.h>
> void cb(void * cls, const FSUI_Event * event)
> {
> }
> int main(int argc, char *argv[])
> {
>         FSUI_EventCallback callback;
>         struct FSUI_Context *context;
>         callback = cb;
>         context = FSUI_start("gnunetcurse",NO,callback,0L);
>         FSUI_stop(context);
>   return EXIT_SUCCESS;
> }.
> My config file is there and works fine with gnunet-gtk (which wasn't
> running when I tried this). If I put other calls in first I get the same
> crash but in different places:
> readConfigFile("/home/michael/.gnunet/gnunet.conf"); results in
> Failure at configuration.c:785.
> Failure at configuration.c:823.
> Failure at configuration.c:640.
> Failure at configuration.c:664.
> Failure at configuration.c:751.
> Failure at configuration.c:765.
> Failure at cron.c:437.
> while triggerGlobalConfigurationRefresh(); gives just
> Failure at cron.c:437.
> I notice that all the failures seem to be at MUTEX_LOCK() calls. As I
> understand the code, this is happening because pthread_mutex_lock() is
> returning non-zero, but my knowledge of pthreads isn't good enough to
> understand why this is happening. Does anyone know what I'm doing wrong, or
> have I found a gnunet bug?
> Thanks
> Mikey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]