Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 436516

Summary: sys-apps/policycoreutils: crash when sepolgen-ifgen run
Product: Gentoo Linux Reporter: Alex Brandt (RETIRED) <alunduil>
Component: SELinuxAssignee: SE Linux Bugs <selinux>
Status: VERIFIED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Alex Brandt (RETIRED) gentoo-dev 2012-09-28 15:19:57 UTC
When trying to run sepolgen-ifgen the following backtrace is produced (versions indicated before trace):

2.1.10-r5:
singularity alunduil # sepolgen-ifgen
Traceback (most recent call last):
  File "/usr/bin/sepolgen-ifgen-2.7", line 146, in <module>
    sys.exit(main())
  File "/usr/bin/sepolgen-ifgen-2.7", line 129, in main
    headers = refparser.parse_headers(options.headers, output=log, debug=options.debug)
  File "/usr/lib64/python2.7/site-packages/sepolgen/refparser.py", line 1047, in parse_headers
    parse_file(support_macros, spt)
  File "/usr/lib64/python2.7/site-packages/sepolgen/refparser.py", line 1037, in parse_file
    parse(txt, module, spt, debug)
  File "/usr/lib64/python2.7/site-packages/sepolgen/refparser.py", line 964, in parse
    create_globals(module, support, debug)
  File "/usr/lib64/python2.7/site-packages/sepolgen/refparser.py", line 951, in create_globals
    parser = yacc.yacc(method="LALR", debug=debug, write_tables=0)
  File "/usr/lib64/python2.7/site-packages/sepolgen/yacc.py", line 2148, in yacc
    lr_parse_table(method)
  File "/usr/lib64/python2.7/site-packages/sepolgen/yacc.py", line 1755, in lr_parse_table
    raise YaccError("Hosed in lr_parse_table").with_traceback(e)
AttributeError: 'YaccError' object has no attribute 'with_traceback'

2.1.10-r3:
gold alunduil # sepolgen-ifgen
Traceback (most recent call last):
  File "/usr/bin/sepolgen-ifgen-2.7", line 146, in <module>
    sys.exit(main())
  File "/usr/bin/sepolgen-ifgen-2.7", line 129, in main
    headers = refparser.parse_headers(options.headers, output=log, debug=options.debug)
  File "/usr/lib64/python2.7/site-packages/sepolgen/refparser.py", line 1047, in parse_headers
    parse_file(support_macros, spt)
  File "/usr/lib64/python2.7/site-packages/sepolgen/refparser.py", line 1037, in parse_file
    parse(txt, module, spt, debug)
  File "/usr/lib64/python2.7/site-packages/sepolgen/refparser.py", line 964, in parse
    create_globals(module, support, debug)
  File "/usr/lib64/python2.7/site-packages/sepolgen/refparser.py", line 951, in create_globals
    parser = yacc.yacc(method="LALR", debug=debug, write_tables=0)
  File "/usr/lib64/python2.7/site-packages/sepolgen/yacc.py", line 2148, in yacc
    lr_parse_table(method)
  File "/usr/lib64/python2.7/site-packages/sepolgen/yacc.py", line 1755, in lr_parse_table
    raise YaccError("Hosed in lr_parse_table").with_traceback(e)
AttributeError: 'YaccError' object has no attribute 'with_traceback'

Reproducible: Always

Steps to Reproduce:
1.Setup SELinux
2.Verify policycoreutils is installed
3.run sepolgen-ifgen
Actual Results:  
Backtraces pasted above.

Expected Results:  
Successful run of application.

It appears the with_traceback method is only available in python 3.x.  When running the application with python 3.2 though I receive the following syntax error:

gold alunduil # sepolgen-ifgen
  File "/usr/bin/sepolgen-ifgen-3.2", line 82
    except IOError, e:
                  ^
SyntaxError: invalid syntax

Looks like there are still some problems to be ironed out in this script.  I can throw a patch together for this if it's deemed necessary.
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2012-09-28 18:10:53 UTC
Can you try this with sepolgen-1.1.5-r3 ? That is the package that provides the .py files mentioned in the stacktraces and should have this fixed afaik.
Comment 2 Alex Brandt (RETIRED) gentoo-dev 2012-09-28 18:48:08 UTC
Thanks Sven, that does work.  When's it going to go stable?
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2012-09-29 07:18:49 UTC
I have to check it against some setools stuff, since the current ~arch setools introduces a regression against apol, and the previous (current stable) gives build failures for some pythons. I'm hoping to stabilize it soon though (was away for a month, hence the delay).
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2012-09-29 07:42:19 UTC
sepolgen is stabilized