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

2.5.1 curses panel segfault in new_panel on aix 5.3 #45139

Closed
maswan mannequin opened this issue Jun 29, 2007 · 6 comments
Closed

2.5.1 curses panel segfault in new_panel on aix 5.3 #45139

maswan mannequin opened this issue Jun 29, 2007 · 6 comments
Labels
extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@maswan
Copy link
Mannequin

maswan mannequin commented Jun 29, 2007

BPO 1745108
Nosy @akuchling

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-04-14.15:54:11.911>
created_at = <Date 2007-06-29.00:13:53.000>
labels = ['extension-modules', 'type-crash']
title = '2.5.1 curses panel segfault in new_panel on aix 5.3'
updated_at = <Date 2015-04-14.15:54:11.909>
user = 'https://bugs.python.org/maswan'

bugs.python.org fields:

activity = <Date 2015-04-14.15:54:11.909>
actor = 'akuchling'
assignee = 'none'
closed = True
closed_date = <Date 2015-04-14.15:54:11.911>
closer = 'akuchling'
components = ['Extension Modules']
creation = <Date 2007-06-29.00:13:53.000>
creator = 'maswan'
dependencies = []
files = []
hgrepos = []
issue_num = 1745108
keywords = []
message_count = 6.0
messages = ['32421', '32422', '32423', '59006', '61393', '240919']
nosy_count = 6.0
nosy_names = ['akuchling', 'nnorwitz', 'psmedley', 'sable', 'maswan', 'David.Edelsohn']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue1745108'
versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

@maswan
Copy link
Mannequin Author

maswan mannequin commented Jun 29, 2007

I've compiled python 2.5.1 on AIX 5.3 with ncurses 5.6 and I get segmentation faults as soon as any curses.panel tries to make a new panel.

The following test program gives a segmentation fault for me (remove the new_panel line and it works fine):

import curses
from curses import panel
def mkpanel(scr):
        win = curses.newwin(8,8,1,1)
        pan = panel.new_panel(win)
curses.wrapper(mkpanel)

Also the test_curses program triggers this segfault. A traceback puts the problem in:

root_panel(), line 57 in "p_new.c"
new_panel(win = 0x0000000110246dc0), line 90 in "p_new.c"
PyCurses_new_panel(self = (nil), args = 0x0000000110246dc0), line 396 in "_curses_panel.c"
PyCFunction_Call(func = 0x000000011024a368, arg = 0x0000000110246dc0, kw = (nil)), line 73 in "methodobject.c"

Note that the ncurses I've compiled works fine with the shipped test programs, so it seems to be an issue with the python interaction.

Please let me know if there is anything else that I can provide to help track this bug down.

@maswan maswan mannequin added extension-modules C modules in the Modules dir labels Jun 29, 2007
@nnorwitz
Copy link
Mannequin

nnorwitz mannequin commented Jul 3, 2007

No python developer has access to AIX AFAIK. So you will likely need to debug this problem yourself or provide access to an AIX box. Here are some questions to get you started:

  • Does this problem happen as a 32-bit exe rather than 64-bit?
  • Did you use xlc, gcc, or some other compiler?
  • What happens if you switch compilers?
  • Does this happen if you disable optimization?
  • What happens if you build a debug version of python (./configure --with-pydebug)?
  • Do you have any memory debugging tool that you can use to track this down?

It looks like there is a problem derefencing a function pointer. I don't know why that might happen.

@maswan
Copy link
Mannequin Author

maswan mannequin commented Jul 3, 2007

We'll look into the issue of temporarily giving someone access, but it is somewhat problematic.

Some answers until then:

  • Same behaviour on both 32-bit and 64-bit
  • Compiled with xlc v8.0
  • I will try and set gcc up
  • Same behaviour with or without optimization, debug flags, etc (just slightly different backtraces, less verbose without debug symbols)
  • Same thing --with-pydebug or without, just slightly different output
  • I'll look, but nothing comes to mind right now

@psmedley
Copy link
Mannequin

psmedley mannequin commented Dec 26, 2007

I see similar problems here on OS/2 with Python 2.5.1 and Ncurses 5.6.

Problem is causes as win->win is uninitialised when passed to new_panel.

Initialising win->win to a value makes the new_panel call work. Not
sure why this works on other platforms but fails on OS/2 and AIX.

@akuchling
Copy link
Member

I don't see how win->win could be uninitialized. curses.newwin() creates
a PyCursesWindowObject using PyCursesWindow_New(), which always fills in
the ->win field.

I'm puzzled by the 2007-06-28 traceback. Pycurses_new_panel has args =
0x0000000110246dc0; args should be a Python tuple containing the
function's arguments. But the new_panel call has
win=0x0000000110246dc0, the exact same pointer, which is obviously
wrong. The code in PyCurses_new_panel does win->win, though, so the
pointer should be different. Perhaps the traceback is wrong? Or
perhaps this is a code-generation bug affecting PyCurses_new_panel?
(But that function is small and straightforward -- I find it hard to
imagine a compiler getting it wrong.)

@BreamoreBoy BreamoreBoy mannequin added type-crash A hard crash of the interpreter, possibly with a core dump labels Jul 21, 2014
@akuchling
Copy link
Member

Closing this ticket as outdated; AIX 5.3 is from 2004.

@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
extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

1 participant