[Xastir] Can't write objects...

Mike Markowski mm at UDel.Edu
Mon Nov 15 13:23:50 EST 2004


On Mon 15-Nov-04 at 1301 EST, Curt, WE7U wrote:
> On Mon, 15 Nov 2004, Mike Markowski wrote:
> 
> > Has anyone else seen this when starting xastir?
> >
> >    Couldn't write objects to map index file: /home/mm/.xastir/config/map_index.sys
> >    Caught Segfault! Xastir will terminate
> >    Last incoming line was:
> >    09:35:39
> > [...]
> 
> About the only thing I can think of is to check the
> permissions/ownership on /home, /home/mm, and /home/mm/.xastir
> directories to see if the application can get to the file.
> 
> Perhaps something funny with gentoo and how they handle the SUID bit
> on executables?  Try taking that bit away from /usr/local/bin/xastir
> to see if that makes a difference.

Something strange is definitely going on.  Permissions ar ok, but it
seems that fprintf is always returning '1' even when it successfully
writes data.  In maps.c at around line 4940 I modified the code while
debugging to this:

            printf("'%s'\n", out_string);
            num1 = fprintf(f,"%s",out_string);
            num2 = (int)strlen(out_string);
            printf("num1 = %d, num2 = %d\n", num1, num2);fflush(stdout);
            if (num1 < num2) {
        /*
            if (fprintf(f,"%s",out_string) < (int)strlen(out_string)) {
        */
                // Failed to write
                fprintf(stderr,"Couldn't write objects to map index file: %s\n",
                    MAP_INDEX_DATA);
                //current = NULL; // All done
            }
            // Set up pointers for next loop iteration
            last = current;
            current = current->next;
            printf("here\n");fflush(stdout);

Output:

'0000000000,0000000000,0000000000,0000000000,00000,0,0,00000,00000,GPS/
'
num1 = 1, num2 = 71
Couldn't write objects to map index file: /home/mm/.xastir/config/map_index.sys
here
[...and similar for ecah line of map_index.sys...]

And xastir runs!  Disregarding my messy debug mods, notice I only
needed to comment out the 'current = NULL;' assignment.  Even though
the fprintf returns 1, it actually has succeeded in writing the data
to map_index.sys.  I don't understand this at all...  A glibc bug??

At least it's running again while I track down the root cause.

	Thanks!
	Mike  AB3AP



More information about the Xastir mailing list