Bug 255261

Summary: star -c -data-change-warn causes segfault at startup
Product: [Fedora] Fedora Reporter: Douglas Wooster <dmw>
Component: starAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 7CC: dkopecek, schily
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: 1.5a84-3.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-18 03:17:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
valgrind output of failing star command
none
valgrind output of same star command without -data-change-warn
none
Fix
none
valgrind trace none

Description Douglas Wooster 2007-08-26 18:26:52 UTC
Description of problem:
If you try to create a star archive with the -data-change-warn option, then 
star will get a segmentation fault before it does any work.


Version-Release number of selected component (if applicable):
1.5a76-2.fc7

How reproducible:
100% of my tests failed
It does not matter what what you try to archive - a file, a directory, 
something which does or doesn't exist, one thing, multiple things.

Steps to Reproduce:
1. star -c -data-change-warn file=./test.star /bin/mount
  
Actual results:
segmentation fault

Expected results:
specified archive file is created containing specified disk file(s)

Additional info:
Attachments:
  star.bad.txt is valgrind output from failing star command.
  star.ok.txt is valgrind output from same star command 
without -data-change-warn option.

Comment 1 Douglas Wooster 2007-08-26 18:26:52 UTC
Created attachment 173081 [details]
valgrind output of failing star command

Comment 2 Douglas Wooster 2007-08-26 18:29:13 UTC
Created attachment 173101 [details]
valgrind output of same star command without -data-change-warn

Comment 3 Daniel Kopeček 2007-08-27 09:49:57 UTC
Created attachment 173461 [details]
Fix

This patch should fix this issue

Comment 4 Fedora Update System 2007-08-27 21:52:28 UTC
star-1.5a84-2.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Douglas Wooster 2007-08-30 06:10:17 UTC
Thank you for the fast response.  I installed the star-1.5a84-2.fc7 RPM from 
updates.

It gets farther, and some star -c commands work, but many fail with segfaults 
after a brief period.  Examples:

star -c H=exustar -dump -xattr -xfflags -fifo 
fs=64m -fifostats -block-number -data-change-warn
-match-tree -acl -atime -time -not pattern=/home/backups
pattern=/home/E:/Etemp pattern=/etc pattern=/opt pattern=/usr pattern=/var 
pattern=/J: pattern=/L: pattern=/M: pattern=/N: 
file=/O:/ATHLON/home.Linux.DMWsysbu.star -z -C / /home

star: Operation not supported. Error moving extended header '././@PaxHeader'.
Command terminated by signal 11

Similar backup of /usr fails with signal 11 after 26 seconds/38MB, but does not 
give the Operation Not Supported message.
Similar backup of /opt failed with signal 11 after 5 seconds/47MB, like /usr.
Similar backup of /etc succeeded.  7 seconds/98MB.
Similar backup of all the miscellaneous stuff in / failed with signal 11 after 
7 seconds/39MB.

Is there any additional data collection you need?


Comment 6 Douglas Wooster 2007-08-30 06:59:06 UTC
Created attachment 180281 [details]
valgrind trace

Oops, here's valgrind trace of 

star -c H=exustar -dump -xattr -xfflags -fifo 
fs=64m -fifostats -block-number -data-change-warn
-match-tree -acl -atime -time -not pattern=/home/backups
pattern=/home/E:/Etemp pattern=/etc pattern=/opt pattern=/usr pattern=/var 
pattern=/J: pattern=/L: pattern=/M: pattern=/N: 
file=/O:/ATHLON/home.Linux.DMWsysbu.star -z -C / /home

