classification
Title: 2.5.1 curses panel segfault in new_panel on aix 5.3
Type: crash Stage: resolved
Components: Extension Modules Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: David.Edelsohn, akuchling, maswan, nnorwitz, psmedley, sable
Priority: normal Keywords:

Created on 2007-06-29 00:13 by maswan, last changed 2015-04-14 15:54 by akuchling. This issue is now closed.

Messages (6)
msg32421 - (view) Author: Mattias Wadenstein (maswan) Date: 2007-06-29 00:13
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.
msg32422 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2007-07-03 06:21
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.
msg32423 - (view) Author: Mattias Wadenstein (maswan) Date: 2007-07-03 08:12
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
msg59006 - (view) Author: Paul Smedley (psmedley) Date: 2007-12-26 22:59
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.
msg61393 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-01-21 13:48
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.)
msg240919 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2015-04-14 15:54
Closing this ticket as outdated; AIX 5.3 is from 2004.
History
Date User Action Args
2015-04-14 15:54:11akuchlingsetstatus: open -> closed

nosy: + akuchling
messages: + msg240919

resolution: wont fix
stage: resolved
2014-12-31 16:21:49akuchlingsetnosy: - akuchling
2014-07-21 17:56:13BreamoreBoysetnosy: + David.Edelsohn

type: crash
versions: + Python 2.7, Python 3.4, Python 3.5
2010-11-12 20:59:49akuchlingsetassignee: akuchling ->
2010-09-14 13:08:37sablesetnosy: + sable
2008-01-21 13:48:02akuchlingsetassignee: akuchling
messages: + msg61393
nosy: + akuchling
2007-12-26 22:59:10psmedleysetnosy: + psmedley
messages: + msg59006
2007-06-29 00:13:53maswancreate