Bug 1068781 - glfs_read fails for large read
Summary: glfs_read fails for large read
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: libgfapi
Version: 3.4.2
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: GlusterFS Bugs list
QA Contact: Sudhir D
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-21 20:51 UTC by Joel Rausch
Modified: 2014-10-14 14:18 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-10-14 14:18:21 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)
Program capable of reproducing problem (1.53 KB, text/plain)
2014-02-21 20:51 UTC, Joel Rausch
no flags Details

Description Joel Rausch 2014-02-21 20:51:17 UTC
Created attachment 866271 [details]
Program capable of reproducing problem

Description of problem:

Reading a >32MB file with a single glfs_read call can cause a segmentation fault in the iov_copy function. It appears that some, but not all of the iov_base pointers were invalid.

Core was generated by `./tst'.
Program terminated with signal 11, Segmentation fault.
#0  __memcpy_ssse3_back ()
    at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:1579
1579	../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: No such file or directory.
	in ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
(gdb) bt
#0  __memcpy_ssse3_back ()
    at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:1579
#1  0x00007f3634b0fa7e in iov_copy (dst=0x7fff37ada3e0, dcnt=1, src=
    0x7f36200e3b70, scnt=272) at ../../libglusterfs/src/common-utils.h:386
#2  0x00007f3634b112e8 in glfs_preadv (glfd=0x633f90, iovec=0x7fff37ada3e0, 
    iovcnt=1, offset=0, flags=0) at glfs-fops.c:482
#3  0x00007f3634b113c9 in glfs_read (glfd=0x633f90, buf=0x7f361ca45010, count=
    35651584, flags=0) at glfs-fops.c:511
#4  0x00000000004012f4 in main ()
    at /home/TRADEBOT/jrausch/source/tradebot/vc/tst/tst.cpp:47
(gdb) f 1
#1  0x00007f3634b0fa7e in iov_copy (dst=0x7fff37ada3e0, dcnt=1, src=
    0x7f36200e3b70, scnt=272) at ../../libglusterfs/src/common-utils.h:386
386			memcpy (dst[d_i].iov_base + d_ii, src[s_i].iov_base + s_ii,
(gdb) p (char*) src[s_i].iov_base
$1 = 0x7f362aaf1000 <Address 0x7f362aaf1000 out of bounds>
(gdb) p (char*) src[s_i - 1].iov_base
$2 = 0x7f3616f00000 ""
(gdb) p (char*) src[s_i + 1].iov_base
$3 = 0x7f362aa71000 <Address 0x7f362aa71000 out of bounds>
(gdb) p (char*) src[s_i + 2].iov_base
$4 = 0x7f362aab1000 <Address 0x7f362aab1000 out of bounds>
(gdb) p s_i
$5 = 47
(gdb) p scnt
$6 = 272

Comment 2 Kaleb KEITHLEY 2014-10-14 14:18:21 UTC
gfapi was substantially updated in 3.4.3. If you are using 3.4.3 or later and this is still a problem please file a new bugreport. Thanks


Note You need to log in before you can comment on or make changes to this bug.