Comment 7 Daniel Kopeček 2007-08-31 20:18:48 UTC
(In reply to comment #5)
> Thank you for the fast response.  I installed the star-1.5a84-2.fc7 RPM from 
> updates.
> 
> It gets farther, and some star -c commands work, but many fail with segfaults 
> after a brief period.  Examples:
> 
> star -c H=exustar -dump -xattr -xfflags -fifo 
> fs=64m -fifostats -block-number -data-change-warn
> -match-tree -acl -atime -time -not pattern=/home/backups
> pattern=/home/E:/Etemp pattern=/etc pattern=/opt pattern=/usr pattern=/var 
> pattern=/J: pattern=/L: pattern=/M: pattern=/N: 
> file=/O:/ATHLON/home.Linux.DMWsysbu.star -z -C / /home
> 
> star: Operation not supported. Error moving extended header '././@PaxHeader'.
> Command terminated by signal 11
> 
> Similar backup of /usr fails with signal 11 after 26 seconds/38MB, but does not 
> give the Operation Not Supported message.
> Similar backup of /opt failed with signal 11 after 5 seconds/47MB, like /usr.
> Similar backup of /etc succeeded.  7 seconds/98MB.
> Similar backup of all the miscellaneous stuff in / failed with signal 11 after 
> 7 seconds/39MB.
> 
> Is there any additional data collection you need?
> 

star is now compiled with -O0 flag (no optimization). The segfaults are caused
by wrong optimization done by gcc. The impact on speed with this change is not
so high, I've tested to archive ~2000 files (322MBytes) and it took 46sec with
-O2, and 48sec with -O0. If you notice a larger impact on performance of star
after update, please let me know. According to upstream, this software is mainly
designed for running on *Solaris and to be compiled with SunPro C compiler.


Comment 8 Douglas Wooster 2007-09-02 03:55:01 UTC
(In reply to comment #7)
> star is now compiled with -O0 flag (no optimization). The segfaults are 
caused
> by wrong optimization done by gcc. The impact on speed with this change is 
not
> so high, I've tested to archive ~2000 files (322MBytes) and it took 46sec 
with
> -O2, and 48sec with -O0. If you notice a larger impact on performance of star
> after update, please let me know. According to upstream, this software is 
mainly
> designed for running on *Solaris and to be compiled with SunPro C compiler.
> 

That sounds reasonable, Dan.  I'll give it a try, but 1.5a84-3.fc7 has not yet 
become available in the updates repository.

Comment 9 Fedora Update System 2007-09-04 22:07:16 UTC
star-1.5a84-3.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Douglas Wooster 2007-09-08 23:25:31 UTC
OK, I finally figured out I needed to --enablerepo=updates-testing to install 
this fix.  I've run several backups, and they all finished.  Ran verifies on 
all the backups, immediately after each backup finished. Tested a restore.  Did 
see some odd mismatches between the backups and the verifies, though.  Run a 
backup, immediate run a diff, and get "different sparse" messages for files 
which cannot reasonably have changed.  This sort of thing occurred for many of 
the backups/diffs I ran.  Please tell me if these are likely related to this 
problem, or are a separate bug, or are a user error.  Here is an example:


========== creating backup: star -c H=exustar -dump -xattr -xfflags -fifo 
fs=64m -fifostats -block-number -data-change-warn -match-tree -acl -atime -time -not 
pattern=/home/backups pattern=/home/E:/Etemp pattern=/etc pattern=/opt 
pattern=/usr pattern=/var pattern=/J: pattern=/L: pattern=/M: pattern=/N: 
file=/O:/ATHLON/home.Linux.DMWsysbu.star -z -C / /home

star: fifo had 130935 puts 224146 gets.
star: fifo was 1 times empty and 82 times full.
star: fifo held 67102720 bytes max, size was 67112960 bytes
star: 224146 blocks + 0 bytes (total of 2295255040 bytes = 2241460.00k).
star: Total time 215.261sec (10412 kBytes/sec)


=========== verifying data: star -diff diffopts=!atime,ctime,lmtime -fifo 
fs=64m -acl -atime -time -not file=/O:/ATHLON/home.Linux.DMWsysbu.star -z -C /

diffopts=perm,type,nlink,uid,gid,uname,gname,size,data,rdev,hardlink,symlink,sympath,sparse,mtime,dir,acl,xattr,fflags
star: WARNING: skipping leading '/' on filenames.
home/htest/: different mtime
home/htest/.spamassassin/auto-whitelist: different sparse
home/htest/.spamassassin/bayes_toks: different sparse
home/htest/.spamassassin/bayes_seen: different sparse
home/htest/.kde/share/config/: different mtime
home/htest/.kde/share/config/kickerrc: different mtime
home/htest/.kde/share/config/kdeglobals: different mtime
home/htest/.kde/share/apps/kcookiejar/: different mtime
home/htest/.kde/share/apps/kcookiejar/cookies: different mtime
home/HUSBAND/.opera/mail/mailbase.dat: different sparse
home/HUSBAND/.opera/mail/lexicon/lexicon_16384.dat: different sparse
home/HUSBAND/.opera/mail/lexicon/lexicon_65536.dat: different sparse
home/HUSBAND/.opera/mail/indexer/indexer_8192.dat: different sparse
home/HUSBAND/.opera/mail/indexer/indexer_64.dat: different sparse
home/HUSBAND/.opera/mail/indexer/indexer_4096.dat: different sparse
home/HUSBAND/.opera/mail/indexer/indexer_32768.dat: different sparse
home/WIFE/.mozilla/WIFE/s4r0yse3.slt/cert8.db: different sparse
home/WIFE/.mozilla/WIFstar: 224146 blocks + 0 bytes (total of 2295255040 bytes 
= 2241460.00k).
star: Total time 66.154sec (33882 kBytes/sec)
E/Cache/_CACHE_003_: different sparse



Opera is no longer installed on this machine, so the /home/HUSBAND/.opera files 
being different appears to be nonsense, and user WIFE has not been logged on 
since the machine was last booted, so /home/WIFE files being different also 
appears nonsense.

If the oddball differences can be explained, then I think you have fixed the 
problem.
Thank you.
Douglas Woostewr

Comment 11 Daniel Kopeček 2007-09-09 00:26:18 UTC
I think the "different sparse" errors are caused because you don't have used the
-sparse option when creating the backup. Please re-run your test with this option.

Comment 12 Douglas Wooster 2007-09-09 06:36:31 UTC
OK, thanks.  I'll try that and report back in a day or two.

Comment 13 Douglas Wooster 2007-09-10 02:43:21 UTC
I've rerun with -sparse .  No more strange difference messages.  That does look 
like it was a user error on my part.  All the backups ran and verified.  I 
tried a different set of test restores this time, and they came out OK.  I 
think this can be considered fixed and confirmed.  Thank you very much for your 
prompt help.

Douglas

Comment 14 Fedora Update System 2007-09-18 03:17:34 UTC
star-1.5a84-3.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Jörg Schilling 2009-01-25 13:08:06 UTC
Have the compiler bugs, that forced you to disable optimization,
been fixed meanwhile?

Comment 16 Ondrej Vasik 2009-01-27 19:56:16 UTC
Compiler bugs seems to be fixed, star no longer segfaulting (at least what I have tested) due to optimalization flag. Reenabled optimalization - however, it seems that star/names.c and libfind/names.c source file is missing in upstream tarball of final star-1.5 (I had to use names.c file from star-1.5a89 to compile it). Is it intentional or just by accident?

Comment 17 Jörg Schilling 2009-01-27 20:19:05 UTC
names.c is no longer needed.

The name is now libfind/idcache.c 

Did you destroy the makefiles?

Comment 18 Ondrej Vasik 2009-01-28 08:29:33 UTC
I use all.mk as Makefile to disable fat binary ... and names.c is included in those "smaller" makefiles as necessary (in star/cpio.mk, star/gnutar.mk, star/pax.mk, star/star_fat.mk, star/star.mk, star/suntar.mk) ... so I guess this is not fault on Red Hat side ...

Comment 19 Ondrej Vasik 2009-01-28 08:49:24 UTC
(sorry, star_fat.mk obviously not - only those others)

Comment 20 Jörg Schilling 2009-01-28 09:01:14 UTC
Since a few years, it it no longer recommended to create non-fat binaries.

I recommend to compile things the way they are delivered.

BTW: there are some small bugs in star-1.5 star are fixed in

ftp://ftp.berlios.de/pub/schily/

the complete schily source consolidation.