Inkview refuses to open a SVG file with a large inode number
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
New
|
Medium
|
Unassigned |
Bug Description
I have stumbled into a weird bug that Inkview refuses to open a random SVG
file on a Samba-mounted filesystem (`/mnt/wspace` is on remote machine):
$ inkview /mnt/wspace/
could not open file /mnt/wspace/
$
This file can be opened normally with Inkscape, or other programs like
Eye of MATE, GNOME rsvg-view-3, and Debian Iceweasel. If the file was
copied to local filesystem first, Inkview will also open it successfully.
This SVG file was created using Inkscape 0.46-2.lenny2 (from Debian GNU/Linux
5.0 "Lenny" i386), and is also attached for reference.
The remote filesystem in question is FAT32, exported from a machine running
Windows XP Professional SP3 via SMB protocol.
Inkscape: 0.48.3.1-1.3 (debian)
Samba: 2:3.6.6-6+deb7u4 (debian)
cifs-utils: 2:5.5-1 (debian)
System: Debian GNU/Linux 7.0 "Wheezy" i386
tags: | added: inkview |
tags: | added: code-design |
Changed in inkscape: | |
importance: | Undecided → Medium |
A closer look on Inkview source code (both current rev 14476 16-Nov-2015 and bazaar. launchpad. net/~inkscape. dev/inkscape/ trunk/view/ head:/src/ inkview. cpp#L240
0.48.3.1-1.3 debian) shows that the error message is rooted from a `stat()`
call check in `main()` function that is used for pre-checking that the file could be opened:
http://
I have used `stat` command on the file, and found nothing particularly striking:
$ stat /mnt/wspace/ illustrations/ random/ bucket. svg illustrations/ random/ bucket. svg'
File: `/mnt/wspace/
Size: 6191 Blocks: 32 IO Block: 16384 regular file
Device: 13h/19d Inode: 26540031872 Links: 1
Access: (0666/-rw-rw-rw-) Uid: ( 1000/ window) Gid: ( 1000/ window)
Access: 2014-11-19 00:00:00.000000000 +0700
Modify: 2014-06-02 16:42:26.000000000 +0700
Change: 1940-10-24 09:26:18.955161600 +0700
Birth: -
$
So I wrote a simple C program that imitate how Inkview uses `stat()` call:
$ ./teststat /mnt/wspace/ illustrations/ random/ bucket. svg
teststat: stat failed: Value too large for defined data type
$
From the result, it seems that the issue is simply triggered by a large OFFSET_ BITS=64` macro). The file itself could still
inode number (>2147483647), which choked `stat()` on a 32-bit Inkview build
(which doesn't use `_FILE_
be opened using a normal `open()` call, and this seems to be the reason
that Inkscape itself is not affected.
This sample `teststat` C program is also attached.
Note: I have searched entire current Inkscape/Inkview code, and found neither SOURCE` nor `_FILE_ OFFSET_ BITS`, so I assume that they are not used.
`_LARGEFILE64_
Inkscape: 0.48.3.1-1.3 (debian)
Samba: 2:3.6.6-6+deb7u4 (debian)
cifs-utils: 2:5.5-1 (debian)
System: Debian GNU/Linux 7.0 "Wheezy" i386