Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6415] warnings.warn segfaults on bad formatted string

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 4, 2009, 3:14 AM

Post #1 of 11 (192 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string

New submission from wiesenth <d.wiesenthal[at]gmx.de>:

The interpreter crashes with an segmentation fault when warnings.warn
shall output a Warning instance, whose string representation is bad
formatted.

Don't know if this is fixed in a minor 2.6 release or in 2.7, I use the
Ubuntu 9.04 python2.6 package.

An easy reproducing example is given.

This is also an issue within python3.0 (python3.1 does not exist in the
repositories)

----------
files: warnsegfault.py
messages: 90111
nosy: wiesenth
severity: normal
status: open
title: warnings.warn segfaults on bad formatted string
type: crash
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file14447/warnsegfault.py

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 4, 2009, 5:59 AM

Post #2 of 11 (177 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Hirokazu Yamamoto <ocean-city[at]m2.ccsnet.ne.jp> added the comment:

I hope attached patch will fix this issue.

----------
keywords: +patch
nosy: +ocean-city
Added file: http://bugs.python.org/file14448/warnings_segfault.patch

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 4, 2009, 6:33 AM

Post #3 of 11 (174 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Changes by Benjamin Peterson <benjamin[at]python.org>:


----------
assignee: -> brett.cannon
nosy: +brett.cannon

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 4, 2009, 10:23 AM

Post #4 of 11 (171 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Jerry Chen <jerry[at]3rdengine.com> added the comment:

Bug and patch confirmed on both py3k and python2.7 branches

Before:

$ ./python.exe warnsegfault.py
this exception is caught: incomplete format
this exception is also caught: incomplete format
Bus error

After:

$ ./python.exe warnsegfault.py this exception is caught: incomplete format
this exception is also caught: incomplete format
Traceback (most recent call last):
File "warnsegfault.py", line 21, in <module>
warnings.warn(MyWarning())
File "warnsegfault.py", line 10, in __str__
return "A bad formatted string %(err)" % {"err" : "there is no %(err)s"}
ValueError: incomplete format

----------
nosy: +jcsalterego

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 16, 2009, 10:22 PM

Post #5 of 11 (135 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Changes by Brett Cannon <brett[at]python.org>:


----------
components: +Interpreter Core
priority: -> release blocker
stage: -> patch review

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 16, 2009, 10:59 PM

Post #6 of 11 (135 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Brett Cannon <brett[at]python.org> added the comment:

Here is a patch for test_warning to test for the failure. Hirokazu, since
you found the fix, do you want to do the commit, or do you want me to
handle it since this will need to be applied to all active branches?

----------
assignee: brett.cannon -> ocean-city
stage: patch review -> commit review
Added file: http://bugs.python.org/file14513/test_warnings.diff

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 17, 2009, 12:03 AM

Post #7 of 11 (135 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Hirokazu Yamamoto <ocean-city[at]m2.ccsnet.ne.jp> added the comment:

I've committed in r74040(trunk), r74043(release26-maint), r74046(py3k),
r74047(release31-maint). Is release30-maint still active?

----------
resolution: -> fixed
stage: commit review -> committed/rejected
status: open -> closed
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.0

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 17, 2009, 10:20 AM

Post #8 of 11 (135 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Brett Cannon <brett[at]python.org> added the comment:

On Fri, Jul 17, 2009 at 00:03, Hirokazu Yamamoto <report[at]bugs.python.org>wrote:

>
> Hirokazu Yamamoto <ocean-city[at]m2.ccsnet.ne.jp> added the comment:
>
> I've committed in r74040(trunk), r74043(release26-maint), r74046(py3k),
> r74047(release31-maint). Is release30-maint still active?
>

No, 3.0 is dead.

Thanks, Hirokazu!

----------
Added file: http://bugs.python.org/file14516/unnamed

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
Attachments: unnamed (0.66 KB)


report at bugs

Jul 18, 2009, 2:34 PM

Post #9 of 11 (124 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

R. David Murray <rdmurray[at]bitdance.com> added the comment:

The backport to 2.6 needs adjustment. The test fails:

Traceback (most recent call last):
File
"/home/rdmurray/python/release26-maint/Lib/test/test_warnings.py", line
350, in test_bad_str
with self.assertRaises(ValueError):
TypeError: failUnlessRaises() takes at least 3 arguments (2 given)

assertRaises can't be used as a context manager in 2.6.

----------
nosy: +r.david.murray
status: closed -> open

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 18, 2009, 8:41 PM

Post #10 of 11 (124 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Hirokazu Yamamoto <ocean-city[at]m2.ccsnet.ne.jp> added the comment:

Thank you, I've fixed it in r74091. I should have checked test results
on all branches.

----------

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 19, 2009, 6:09 AM

Post #11 of 11 (123 views)
Permalink
[issue6415] warnings.warn segfaults on bad formatted string [In reply to]

Changes by R. David Murray <rdmurray[at]bitdance.com>:


----------
status: open -> closed

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue6415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.