bugdavfs2 - Bugs: bug #56286, segmentation fault during umount

 
 

bug #56286: segmentation fault during umount

Submitter:  None
Submitted:  Wed 08 May 2019 05:47:41 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  _71007
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 13 Nov 2019 12:05:49 PM UTC, comment #7: 

Thank you!

denny <brunhilde>
Wed 13 Nov 2019 08:36:32 AM UTC, comment #6: 

Great, thank you very much. The fix works for me :)

Anonymous
Mon 11 Nov 2019 05:01:18 PM UTC, comment #5: 

I mixed this bug with another related bug in branch MAIN because I only lazily read your report. Sorry.

I now use Option 'm' instead of 'a' in function fscanf. The reason why I created this bug may be explained by the following text from the man page of fscanf (3):

" The 'a' assignment-allocation modifier
       Originally,  the  GNU C library supported dynamic allocation for string
       inputs (as a nonstandard extension) via the a character.  (This feature
       is  present  at least as far back as glibc 2.0.)  Thus, one could write
       the following to have scanf() allocate a buffer for  an  input  string,
       with a pointer to that buffer being returned in *buf:

           char *buf;
           scanf("%as", &buf);

       The  use  of  the letter a for this purpose was problematic, since a is
       also specified by the ISO C standard as a synonym for f (floating-point
       input).   POSIX.1-2008  instead specifies the m modifier for assignment
       allocation (as documented in DESCRIPTION, above)."

The bug is fixed in the CVS-sources. I intend to do a bugfix release soon, but first want to fix at least one other bug.

Hello Denny:
Seems that the bug you experience is indeed the same bug. I was wrong about this.

Werner

- <_71007>
Sun 10 Nov 2019 12:29:33 PM UTC, comment #4: 

Sorry I do not understand what you try to say with the sentence: "The bug you reported is not in this release (never was there)".
If I download the released version from your download page, then the source code is exactly what I reported in the original bug report. Even the compiler complains with a warning about that line:

umount_davfs.c: In function ‘main’:
umount_davfs.c:153:33: warning: format ‘%a’ expects argument of type ‘float *’, but argument 3 has type ‘char **’ [-Wformat=]
  153 |     if (!file || fscanf(file, "%a[0-9]", &pid) != 1 || !pid) {
      |                                ~^        ~~~~
      |                                 |        |
      |                                 float *  char **

I will also attach a strace output for you.


(file #47831)

Anonymous
Wed 06 Nov 2019 10:53:52 AM UTC, comment #3: 

Branches in the CVS-repository
------------------------------
This is indead confusing.

Branch MAIN
Some years ago I started big changes in MAIN. Meanwhile this project stalled and I am not sure whether to continue or not. MAIN is not fit for production use.
The bug you reported was introduced during this changes.

Branch rel-1-4-6
When I needed to fix bugs in the released version but the changes in MAIN where far from usable, I started branch re-1-4-6. All recent releases are from this branch (it should be labeled MAIN but isn't). Only use this branch for any bug fixes. The bug you reported is not in this release (never was there).

Hello Denny:
When version 1.5.5 crashes at umount it is definitely not this bug. Please open a new item for your problem.

Please run command
strace /sbin/umount.davfs <mountpoint>
and attach the output.

If you mount with root privileges (sudo) you must be root to run this command. Don't use sudo, it might cause problems with strace.

Werner

- <_71007>
Fri 01 Nov 2019 09:23:48 AM UTC, comment #2: 


comment #1:

> I also get segmentation fault when umounting my egroupware webdav share since updating to davfs2 1.5.5.
>
> I use the following command to mount:
> sudo mount -t davfs -o uid=myname,gid=users https://path/to/webdav/ /home/myname/Documents/mountpoint/
>
>

Just opened an account, so you can request any additional info if needed. I am running the client on KUbuntu 19.10, davfs2 version is the one packaged from the Ubuntu repositories, the server is egroupware.

denny <brunhilde>
Fri 01 Nov 2019 08:52:38 AM UTC, comment #1: 

I also get segmentation fault when umounting my egroupware webdav share since updating to davfs2 1.5.5.

I use the following command to mount:
sudo mount -t davfs -o uid=myname,gid=users https://path/to/webdav/ /home/myname/Documents/mountpoint/



Anonymous
Wed 08 May 2019 05:47:41 AM UTC, original submission:  

Reading of the PID is wrong. This snippet from umount_davfs.c is not doing what it is supposed to do:
151     char *pid = NULL;
152     FILE *file = fopen(pidfile, "r");
153     if (!file || fscanf(file, "%a[0-9]", &pid) != 1 || !pid) {

You are saving a float bit representation into a char** (it fits, but then the char* is pointing to random memory, i.e. the PID)

In CVS I can see that this was fixed in CVS revision 1.7, but I do not really get, how the relation of the CVS repo is with the released versions, since the released versions seem to be coming from branches and never get the fixes from HEAD?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47831:  umount.davfs.txt added by None (13KiB - text/plain - strace output)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by _71007 (Posted a comment)
  • -email is unavailable- added by brunhilde (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-26 _71007 Open/ClosedOpen Closed
    2019-11-11 _71007 StatusConfirmed Fixed
    2019-11-10 None Attached File- Added umount.davfs.txt, #47831
    2019-11-06 _71007 StatusNone Confirmed
        Assigned toNone _71007

    Back to the top

    Powered by Savane 3.13-4b4b.
    Corresponding source code