Bug#313219: gnome-vfs2 crashes in read_entire_file with HAL and Linux 2.4

Ivan Wong Ivan Wong <email@ivanwong.info>, 313219@bugs.debian.org
Wed, 15 Jun 2005 00:48:38 +0800


This is a multi-part message in MIME format.
--------------090309010005090908040807
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi,
> Odd, when creating a simple sample program that calls posix_fadvise it works
> fine on both 2.4 and 2.6 kernels.
Attached please find the source of my testing program. In fact, it
actually does:

int main()
{
        int fd;

        fd = open("a.c", 0);
        posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
        close(fd);
}

If I compile with `gcc -D_POSIX_C_SOURCE=200112L a.c`, no error.

I tried to build it using the same environment as gmoe-vfs2's modules by:

1. copy a.c to gnome-vfs2-2.10.1/modules
2. adding these two lines to Makefile.am

bin_PROGRAMS = a
a_SOURCES = a.c

3. `make a`
4. `./a` -> Segmentation fault

Now it's obviously that it's something to do with the building
configuration.

> Does gnomevfs-cat /etc/debian_version work for you with debians gnome-vfs 2.10
> or does that also crash ?
It crashes when I re-use the original libfile.so

Cheers,
-- 
Ivan, Wong Yat Cheung  <email@ivanwong.info>
GPG: 1024D/7775FDBB: CE88 DBE0 5AF3 D4AC 91F5  6C0E 2C84 B2AD 7775 FDBB

--------------090309010005090908040807
Content-Type: text/plain;
 name="a.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="a.c"

#ifdef HAVE_CONFIG_H
#include <config.h>

#include <libgnomevfs/gnome-vfs-cancellation.h>
#include <libgnomevfs/gnome-vfs-context.h>
#include <libgnomevfs/gnome-vfs-i18n.h>
#include <libgnomevfs/gnome-vfs-method.h>
#include <libgnomevfs/gnome-vfs-mime.h>
#include <libgnomevfs/gnome-vfs-module-shared.h>
#include <libgnomevfs/gnome-vfs-module.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libgnomevfs/gnome-vfs-mime.h>
#include <libgnomevfs/gnome-vfs-monitor-private.h>
#include <libgnomevfs/gnome-vfs-private-utils.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <dirent.h>
#include <errno.h>
#include <glib/gstrfuncs.h>
#include <glib/gutils.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <utime.h>
#include <string.h>
#endif
#include <fcntl.h>

int main()
{
	int fd;

	fd = open("a.c", 0);
	posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
	close(fd);
}


--------------090309010005090908040807--