[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bacula-bugs
Subject:    [Bacula-bugs] [bacula 0001610]: bacula-fd: Bacula interrupted by
From:       Mantis Bug Tracker <nobody () bugs ! bacula ! org>
Date:       2012-01-03 13:00:08
Message-ID: 92eeb2b2c4933c794e3cc61747f28d4f () bugs ! bacula ! org
[Download RAW message or body]


The following issue has been set as RELATED TO issue 0001806. 
====================================================================== 
http://bugs.bacula.org/view.php?id=1610 
====================================================================== 
Reported By:                thorsten
Assigned To:                marcovw
====================================================================== 
Project:                    bacula
Issue ID:                   1610
Category:                   File Daemon
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     closed
Resolution:                 fixed
Fixed in Version:           5.0.3
====================================================================== 
Date Submitted:             2010-07-17 22:43 UTC
Last Modified:              2012-01-03 13:00 UTC
====================================================================== 
Summary:                    bacula-fd: Bacula interrupted by signal 11:
Segmentation violation
Description: 
On an Dell Notebook with 2GB RAM and an core.duo (1,8Ghz) i was running opensuse
11.2 (aktuall fix level).

The Notebook should be a Bacula CLIENT. Because the bacula-client rpm has no
bpipe plugin, i install the bacula-mysql rpm. (i need bpipe to dump the mbr, and
some windows partitions).

After that i install the bacula-mysql rpm from here:
http://download.opensuse.org/repositories/home:/dassit:/bacula:/bacula_build/openSUSE_11.2/

minor hint: it whould be nice if someone include bpipe in the bacula-client
rpm...

Main Problem: bacula-fd crashes (Bacula interrupted by signal 11: Segmentation
violation in /var/log/messages) while reading files from an windows partition
mounted via fuse:
/dev/sda3 on /windows/D type fuseblk
(rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)

/windows/D was my windows drive. (mounted RO, Windows was clearly shutdown)

i find some bactrac / traceback files in /var/lib/bacula/...which i can send
you.


i'm trying to circle the problem to a single file...actually, then problem
appears on files in some directories...allways the same directories...but other
files/directories work.
i try to find out if them problem ocours on an special file, or file type..


Steps to Reproduce: 
Start a Backup (Full) Session from bconsole or via bat reproduces the problem.


Additional Information: 
i'm trying to circle the problem to a single file...actually, then problem
appears on an other machine (x86_64, 4GB, 2x2,6Ghz) maschine with same bacula
5.0.2.

Reading the Files from Linux results in no crash:
find /windows/D/B_Bilder/Katzen/ -exec md5sum -b '{}' ";"
find /windows/D/B_Bilder/Katzen/ -exec dd if=/'{}' of=/dev/null ";"

both work fine. so it seems to me, that the underlying fuse modul has no
problems...
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0001806 Filed fails to backup second and more e...
====================================================================== 

---------------------------------------------------------------------- 
 (0005493) thorsten (reporter) - 2010-07-18 00:57
 http://bugs.bacula.org/view.php?id=1610#c5493 
---------------------------------------------------------------------- 
Hello, i seems i've found the problem:

It's the "xattrsupport = yes" option.

Basic: mounting a windows ntfs Partition in linux. backing up a single directory
in that partition:

backing up with    xattrsupport = yes  --> bacula-fd dies
backing up without xattrsupport = yes  --> bacula-fd back up all files..no prob.

copy the single directory under linux...and then backing up the new directory:
backing up with    xattrsupport = yes  --> bacula-fd back up all files..no prob.
backing up without xattrsupport = yes  --> bacula-fd back up all files..no prob.


copy the single directory under windows then backing up the new directory:

backing up with    xattrsupport = yes  --> bacula-fd dies
backing up without xattrsupport = yes  --> bacula-fd back up all files..no prob.


that seems to me, that windows is writing some kind of additional data in his
directory structure,

But why is bacula-fd crashing ?

with kind regards Thorsten 

---------------------------------------------------------------------- 
 (0005494) kern (administrator) - 2010-07-18 07:44
 http://bugs.bacula.org/view.php?id=1610#c5494 
---------------------------------------------------------------------- 
Please upload a .gz or a .bz2 file, I don't have any program to read .7z 

---------------------------------------------------------------------- 
 (0005496) marcovw (developer) - 2010-07-18 10:32
 http://bugs.bacula.org/view.php?id=1610#c5496 
---------------------------------------------------------------------- 
As author of the xattr and acl code in Bacula I had a quick look at your dumps
and it seems to fail in a call to malloc (probably because of a 0 byte malloc in
the code). I had a quick look at the current code and the only thing I can
imagine is that the list of xattr returned by fuse is kind of bogus. That would
also explain why it works on Linux (where the code was tested) and not on the
FUSE stuff. I attached a small patch to add some more robustness to the code to
protect ourself from bad external software like this FUSE stuff. Could you try
it on your tree and let met know if it fixes at least the crash. Keep in mind
however if this fixes the problem the FUSE stuff is kind of weird then but at
least we don't crash. 

---------------------------------------------------------------------- 
 (0005497) thorsten (reporter) - 2010-07-18 19:50
 http://bugs.bacula.org/view.php?id=1610#c5497 
---------------------------------------------------------------------- 
Hallo,
an lsattr on the windows partition show the following:
lsattr: Inappropriate ioctl for device While reading flags on /windows/D/A_Musik
lsattr: Inappropriate ioctl for device While reading flags on
/windows/D/B_Bilder
lsattr: Inappropriate ioctl for device While reading flags on /windows/D/B_Video
lsattr: Function not implemented While reading flags on /windows/D/Cache.mxc3
lsattr: Function not implemented While reading flags on
/windows/D/mxfilerelatedcache.mxc2
lsattr: Inappropriate ioctl for device While reading flags on
/windows/D/RECYCLER
lsattr: Inappropriate ioctl for device While reading flags on /windows/D/System
Volume Information
lsattr: Function not implemented While reading flags on /windows/D/Thumbs.db

maybee theres an function not implemented that you need, or an incorrect return
value...


about the fix...can you explain me, which package should i install ? from here
(http://www.bacula.org/en/?page=downloads) 

my problem is: i've never patched software under linux, nor i'm an linux
developer...so what's the easiest way to test the problem ?

with kind regards thorsten 

---------------------------------------------------------------------- 
 (0005498) marcovw (developer) - 2010-07-18 21:09
 http://bugs.bacula.org/view.php?id=1610#c5498 
---------------------------------------------------------------------- 
Hmm, its kind of difficult to test things if you don't know how to build from
source. I have no idea how things are build on opensuse but I guess they use
some sort of autobuild system with source rpms.

The idea is to patch the source file with the attached patch.

I don't fancy compiling things myself (as I don't have any opensuse install
lingering around.)

I would be interested in the output of

strace -o strace.lsattr.out -s 512 -f lsattr /windows/D/A_Musik

that should catch the system calls executed and might give some more insights on
what the different xattr calls return.

If you could attach that file I can take a look at what is fishy in the xattr
calls and add proper handling of this error condition in the code so it will not
crash anymore. If that works however has to wait until a new version is
released. 

---------------------------------------------------------------------- 
 (0005499) thorsten (reporter) - 2010-07-18 21:30
 http://bugs.bacula.org/view.php?id=1610#c5499 
---------------------------------------------------------------------- 
Ok...i try to build a client version....
unfortunately...this whould take some time...
(i download the 5.0.2 tar.gz file...unzip...untar it...then ./configure
--enable-client-only....then make and make install...

after that i configure the director...and the new test.client...and hope that
the failure is comming

i try the whole thing in an 32Bit VM....because the x64 has not the problem !?

the strace.lsattr.out file is attached... 

---------------------------------------------------------------------- 
 (0005500) marcovw (developer) - 2010-07-18 21:41
 http://bugs.bacula.org/view.php?id=1610#c5500 
---------------------------------------------------------------------- 
Ok,

lsattr is a ext2 tool so that explains why it doesn't work.

21729 ioctl(4, EXT2_IOC_GETFLAGS, 0xbffbf21c) = -1 ENOTTY (Inappropriate ioctl
for device)

could you see if you have getfattr installed and run an strace as above on the
getfattr binary.

As to compiling the client make sure you patch the source.

cd source/filed
patch -p1 < bug_1610.txt 

---------------------------------------------------------------------- 
 (0005503) thorsten (reporter) - 2010-07-19 20:25
 http://bugs.bacula.org/view.php?id=1610#c5503 
---------------------------------------------------------------------- 
Hm...i was able to recreate the bacula-fd from source...but the patch did not
work...maybee different version ?  i've download this one:
http://sourceforge.net/projects/bacula/files/bacula/5.0.2/bacula-5.0.2.tar.gz/download

the result of the patch is that one:

patching file bacula/src/filed/xattr.c
Hunk http://bugs.bacula.org/view.php?id=1 FAILED at 416.
1 out of 1 hunk FAILED -- saving rejects to file bacula/src/filed/xattr.c.rej

code arround 414 in xattr.c:

       * Allocate space for storing the value.
       */
      current_xattr->value = (char *)malloc(xattr_value_len);
      memset((caddr_t)current_xattr->value, 0, xattr_value_len);

      xattr_value_len = lgetxattr(jcr->last_fname, bp, current_xattr->value,
xattr_value_len); 

---------------------------------------------------------------------- 
 (0005504) marcovw (developer) - 2010-07-19 20:59
 http://bugs.bacula.org/view.php?id=1610#c5504 
---------------------------------------------------------------------- 
Around line 419 you find

      if (skip_xattr) {
         bp = strchr(bp, '\0') + 1;
         continue;
      }

change that into

      if (skip_xattr || strlen(bp) == 0) {
         bp = strchr(bp, '\0') + 1;
         continue;
      }


That is the quick fix, if that helps we already have a better patch which will
find its way into the new 5.x release. 

---------------------------------------------------------------------- 
 (0005505) marcovw (developer) - 2010-07-19 21:07
 http://bugs.bacula.org/view.php?id=1610#c5505 
---------------------------------------------------------------------- 
Can you please repeat the getfattr only on the files which give problems. The
last strace was from a getfattr -R while possibly interesting gives a bit to
much output and doesn't seem to contain the files/directories you mentioned
before.

That makes trouble shooting a bit difficult. I couldn't find much wrong with the
previous trace but as it contains probably the wrong data I removed it. 

---------------------------------------------------------------------- 
 (0005506) thorsten (reporter) - 2010-07-19 22:33
 http://bugs.bacula.org/view.php?id=1610#c5506 
---------------------------------------------------------------------- 
It seems not to be the problem for the failure:

bacula-fd -dt -f -d 03 -m
LxDeskS-fd: smartall.c:124 Failed ASSERT: nbytes > 0
Bacula interrupted by signal 11: Segmentation violation
Kaboom! bacula-fd, LxDeskS-fd got signal 11 - Segmentation violation. Attempting
traceback.
Kaboom! exepath=/tmp/bacula-5.0.2
Calling: /tmp/bacula-5.0.2/btraceback /tmp/bacula-5.0.2/bacula-fd 26790
/var/lib/bacula
execv: /tmp/bacula-5.0.2/btraceback failed: ERR=No such file or directory


LxDeskS:/tmp/bacula-5.0.2 # file  /sbin/bacula-fd
/sbin/bacula-fd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.4, not stripped


LxDeskS:/tmp/bacula-5.0.2 # ll /sbin/bacula-fd
-rwxr-x--- 1 root root 531892 2010-07-19 23:23 /sbin/bacula-fd

to the getfattr....yes..i confuse you...but that was not my intention...
my first lsattr at 2010-07-18 19:50 was on /windows/D/
your requered strace lsattr at 2010-07-18 21:09 was on /windows/D/B_Bilder. but
i haven't say'ed to you that it was'nt /windows/D/A_Musik. because A_Musik works
fine.

Later, to keep thinks easier, i've tested and recreated the problem on
/windows/D/B_Bilder/Katzen....that was the original Windows Directory.

unfortunately the getfattr returns no invalid data (i think)...

what should i do next ?

thorsten 

---------------------------------------------------------------------- 
 (0005507) marcovw (developer) - 2010-07-19 23:03
 http://bugs.bacula.org/view.php?id=1610#c5507 
---------------------------------------------------------------------- 
AT least we can see that it is a 0 bytes allocation

see

smartall.c:124 Failed ASSERT: nbytes > 0

you could try compiling with -g in the CFLAGS so we get debugging symbols so the
traceback gives some better output.

Its also strange to see btraceback is not there did you do an make install ? 

---------------------------------------------------------------------- 
 (0005508) marcovw (developer) - 2010-07-19 23:38
 http://bugs.bacula.org/view.php?id=1610#c5508 
---------------------------------------------------------------------- 
Ok I think I found the corner case. An empty xattr is somethings we don't handle
right. Ok back to the drawing board it is. No idea if this is a real situation
but let prepare the code for this.

Could you try the new attached xattr.c by using it to replace the one under
bacula/filed/xattr.c ?

This is just a quick fix didn't have time to test it and its quite a change to
the code so no guarantee it works right away. Its also late here so this is it
for today. 

---------------------------------------------------------------------- 
 (0005514) thorsten (reporter) - 2010-07-20 21:15
 http://bugs.bacula.org/view.php?id=1610#c5514 
---------------------------------------------------------------------- 
OK....new xattr.c compiled and running. no crash. i think it works fine.

I have two questions left:
- you write: "Its also late here so this is it for today"....where is "here" ?
Europe ? USA ?

- where can i request futur request (like bpipe in bacula-client package and not
only in bacula-server ?

thorsten 

---------------------------------------------------------------------- 
 (0005515) marcovw (developer) - 2010-07-20 22:15
 http://bugs.bacula.org/view.php?id=1610#c5515 
---------------------------------------------------------------------- 
Here, is near Amsterdam the Netherlands (so Europe).

As to packaging questions, you can always file a bug report if things are in the
server package and not in the client package but I'm wondering if thats an
OpenSUSE thing or a bacula packaging problem in the rpm spec. I must say I'm not
much into Linux rpms so I cannot really help there.

One thing I am interested in however could you try restoring something with this
new Bacula fd I'm wondering if that works e.g. and if not does it crash or give
a certain error. We seem to have solved the backup part I'm only wondering how
the restore part is doing with this particular changes. 

If they also work I will push the patch to the GIT repo tomorrow and it should
end up in a new version of Bacula (whatever version that may be a 5.0.3 or 5.2
version). 

---------------------------------------------------------------------- 
 (0005516) thorsten (reporter) - 2010-07-21 20:06
 http://bugs.bacula.org/view.php?id=1610#c5516 
---------------------------------------------------------------------- 
Hello,
my "here" was Germany...so same timezone...8-)

so...restore works fine. restore the files to a linux fs works without problem.
same as an restore to an fuse mounted ntfs fs. 

---------------------------------------------------------------------- 
 (0005517) marcovw (developer) - 2010-07-21 20:24
 http://bugs.bacula.org/view.php?id=1610#c5517 
---------------------------------------------------------------------- 
Ok great then I close the bugreport and push the changes to GIT later so they
end up in the new version. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-07-17 22:43 thorsten       New Issue                                    
2010-07-17 22:43 thorsten       File Added: bacula.7z                        
2010-07-18 00:57 thorsten       Note Added: 0005493                          
2010-07-18 07:44 kern           Note Added: 0005494                          
2010-07-18 07:44 kern           Status                   new => feedback     
2010-07-18 10:32 marcovw        Note Added: 0005496                          
2010-07-18 10:33 marcovw        File Added: bug_1610.txt                     
2010-07-18 19:50 thorsten       Note Added: 0005497                          
2010-07-18 21:09 marcovw        Note Added: 0005498                          
2010-07-18 21:10 marcovw        Assigned To               => marcovw         
2010-07-18 21:27 thorsten       File Added: strace.lsattr.out.gz                
   
2010-07-18 21:30 thorsten       Note Added: 0005499                          
2010-07-18 21:41 marcovw        Note Added: 0005500                          
2010-07-18 21:41 marcovw        File Deleted: strace.lsattr.out.gz              
     
2010-07-19 20:11 thorsten       File Added: strace.lsattr.out.getfattr.gz       
            
2010-07-19 20:25 thorsten       Note Added: 0005503                          
2010-07-19 20:59 marcovw        Note Added: 0005504                          
2010-07-19 21:05 marcovw        File Deleted: strace.lsattr.out.getfattr.gz     
              
2010-07-19 21:07 marcovw        Note Added: 0005505                          
2010-07-19 22:33 thorsten       Note Added: 0005506                          
2010-07-19 23:03 marcovw        Note Added: 0005507                          
2010-07-19 23:38 marcovw        Note Added: 0005508                          
2010-07-19 23:39 marcovw        File Added: xattr.c                          
2010-07-20 09:35 marcovw        File Deleted: xattr.c                        
2010-07-20 09:35 marcovw        File Added: xattr.c                          
2010-07-20 21:15 thorsten       Note Added: 0005514                          
2010-07-20 22:15 marcovw        Note Added: 0005515                          
2010-07-21 20:06 thorsten       Note Added: 0005516                          
2010-07-21 20:24 marcovw        Note Added: 0005517                          
2010-07-21 20:25 marcovw        Status                   feedback => resolved
2010-07-21 20:25 marcovw        Fixed in Version          => 5.0.3           
2010-07-21 20:25 marcovw        Resolution               open => fixed       
2010-07-29 07:45 ebollengier    Status                   resolved => closed  
2012-01-03 13:00 marcovw        Relationship added       related to 0001806  
======================================================================



------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Bacula-bugs mailing list
Bacula-bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic