Bug 610482

Summary: [abrt] crash in policycoreutils-python-2.0.82-31.fc13: sandbox:97:copyfile:IndexError: list index out of range
Product: [Fedora] Fedora Reporter: cyrushmh <cyrusyzgtt>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: casmls, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard: abrt_hash:d25a9550
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-22 12:06:20 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
File: backtrace none

Description cyrushmh 2010-07-02 08:21:41 UTC
abrt 1.1.1 detected a crash.

architecture: i686
cmdline: /usr/bin/python -E /usr/bin/sandbox -X -W metacity -i /bin -i /dev -i /etc -i /etc/alsa -i /etc/fonts -i /etc/miredo -i /etc/opt -i /home/CyrusHMH/.bash_profile -i /home/CyrusHMH/.bashrc -i /home/CyrusHMH/.config -i /home/CyrusHMH/.dmrc -i /home/CyrusHMH/.ems.cfg -i /home/CyrusHMH/.gconfd -i /home/CyrusHMH/.gnupg -i /home/CyrusHMH/.gtk-bookmarks -i /home/CyrusHMH/.gvfs -i /home/CyrusHMH/.jap.conf -i /home/CyrusHMH/.local -i /home/CyrusHMH/.mission-control -i /home/CyrusHMH/.mozilla -i /home/CyrusHMH/.opera -i /home/CyrusHMH/.pki -i /home/CyrusHMH/.vidalia -i /lib -i /opt -i /proc -i /sbin -i /selinux -i /srv -i /sys -i /usr -i /usr/lib -i /usr/bin -i /usr/share -i /usr/include -i /usr/src/kernels -i /usr/sbin -i /usr/share/fonts -i /usr/kerberos -i /usr/libexec -i /usr/lib/flash-plugin -i /usr/lib/jvm -i /usr/lib/mozilla -i /usr/lib/codecs -i /usr/lib/win32 -t sandbox_net_t gnome-terminal
component: policycoreutils
executable: /usr/bin/sandbox
kernel: 2.6.33.5-124.fc13.i686.PAE
package: policycoreutils-python-2.0.82-31.fc13
reason: sandbox:97:copyfile:IndexError: list index out of range
release: Fedora release 13 (Goddard)

backtrace
-----
sandbox:97:copyfile:IndexError: list index out of range

Traceback (most recent call last):
  File "/usr/bin/sandbox", line 422, in <module>
    rc = sandbox.main()
  File "/usr/bin/sandbox", line 409, in main
    self.__setup_dir()
  File "/usr/bin/sandbox", line 365, in __setup_dir
    self.__copyfiles()
  File "/usr/bin/sandbox", line 214, in __copyfiles
    copyfile(f, homedir, self.__homedir)
  File "/usr/bin/sandbox", line 97, in copyfile
    sys.stderr.write(e[1])
IndexError: list index out of range

Local variables in innermost frame:
e: [('/home/CyrusHMH/.config/google-chrome/SingletonSocket', '/home/CyrusHMH/.sandbox/.sandboxYusc3a/.config/google-chrome/SingletonSocket', "[Errno 6] No such device or address: '/home/CyrusHMH/.config/google-chrome/SingletonSocket'")]
re: <module 're' from '/usr/lib/python2.6/re.pyc'>
elist: Error([('/home/CyrusHMH/.config/google-chrome/SingletonSocket', '/home/CyrusHMH/.sandbox/.sandboxYusc3a/.config/google-chrome/SingletonSocket', "[Errno 6] No such device or address: '/home/CyrusHMH/.config/google-chrome/SingletonSocket'")],)
dest: '/home/CyrusHMH/.sandbox/.sandboxYusc3a/.config'
dname: '/home/CyrusHMH'
bname: '.config'
file: '/home/CyrusHMH/.config'
dir: '/home/CyrusHMH'

How to reproduce
-----
问题是,这样很麻烦
解决方法
1.rm -fr /home/CyrusHMH/.config/google-chrome/SingletonSocket
2.rm -fr /home/CyrusHMH/.sandbox/.sandboxYusc3a/.config/google-chrome/SingletonSocket
3.OK

Comment 1 cyrushmh 2010-07-02 08:21:44 UTC
Created attachment 428762 [details]
File: backtrace

Comment 2 Christoph A. 2010-08-13 17:39:06 UTC
Package: policycoreutils-python-2.0.82-31.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. start firefox (not in a sandbox) and make sure the lock file is there
2. start firefox within a sandbox with '-i ~/.mozilla' as parameter



Comment
-----
Somehow it is expected that firefox is not able to run twice (lock file), 
but I guess the sandbox should not crash.

Comment 3 Daniel Walsh 2010-08-13 19:08:06 UTC
If you edit /usr/bin/sandbox and change

  File "/usr/bin/sandbox", line 97, in copyfile
    sys.stderr.write(e[1])


to 

sys.stderr.write(str(e[1])

It will fix the code.

Fixed in policycoreutils-2.0.83-18

Comment 4 Christoph A. 2010-09-10 10:15:27 UTC
rpm -qa policycoreutils
policycoreutils-2.0.83-25.fc13.x86_64

sandbox X -t sandbox_web_t -H tmp -T tmp1  firefox
Traceback (most recent call last):
  File "/usr/bin/sandbox", line 431, in <module>
    rc = sandbox.main()
  File "/usr/bin/sandbox", line 418, in main
    self.__setup_dir()
  File "/usr/bin/sandbox", line 374, in __setup_dir
    self.__copyfiles()
  File "/usr/bin/sandbox", line 216, in __copyfiles
    copyfile(f, homedir, self.__homedir)
  File "/usr/bin/sandbox", line 90, in copyfile
    sys.stderr.write(str(e[1]))
IndexError: list index out of range

Comment 5 Christoph A. 2010-09-10 10:21:37 UTC
There is a missing '-' before the X, but I guess it shouldn't produce a traceback in all circumstances.

Comment 6 Daniel Walsh 2010-09-10 15:07:19 UTC
I can't get this error to happen.  I get a message 

sandbox X -t sandbox_web_t -H tmp -T tmp1  firefox
Unrecognized option: -H
use: X [:<display>] [option]
-a #                   default pointer acceleration (factor)
-ac                    disable access control restrictions
-audit int             set audit trail level
-auth file             select authorization file
-br                    create root window with black background
+bs                    enable any backing store support
-bs                    disable any backing store support
-c                     turns off key-click
c #                    key-click volume (0-100)
-cc int                default color visual class
-nocursor              disable the cursor
-core                  generate core dump on fatal error
-dpi int               screen resolution in dots per inch
-dpms                  disables VESA DPMS monitor control
...

Which indicates it is trying to start X with -H qualifier

Comment 7 Christoph A. 2010-09-10 17:16:03 UTC
It took me some time but I hope I got the trigger now: 
tempdir must contain a socket file

ll foo/
total 0
srwxrwxr-x. 1 user user 0 Sep 10 13:14 bar

sandbox echo -T foo/
Traceback (most recent call last):
  File "/usr/bin/sandbox", line 431, in <module>
    rc = sandbox.main()
  File "/usr/bin/sandbox", line 418, in main
    self.__setup_dir()
  File "/usr/bin/sandbox", line 374, in __setup_dir
    self.__copyfiles()
  File "/usr/bin/sandbox", line 216, in __copyfiles
    copyfile(f, homedir, self.__homedir)
  File "/usr/bin/sandbox", line 90, in copyfile
    sys.stderr.write(str(e[1]))
IndexError: list index out of range

Comment 8 Daniel Walsh 2010-09-13 15:43:19 UTC
Fixed in policycoreutils-2.0.83-26