Anonymous | Login | 2023-09-24 22:35 CDT | ![]() |
My View | View Issues |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0000116 | PyRosetta | [All Projects] Crash | public | 2012-09-27 17:06 | 2012-09-28 15:55 | ||||||||
Reporter | evanbaugh | ||||||||||||
Assigned To | |||||||||||||
Priority | low | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Platform | x86 | OS | Linux | OS Version | Ubuntu | ||||||||
Product Version | |||||||||||||
Fixed in Version | |||||||||||||
Summary | 0000116: PyRosetta Constraint bug | ||||||||||||
Description | I cam across a bizarre bug today which has hampered me for a while (I just had no idea what was happening). It seems that when you score a Pose with Constraints that were constructed in another namespace (such as a function) the scoring causes a SegFault ...I have no idea why this is happening... | ||||||||||||
Steps To Reproduce | from rosetta import * init() # example syntax to reproduce # the first example here will work fine ####################################### from rosetta.core.scoring.constraints import ConstantFunc, AtomPairConstraint p = pose_from_sequence( 'AAA' ) # works on pose_from_pdb Pose's too a1 = AtomID( 2 , 1 ) # residue 1 atom CA (2) a2 = AtomID( 2 , 2 ) # residue 2 atom CA (2) f = ConstantFunc( 0 ) # example function, has been seen with a few others apc = AtomPairConstraint( a1 , a2 , f ) p.add_constraint( apc ) # make a scoring function sc = ScoreFunction() sc.set_weight( atom_pair_constraint , 1 ) sc( p ) # work's fine, all is well ####################################### # the bad example # make a demo function to generate the constraint def make_constraint(): a1 = AtomID( 2 , 1 ) # residue 1 atom CA (2) a2 = AtomID( 2 , 2 ) # residue 2 atom CA (2) f = ConstantFunc( 0 ) apc = AtomPairConstraint( a1 , a2 , f ) return apc p = pose_from_sequence( 'AAA' ) apc = make_constraint() p.add_constraint( apc ) sc( p ) # same ScoreFunction as above # causes SeqFault | ||||||||||||
Additional Information | sometimes (at least with ConstantFunc) it returns a different error about not finding func and runs successfully on subsequent runs (I don't have the exact error now because of an annoying bug in mantis I just found...) | ||||||||||||
Tags | No tags attached. | ||||||||||||
Application(s) Affected | Constraint use in PyRosetta | ||||||||||||
Command Line Used | ipython | ||||||||||||
Developer Options | |||||||||||||
Fixed in SVN Version | |||||||||||||
Attached Files | |||||||||||||
![]() |
|
(0000112) mpacella (Attentive Developer) 2012-09-28 15:55 |
Update: I found a workaround to this, but I think the issue should still be considered a bug (especially the fact that PyRosetta segfaults instead of printing something helpful. You can get around this if you return a deep copy of the AtomPairConstraint in your function. So the code looks exactly like it does in the original report but the return line should look like this: return AtomPairConstraint( ape ) #returning a deep copy of the atom pair constraint I'm not entirely sure why this is necessary. It seems like the local variable "ape" must get deallocated when the function exits, hence the segfault when the score function tries to find it. However, if you do: ape = make_constraint() #using the buggy version of make_constraint() print ape you get a genuine AtomPairConstraint object, not a pointer... |
![]() |
|||
Date Modified | Username | Field | Change |
2012-09-27 17:06 | evanbaugh | New Issue | |
2012-09-28 15:55 | mpacella | Note Added: 0000112 |
Copyright © 2000 - 2012 MantisBT Group |