This forum has been archived. All content is frozen. Please use KDE Discuss instead.

File size limit exceeded

Tags: None
(comma "," separated)
imported4-Nils
Registered Member
Posts
3
Karma
0

File size limit exceeded

Thu Dec 01, 2005 10:50 pm
Hi, and thanks for great app.

However I suspect a previously fixed bug might have been re-introduced.

KTorrent crashes, just dissapears without any notice. When investigating this further using strace, I get an indication that the cause is File size limit exceeded:

Output from strace:

_llseek(51, 2147479552, [2147479552], SEEK_SET) = 0
read(51, "\0\0\1\272D\351\266\353=}\1\211\303\370\0\0\1\340\7\354"..., 4095) = 4095
_llseek(51, 2145386496, [2145386496], SEEK_SET) = 0
write(51, "\0\0\1\272D\351}\344\205\373\1\211\303\370\0\0\1\340\7"..., 2097152) = 2097151
write(51, "\300", 1) = -1 EFBIG (File too large)
--- SIGXFSZ (File size limit exceeded) @ 0 (0) ---
Process 11142 detached


The file in question (51) is exactly 2.0GB in size after the crash.

Details: Running SVN version 484787 on ext3 filesystem, with no user limits on file size (ulimit -a). System is Debian/SID (KDE 3.3.2).

Regards!
George
Moderator
Posts
5421
Karma
1

Fri Dec 02, 2005 7:09 pm
It's clearly a write call which fails, because the file is to big ...

yet there is no limit.

After the first write call, all but one byte is written, and the following write call, which tries to write that 1 byte fails.

I don't get it, if there is no limit, why does it complain that the filesize is to large ?
imported4-Nils
Registered Member
Posts
3
Karma
0

Sat Dec 03, 2005 9:25 am
It seems that for some reason that fopen() does not use 64-bits, changing fopen() to fopen64() fixes the problem for me.

Could it be something missed by configure ?

Code: Select all
Index: libktorrent/util/file.cpp
===================================================================
--- libktorrent/util/file.cpp   (revision 485032)
+++ libktorrent/util/file.cpp   (working copy)
@@ -44,7 +44,7 @@
                if (fptr)
                        close();

-               fptr = fopen(file.local8Bit(),mode.ascii());
+               fptr = fopen64(file.local8Bit(),mode.ascii());
                return fptr != 0;
        }

[/code]
George
Moderator
Posts
5421
Karma
1

Sat Dec 03, 2005 12:00 pm
This is what configure does on my (64bit) system :
...
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
...

configure.in.in contains the line :
AC_SYS_LARGEFILE

which should handle everything properly (but it obviously doesn't)

Could you guys post what the output of your configure produces ? The lines in question are located some 10 lines above the section where the Makefiles get created.
imported4-Nils
Registered Member
Posts
3
Karma
0

Sat Dec 03, 2005 12:24 pm
Thanks George

Here is the output from my system:

...
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGE_FILES value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for fseeko... yes
checking for fseeko64... yes
checking for ftello64... yes
...

Now after configure is done, "config.h" is empty (except for the usual comment line at the top).

At the end of config.log, I have
...
## ----------- ##
## confdefs.h. ##
## ----------- ##

#define HAVE_CRYPT 1
#define HAVE_DLFCN_H 1
...
#define _FILE_OFFSET_BITS 64
...

What's strange is that I can't find any other occurences of FILE_OFFSET_BITS in my build folder, but to me it seems that this should be an option to the compiler passed through e.g. CXXFLAGS ?


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Google [Bot], Sogou [Bot]