Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV in os.putenv() #69816

Closed
PaweKrawczyk mannequin opened this issue Nov 15, 2015 · 2 comments
Closed

SIGSEGV in os.putenv() #69816

PaweKrawczyk mannequin opened this issue Nov 15, 2015 · 2 comments
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@PaweKrawczyk
Copy link
Mannequin

PaweKrawczyk mannequin commented Nov 15, 2015

BPO 25630

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2015-11-16.05:58:19.431>
created_at = <Date 2015-11-15.23:22:18.300>
labels = ['library', 'type-crash']
title = 'SIGSEGV in os.putenv()'
updated_at = <Date 2015-11-16.05:58:19.429>
user = 'https://bugs.python.org/PaweKrawczyk'

bugs.python.org fields:

activity = <Date 2015-11-16.05:58:19.429>
actor = 'python-dev'
assignee = 'none'
closed = True
closed_date = <Date 2015-11-16.05:58:19.431>
closer = 'python-dev'
components = ['Library (Lib)']
creation = <Date 2015-11-15.23:22:18.300>
creator = 'Pawe\xc5\x82 Krawczyk'
dependencies = []
files = []
hgrepos = []
issue_num = 25630
keywords = []
message_count = 2.0
messages = ['254700', '254714']
nosy_count = 2.0
nosy_names = ['python-dev', 'Pawe\xc5\x82 Krawczyk']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue25630'
versions = ['Python 3.5']

@PaweKrawczyk
Copy link
Mannequin Author

PaweKrawczyk mannequin commented Nov 15, 2015

A numerical value argument of the os.putenv() call causes my python3.5 to crash with SIGSEGV, for example:

Python 3.5.0+ (default, Oct 11 2015, 09:05:38) 
[GCC 5.2.1 20151010] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.putenv('AAA', 1)
Segmentation fault (core dumped)

While numerical 1 (one) is not a valid argument for the function which expects a string as value, it shouldn't crash but rather throw an exception. This seems to be the behaviour in python3.4:

Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.putenv('AAA', 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Can't convert 'int' object to str implicitly
>>>

I can provide a strace/ltrace/core dump but it's huge and I'm not sure if it's necessary taking into account that this issue is trivial to reproduce.

@PaweKrawczyk PaweKrawczyk mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels Nov 15, 2015
@python-dev
Copy link
Mannequin

python-dev mannequin commented Nov 16, 2015

New changeset 3ae62099d70b by Benjamin Peterson in branch '3.5':
make the PyUnicode_FSConverter cleanup set the decrefed argument to NULL (closes bpo-25630)
https://hg.python.org/cpython/rev/3ae62099d70b

New changeset d8d67b502bcc by Benjamin Peterson in branch 'default':
merge 3.5 (bpo-25630)
https://hg.python.org/cpython/rev/d8d67b502bcc

@python-dev python-dev mannequin closed this as completed Nov 16, 2015
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

0 participants