[Bug 1126429] New: gio mount smb can result n corrupted files if they are opened in 'w+' mode
http://bugzilla.opensuse.org/show_bug.cgi?id=1126429 Bug ID: 1126429 Summary: gio mount smb can result n corrupted files if they are opened in 'w+' mode Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.0 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: GNOME Assignee: bnc-team-gnome@forge.provo.novell.com Reporter: wagner-thomas@gmx.at QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- I have a network share on a Windows 2012 server and openSUSE 15.0 as well as Tumbleweed clients. I use "gio mount smb://server/share" to access the files on the share. While most applications can read/write well on the mounted share, some application crashed or produced corrupted files, e.g. https://github.com/h5py/h5py/issues/1170 I could reproduce the problem using the 'w+' file access mode (open file for reading and writing). Seeking in the file once forth and then back again will produce errors on subsequent reads. At the end of this bugreport, I listed a small C and a Python3 example to reproduce the error. Running the C example, wrong data is read, whereas the Python3 example quits with OSError due to unsuccessful reads. When I mount the share via mount.cifs the tests work as intended. So there is no problem with the samba server but with "gio mount". The problem appears on Leap 15.0 as well as latest Tumbleweed. --------------------------------------------------------------------- #include<stdio.h> void main() { FILE *fp; char ch; fp=fopen("testfile_c.bin", "w+"); if(fp==NULL) printf("file cannot be opened"); else { fseek(fp, 1000, 0); fwrite("test", 1, 4,fp); fseek(fp, 0, 0); fwrite("test", 1, 4,fp); fseek(fp, 0, 0); ch = getc(fp); printf("%c",ch); /* "t" should appear, but only garbage chars appears */ fseek(fp, 0, 0); fwrite("abcd", 1, 4,fp); fseek(fp, 0, 0); ch = getc(fp); printf("%c",ch); /* "a" should appear, but only garbage chars appears */ printf("\n"); } fclose(fp); } --------------------------------------------------------------------- with open('testfile_py.bin', 'w+b') as f: f.seek(1000) f.write(b'test') f.seek(0) f.write(b'test') f.seek(0) print(f.read(5)) f.seek(0) f.write(b'abcd') f.seek(0) print(f.read(10)) # segfault during read --------------------------------------------------------------------- -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1126429 http://bugzilla.opensuse.org/show_bug.cgi?id=1126429#c1 Thomas Wagner <wagner-thomas@gmx.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|Leap 15.0 |Leap 15.2 --- Comment #1 from Thomas Wagner <wagner-thomas@gmx.at> --- This bug is still present in Leap 15.2 and Tumbleweed 20201205. -- You are receiving this mail because: You are on the CC list for the bug.
participants (2)
-
bugzilla_noreply@novell.com
-
bugzilla_noreply@suse.com