Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#90 double free or corruption (fasttop): 0x0816cdc8

closed-fixed
5
2009-05-03
2008-11-26
No

Hi, I have a problem connecting to a remote webdav server through a web proxy on Ubuntu Intreprid Ibex. I think I have configured the thing correctly in dav2fs.conf and secrets. This is my line in fstab

http://clark.bingodisk.com/bingo /media/bingo davfs noauto,user 0 0

If I try to execute "mount /media/bingo" I encounter a problem (attached). After this, here are some info :
lc236620@pc212916:~$ ls -l /media/
ls: ne peut accéder /media/bingo: Noeud final de transport n'est pas connecté (which can be roughly translated into "ls: can't access /media/bingo : final transport node not connected")
total 16
d????????? ? ? ? ? ? bingo
lrwxrwxrwx 1 root root 6 2006-07-05 16:11 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2006-07-05 16:11 cdrom0
drwxr-xr-x 2 root root 4096 2006-10-19 11:02 cle
drwxr-xr-x 2 root root 4096 2007-04-13 17:10 dvdrecorder
drwxrwxr-x 2 root fuse 4096 2007-10-09 16:50 phone
drwxr-xr-x 13 root root 0 2008-11-26 10:01 RATP
lc236620@pc212916:~$ umount /media/bingo
/sbin/umount.davfs:
can't read PID from file /var/run/mount.davfs/media-bingo.pid;
trying to unmount anyway;
please wait for mount.davfs to terminate
lc236620@pc212916:~$ ls -l /media/
total 20
drwxr-xr-x 2 root root 4096 2008-03-27 16:09 bingo
lrwxrwxrwx 1 root root 6 2006-07-05 16:11 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2006-07-05 16:11 cdrom0
drwxr-xr-x 2 root root 4096 2006-10-19 11:02 cle
drwxr-xr-x 2 root root 4096 2007-04-13 17:10 dvdrecorder
drwxrwxr-x 2 root fuse 4096 2007-10-09 16:50 phone
drwxr-xr-x 13 root root 0 2008-11-26 10:01 RATP
lc236620@pc212916:~$ uname -a
Linux pc212916 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:20 UTC 2008 i686 GNU/Linux

Can anyone help me ?

