Seg Fault in login.form in PyPy
I have a repeatable test to create a Segmentation Fault error using lxml.forms running under PyPy. Merely accessing the form.fields attribute is sufficient. If there is anything more I can do to help with this bug, just let me know. Thanks. - Jeff ----------------------- My test output: ----------------------- test_receipt (bias.tests.crawler.test_pacer_new.TestPacerShowReceiptProperty) ... Python : (major=2, minor=7, micro=10, releaselevel='final', serial=42) lxml.etree : (3, 5, 0, -99) libxml used : (2, 8, 0) libxml compiled : (2, 8, 0) libxslt used : (1, 1, 26) libxslt compiled : (1, 1, 26) first collection ('login_form name = $s, value = %s', 'login', '') ('login_form name = $s, value = %s', 'key', None) ('login_form name = $s, value = %s', 'clcode', None) ('login_form name = $s, value = %s', 'redaction', None) ('login_form name = $s, value = %s', 'button1', 'Login') ('login_form name = $s, value = %s', 'reset ', 'Reset') second collection fish: Job 1, “nosetests --pdb --nocapture -v -x bias” terminated by signal SIGSEGV (Address boundary error) ----------------------- My code ----------------------- def login(self, rd=None): import gc if self._logged_in: return True login_url = urljoin(self._base_url, self.LOGIN_URL) log.debug("Logging in...") login_page = self._visit(login_url) log.debug("Got login form, pausing...") login_info = html.fromstring(login_page.text) login_form = login_info.forms[0] #print ("login %s, key %s, clcode %s", self.user_name, self.user_password, self.CLIENT_CODE) print "login_form = \n%s", html.tostring(login_form, pretty_print=True) gc.collect() print "first collection" #return True # THIS WORKS form_fields = login_form.fields for field in form_fields.inputs: print ("login_form name = $s, value = %s", field.name, field.value) gc.collect() print "second collection" form_fields['login'] = self.user_name form_fields['key'] = self.user_password form_fields['clcode'] = self.CLIENT_CODE gc.collect() print "third collection" return True # THIS DOES NOT WORK ----------------------- The login form (granted it's ugly, but it's a real govt. site that works fine under CPython) ----------------------- login_form = %s <form name="GetPass" enctype="multipart/form-data" method="POST" action="/cgi-bin/login.pl"> <!-- $Header: /usr/local/cvsroot/district/web/html/login.htm,v 5.8.2.1 2010/05/12 17:21:39 dwilharm Exp $ --> <title></title> <basefonf size="2"><font face="arial,helvetica"> <font color="#0000cc" size="5"> <b>CM/ECF Filer or PACER Login</b> </font> <br><br><table width="100%" border="0"><tr> <td> <p><font face="arial,helvetica" size="+1"><b>Notice</b></font><br> This is a <b>Restricted Web Site</b> for Official Court Business only. Unauthorized entry is prohibited and subject to prosecution under Title 18 of the U.S. Code. All activities and access attempts are logged. </p> <p> <!-- <P><FONT FACE="arial,helvetica" SIZE=+1 COLOR="RED"><B>Notice</B></FONT><br> <FONT FACE="arial,helvetica" SIZE=+1 COLOR="RED"></FONT> <P> --> </p> <p><font face="arial,helvetica" size="+1"><b>Instructions for filing:</b></font><br> Enter your CM/ECF filer login and password if you are electronically filing something with the court. </p> <p> </p> <p><font face="arial,helvetica" size="+1"><b>If you received this login page as a result of a link from a Notice of Electronic Filing email:</b></font><br> Enter your CM/ECF filer login and password. The system prompts customers for a CM/ECF login and password when attempting to view certain types of documents. </p> <p> </p> <p><font face="arial,helvetica" size="+1"><b>If you have trouble viewing a document:</b></font><br> After successful entry of your CM/ECF login, you should be able to view the document. If you receive the message "You do not have permission to view this document," viewing the document is restricted to attorneys of record in the case and the system does not recognize you as such. If the login prompt appears again, after you have entered your CM/ECF login and password, it means that the "free look" link has expired. You will need to enter your PACER login and password to view the document. </p> <p> </p> <p><font face="arial,helvetica" size="+1"><b>Instructions for viewing filed documents and case information:</b></font><br> If you do not need filing capabilities, enter your PACER login and password. If you do not have a PACER login, you may register online at <a href="http://pacer.psc.uscourts.gov">http://pacer.psc.uscourts.gov.</a> </p> <p> </p> </td> </tr></table> <p> </p> <table border="0" cellpadding="6" cellspacing="0"><tr> <td bgcolor="#cccccc"> <font face="arial,helvetica" size="2"> <b>Authentication</b> </font> <table bgcolor="#ffffcc" border="0" cellpadding="4" cellspacing="0"> <tr> <td> <font face="arial,helvetica" size="2"> Login: </font> </td> <td> <input type="text" size="20" maxlength="256" name="login" onkeypress="enter_to_focus(event,document.forms[0].key)" value=""> </td> </tr> <tr> <td> <font face="arial,helvetica" size="2"> Password: </font> </td> <td> <input type="password" size="8" maxlength="8" name="key" onkeypress="enter_to_submit(event)"> </td> </tr> <tr> <td> <font face="arial,helvetica" size="2"> client code: </font> </td> <td> <input type="text" size="32" maxlength="32" name="clcode" onkeypress="enter_to_submit(event)"> </td> </tr> </table> </td> <td> <!-- $Header: /usr/local/cvsroot/district/web/html/redact.htm,v 5.7.2.5 2009/07/01 21:10:53 khosha Exp $ --> <b>IMPORTANT NOTICE OF REDACTION RESPONSIBILITY:</b> All filers must redact: Social Security or taxpayer-identification numbers; dates of birth; names of minor children; financial account numbers; and, in criminal cases, home addresses, in compliance with <a href=" http://pacer.psc.uscourts.gov/privacy/cv.html">Fed. R. Civ. P. 5.2</a> or <a href="http://pacer.psc.uscourts.gov/privacy/cr.html">Fed. R. Crim. P. 49.1</a>. This requirement applies to all documents, including attachments. <br><br><input type="CHECKBOX" name="redaction" value="on"> I understand that, if I file, I must comply with the redaction rules. I have read this notice. </td> </tr></table></font> <script language="JavaScript"> clearAllCookies(); </script><table> <td><input name="button1" value="Login" type="submit"></td> <td></td> <td><input name="reset " type="RESET" value="Reset"></td> </table></basefonf> </form>
participants (1)
-
Jeff Doran