python curses in OGSH (366 Views)
Reply
Occasional Advisor
Matt Joyce
Posts: 9
Registered: ‎10-09-2009
Message 1 of 7 (366 Views)

python curses in OGSH

So it seems that the purveyors of the OGFS thought to include libncurses shared libraries, but no libcurses. Which may be why OGSH scripts using import curses are failing.

Anyone ever had success using curses from within OGSH?
Occasional Advisor
Matt Joyce
Posts: 9
Registered: ‎10-09-2009
Message 2 of 7 (366 Views)

Re: python curses in OGSH

A little bit of progress...

got a partial display before a segfault by setting TERMINFO_DIRS in the OGSH env.

As such:

export TERMINFO_DIRS=/opt/opsware/ogfsutils/share/terminfo

It began to draw the curses application to screen, but subsequently segfaulted before being able to run.
Occasional Advisor
Matt Joyce
Posts: 9
Registered: ‎10-09-2009
Message 3 of 7 (366 Views)

Re: python curses in OGSH

Isolated issue to screen.addstr() function call in python using curses module.

Could be LOCALE related. Not sure yet.
Occasional Advisor
Matt Joyce
Posts: 9
Registered: ‎10-09-2009
Message 4 of 7 (366 Views)

Re: python curses in OGSH

I am not sure what is going on here, so I uploaded strace to OGSH and pulled some info... this is just before the Segmentation Fault.

All ideas welcomed.

11748 access("/opt/opsware/ogfsutils/share/terminfo/x/xterm", R_OK) = 0
11748 open("/opt/opsware/ogfsutils/share/terminfo/x/xterm", O_RDONLY) = 3
11748 read(3, "\32\0010\0&\0\17\0\235\1&\5", 12) = 12
11748 read(3, "xterm|xterm terminal emulator (X"..., 48) = 48
11748 read(3, "\0\1\0\0\1\0\0\0\1\0\0\0\0\1\1\0\0\0\0\0\0\0\1\0\0\1\0\0\1\0\0\0"..., 38) = 38
11748 read(3, "P\0\10\0\30\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\10\0@\0", 30) = 30
11748 read(3, "\0\0\4\0\6\0\10\0\31\0\36\0&\0*\0.\0\377\3779\0J\0L\0P\0W\0\377\377"..., 826) = 826
11748 read(3, "\33[Z\0\7\0\r\0\33[%i%p1%d;%p2%dr\0\33[3g\0\33["..., 1318) = 1318
11748 read(3, "\1\0\0\0\v\0\27\0\200\0", 10) = 10
11748 read(3, "\1", 1) = 1
11748 read(3, "\0", 1) = 1
11748 read(3, "\377\377\0\0\7\0\16\0\25\0\34\0#\0*\0001\0008\0?\0\0\0\3\0\6\0\n\0\17\0"..., 46) = 46
11748 read(3, "\33[1;2B\0\33[1;5B\0\33[1;6B\0\33[1;5D\0\33[1;"..., 128) = 128
11748 close(3) = 0
11748 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, TIOCGWINSZ, {ws_row=69, ws_col=170, ws_xpixel=0, ws_ypixel=0}) = 0
11748 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon -echo ...}) = 0
11748 rt_sigaction(SIGTSTP, NULL, {SIG_DFL}, 8) = 0
11748 rt_sigaction(SIGTSTP, {0x2a98caef30, [], SA_RESTORER|SA_RESTART, 0x2a9577b5b0}, NULL, 8) = 0
11748 rt_sigaction(SIGINT, NULL, {SIG_IGN}, 8) = 0
11748 rt_sigaction(SIGTERM, NULL, {SIG_IGN}, 8) = 0
11748 rt_sigaction(SIGWINCH, NULL, {SIG_DFL}, 8) = 0
11748 rt_sigaction(SIGWINCH, {0x2a98caf1d0, [], SA_RESTORER, 0x2a9577b5b0}, NULL, 8) = 0
11748 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon -echo ...}) = 0
11748 write(1, "\33[?1049h\33[1;69r\33(B\33[m\33[4l\33[?7h\33["..., 37) = 37
11748 rt_sigaction(SIGTSTP, {SIG_IGN}, {0x2a98caef30, [], SA_RESTORER|SA_RESTART, 0x2a9577b5b0}, 8) = 0
11748 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
11748 ioctl(1, TIOCGWINSZ, {ws_row=69, ws_col=170, ws_xpixel=0, ws_ypixel=0}) = 0
11748 write(1, "\33[H\33[2J\33(0\33[0mlqqqqqqqqqqqqqqqqq"..., 927) = 927
11748 rt_sigaction(SIGTSTP, {0x2a98caef30, [], SA_RESTORER|SA_RESTART, 0x2a9577b5b0}, NULL, 8) = 0
11748 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
11748 +++ killed by SIGSEGV +++
Occasional Advisor
Matt Joyce
Posts: 9
Registered: ‎10-09-2009
Message 5 of 7 (366 Views)

Re: python curses in OGSH

Well I've confirmed /usr/lib/locale information is being loaded and there's no errors visible there.

I am stumped and out of ideas.
Occasional Advisor
Matt Joyce
Posts: 9
Registered: ‎10-09-2009
Message 6 of 7 (366 Views)

Re: python curses in OGSH

Well it appears that what it comes down to is this. The opsw distributed python 2.4 distro does not support curses. No idea why that is. Something is fubar with the distro.

I went through the ogfs tools and normalized pretty much every aspect of the term, locale, and charmap environments and python still cannot perform a window.addstr without segfaulting.

I executed from within the RHAS4 environment using the python 2.4 opsw distro and was able to recreate the segmentation fault condition on screen.addstr() calls.

I hope at some point HP addresses the issue.

Occasional Advisor
Matt Joyce
Posts: 9
Registered: ‎10-09-2009
Message 7 of 7 (366 Views)

Re: python curses in OGSH

Just a quick addendum.

The default OGFS lacks proper character map support. There's no reason not to throw it into the tools list.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.