Discussion

  • Output of the command

     
    Attachments
  • I have forgotten to mention the fact that the URL does respond when I just connect to it through a regular browser...

    I have also added the result of the same experiment with webdavs (the same URL in https). Output seems very similar

     
  • Werner Baumann
    Werner Baumann
    2008-11-26

    Any idea what version of davfs2 you are using? (/sbin/mount.davfs --version)

    "If I try to execute "mount /media/bingo" I encounter a problem (attached)."
    What does this mean?
    Did you execute the command? What happend? Any messages from mount.davfs?
    After the command returns, please look whether a mout.davfs process is running.

    Cheers
    Werner

     
  • Werner Baumann
    Werner Baumann
    2008-11-26

    • assigned_to: nobody --> wbaumann
     
  • lc236620@pc212916:~$ /sbin/mount.davfs --version
    davfs2 1.3.3 <http://dav.sourceforge.net>

    What I meant by "If I try to execute "mount /media/bingo" I encounter a problem (attached)." was that I ran the command "mount /media/bingo" and the output is attached as file "glibc_corruption.log" to this bug report.

    After running the command, there is no mount.davfs process running
    lc236620@pc212916:~$ ps aux | grep dav
    lc236620 18363 0.0 0.0 3244 816 pts/1 S+ 15:58 0:00 grep dav

    Thank you for your quick reply and for any future help with this

    Laurent

     
  • Werner Baumann
    Werner Baumann
    2008-11-27

    To make debugging easier for me, could you please run this two tests:

    - Run the mount command with strace (you must be root for this).
    "strace -f -o davfs2.trace mount /media/bingo"
    -f is to follow forks, -o to get the output in a file; mount.davfs will ask
    for the credentials.

    - Run the mount command with davfs2 debugging enabled.
    set option "debug most" in the davfs2.conf
    mount the file system
    there should be a lot of messages in one of your systems log files.

    Please send the output from this two tests. It should show me where the double free happens (I can't read backtraces :-(

    Cheers
    Werner

     
  • 1) For the strace, here is the output (it indeed asked for my credentials) :

    root@pc212916:/home/lc236620/temporaire/20081126-davfs2# strace -f -o davfs2.trace mount /media/bingo
    Please enter the username to authenticate with proxy
    proxy.reseau.ratp or hit enter for none.
    Username: lc236620
    Please enter the password to authenticate user lc236620 with proxy
    proxy.reseau.ratp or hit enter for none.
    Password:
    Please enter the username to authenticate with server
    http://clark.bingodisk.com/bingo or hit enter for none.
    Username: clark@bingodisk.com
    Please enter the password to authenticate user clark@bingodisk.com with server
    http://clark.bingodisk.com/bingo or hit enter for none.
    Password:
    /sbin/mount.davfs: Mounting failed.
    Could not authenticate to proxy server: rejected Basic challenge

    Note : the proxy should not reject me. I have checked and rechecked the passwords and there are good. Furthermore, I can get the list of files through a regular web browser through the same proxy. I attached the output davfs2.trace below (I hid the passwords with XXXXXX).

    2) I ran the command and fetched the appropriate content from syslog (file attached). I think the password information is already hidden (xxxxxx) but if I have made a mistake, could you please delete the file as soon as possible ? For information, the two directories that are added at the end of the log (/bingo/public/ and /bingo/backup/) are the exact content of my dav directory. So it seems the connexion actually works to a certain point.

    Thanks in advance for your help.

    Laurent

     
  • Werner Baumann
    Werner Baumann
    2008-11-29

    Thanks for the logs.

    Authentication problem:
    This seems to be caused by running mount.davfs with strace. strace seems to change the behaviour and so unfortunately can't be used for debugging in this case.

    The syslog.log shows that authentication works and davfs2 could connect to the server and get a successful response on the first two requests.

    It also shows where approximately the "double free" occurs. I could not yet find the exact location. The "double free" seems to happen after initialization when mount.davfs frees the structure that holds all the configuration information.

    Assuming you built the program from the source package I suggest another two tests. These would require to recompile and install the program (If you use the binary package and don't want to build from the sources, I could send you patched binary packages for testing).

    Test 1:
    In file src/mount_davfs.c please comment out one line (this line frees the args-structure in the parent process), line 261:

    write_mtab_entry(args);

    if (args->debug & DAV_DBG_CONFIG)
    syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "Parent: leaving now");
    /* delete_args(args); */
    exit(EXIT_SUCCESS);

    } else if (childpid < 0) {

    If this does not help we need
    Test 2:
    Please additionally comment out line 297:

    if (idle_time == 0)
    idle_time = DAV_DELAY_UPLOAD;
    int debug = args->debug;
    /* delete_args(args); /*
    setsid();

    Please report the results. If none of this helps, the error is somewhere else.

    Cheers
    Werner

     
  • Werner Baumann
    Werner Baumann
    2008-11-29

    Thanks for the logs.

    Authentication problem:
    This seems to be caused by running mount.davfs with strace. strace seems to change the behaviour and so unfortunately can't be used for debugging in this case.

    The syslog.log shows that authentication works and davfs2 could connect to the server and get a successful response on the first two requests.

    It also shows where approximately the "double free" occurs. I could not yet find the exact location. The "double free" seems to happen after initialization when mount.davfs frees the structure that holds all the configuration information.

    Assuming you built the program from the source package I suggest another two tests. These would require to recompile and install the program (If you use the binary package and don't want to build from the sources, I could send you patched binary packages for testing).

    Test 1:
    In file src/mount_davfs.c please comment out one line (this line frees the args-structure in the parent process), line 261:

    write_mtab_entry(args);

    if (args->debug & DAV_DBG_CONFIG)
    syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "Parent: leaving now");
    /* delete_args(args); */
    exit(EXIT_SUCCESS);

    } else if (childpid < 0) {

    If this does not help we need
    Test 2:
    Please additionally comment out line 297:

    if (idle_time == 0)
    idle_time = DAV_DELAY_UPLOAD;
    int debug = args->debug;
    /* delete_args(args); /*
    setsid();

    Please report the results. If none of this helps, the error is somewhere else.

    Cheers
    Werner

     
  • Werner Baumann
    Werner Baumann
    2008-11-29

    Thanks for the logs.

    Authentication problem:
    This seems to be caused by running mount.davfs with strace. strace seems to change the behaviour and so unfortunately can't be used for debugging in this case.

    The syslog.log shows that authentication works and davfs2 could connect to the server and get a successful response on the first two requests.

    It also shows where approximately the "double free" occurs. I could not yet find the exact location. The "double free" seems to happen after initialization when mount.davfs frees the structure that holds all the configuration information.

    Assuming you built the program from the source package I suggest another two tests. These would require to recompile and install the program (If you use the binary package and don't want to build from the sources, I could send you patched binary packages for testing).

    Test 1:
    In file src/mount_davfs.c please comment out one line (this line frees the args-structure in the parent process), line 261:

    write_mtab_entry(args);

    if (args->debug & DAV_DBG_CONFIG)
    syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "Parent: leaving now");
    /* delete_args(args); */
    exit(EXIT_SUCCESS);

    } else if (childpid < 0) {

    If this does not help we need
    Test 2:
    Please additionally comment out line 297:

    if (idle_time == 0)
    idle_time = DAV_DELAY_UPLOAD;
    int debug = args->debug;
    /* delete_args(args); /*
    setsid();

    Please report the results. If none of this helps, the error is somewhere else.

    Cheers
    Werner

     
  • Werner Baumann
    Werner Baumann
    2009-01-27

    The double free could be located and is now fixed in CVS.

    Werner

     
  • Werner Baumann
    Werner Baumann
    2009-01-27

    • status: open --> open-fixed
     
  • I'm really sorry for not answering sooner but I now have problems with authenticating with my proxy (basic not supported anymore ?) so I can't test the new version :(

    I'll keep you posted as soon as I can

     
  • Ahah ! I have finally found what is causing the authentification problem with the proxy... Apparently, the password supplied to the proxy (base64 encoded on the basic proxy-authentification http header) is the webdav server password and not the proxy server !

    For your information, I tried exchanging the two passwords at the prompt (I hoped it was just a UI problem) but then the proxy passes but not the server.

    Do you want me to open a separate bug report for this (and we will come back to this one after the new one is solved) ?

     
  • For your information, the previous discovery was made with davfs2 1.3.3 (installed on ubuntu 8.10 with the package for lenny)

     
  • Werner Baumann
    Werner Baumann
    2009-03-10

    When davfs2 sends the wrong password (server-password instead of proxy-password) does it send the wrong username too?

    Do you still get error:
    "Could not authenticate to proxy server: rejected Basic challenge" ?

    Can you try option "debug secrets" and check your log-files: Are usernames and passwords correctly associated with proxy and server or are they already interchanged?

    Cheers
    Werner

     
  • 1) The username is the correct one (thankfully, the two logins are different so I was able to check it). davfs2 sends a "Proxy-Authorization: Basic XXXXXXX" header where XXXXXXX is the base64 encoding of "USERNAME:PASSWORD" where USERNAME is the username for the proxy and PASSWORD is the password of the webdav server. Only PASSWORD is incorrect here.

    2) "Could not authenticate to proxy server: rejected Basic challenge" is indeed the error I am getting since I upgraded the package to test for your patch (for the original problem)

    3) debug

    Mar 11 10:25:11 mount.davfs: Secrets:
    Mar 11 10:25:11 mount.davfs: username: clark@bingodisk.com
    Mar 11 10:25:11 mount.davfs: password: <PASSWORD_WEBDAV>
    Mar 11 10:25:11 mount.davfs: p_user: lc236620
    Mar 11 10:25:11 mount.davfs: p_passwd: <PASSWORD_WEBDAV>
    Mar 11 10:25:11 mount.davfs: clicert_pw: (null)
    Mar 11 10:25:11 mount.davfs: authentication failure:
    Mar 11 10:25:11 mount.davfs: Indiquez vos droits d'accès de connexion à Internet (...)
    ==================================================

    The last line is the french message from the proxy for when you typed a wrong password. As you can see on these lines, the proxy password is already wrong there.

    Thanks once again for your time.

     
  • Werner Baumann
    Werner Baumann
    2009-03-11

    Now I could reproduce the bug.
    I still have to find the reason for this. But meanwhile there is a workaroud:

    This error only happens when you enter username and password on the command line. If you use the secrets file the proxy password is ok.

    Please enter the credentials in ~/.davfs2/secrets like this

    proxy proxyuser proxypassword
    /media/bingo serveruser serverpassword

    Please use the keyword "proxy" and not the hostname of the proxy (there is another bug).

    Could you please open a new bug report for this issue, so that it is visible for others?

    Cheers
    Werner

     
  • Werner Baumann
    Werner Baumann
    2009-05-03

    I believe the bug is fixed in version 1.4.0.
    Please note that the davfs2 project has moved to
    http://savannah.nongnu.org/projects/davfs2

    Cheers
    Werner

     
  • Werner Baumann
    Werner Baumann
    2009-05-03

    • status: open-fixed --> closed-fixed