Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211535 - ufed crashes inside screen in openvz container if ncurses is built with USE="gpm"
Summary: ufed crashes inside screen in openvz container if ncurses is built with USE="...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-26 16:08 UTC by Peter Volkov (RETIRED)
Modified: 2009-02-23 12:08 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gpm-1.20.1-deb-alt-xterm_mouse_support.patch (gpm-1.20.1-deb-alt-xterm_mouse_support.patch,2.91 KB, patch)
2008-02-26 16:32 UTC, Peter Volkov (RETIRED)
Details | Diff
gpm-1.20.1-mdk-alt-consolename.patch (gpm-1.20.1-mdk-alt-consolename.patch,891 bytes, patch)
2008-02-26 16:35 UTC, Peter Volkov (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Volkov (RETIRED) gentoo-dev 2008-02-26 16:08:03 UTC
If inside openvz container (I did not managed to reproduce in chroot) you build ncurses with USE="gpm" ufed will die with "Segmentation fault" inside screen (or just set TERM=screen) with the following backtrace:

#0  0xb7dd2b35 in Gpm_Open (conn=0x809dfb4, flag=0) at lib/liblow.c:262
#1  0xb7f1ac65 in enable_gpm_mouse (enable=<value optimized out>)
    at /var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/ncurses/base/lib_mouse.c:390
#2  0xb7f1b487 in _nc_mouse_init ()
    at /var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/ncurses/base/lib_mouse.c:442
#3  0xb7f1b789 in mousemask (newmask=15, oldmask=0xffffffff)
    at /var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/ncurses/base/lib_mouse.c:1264
#4  0x0804a11e in initcurses () at ufed-curses.c:40
#5  0x0804ae9f in main () at ufed-curses-checklist.c:341
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2008-02-26 16:32:32 UTC
Created attachment 144683 [details, diff]
gpm-1.20.1-deb-alt-xterm_mouse_support.patch

Attached patch I took from the following link:
http://www.sisyphus.ru/srpm/Sisyphus/gpm/patches
fixes the issue. But seems that this patch possibly could create new problems. At least one program (clines, not in portage http://manticore.2y.net/prj/clines-g.html) loose some formatting (adds additional spaces) with that patch. In Russian the problem was described in the following message:

http://lists.altlinux.org/pipermail/devel/2006-August/047745.html

Short version in English. cline has the following code

initscr();
   int fd = Gpm_Open();
   if (fd == -2) { Gpm_Close(); } 
...........game here...................
   endwin();

initscr() : opens terminaland sets correct state for the game
Gpm_Open(with this patch !!) : calls setupterm(), and this overwrites values save in ncurses
endwin() restores the state just before Gpm_Open() , and this restores state correct for the game but not for terminal, thus additional spaces

I'll try to investigate if this is correct, but generally I do not use gpm so I'm not sure that I'll return to this problem in the nearest future. So I'm posting this bug generally for documentation purposes.
Comment 2 Peter Volkov (RETIRED) gentoo-dev 2008-02-26 16:35:21 UTC
Created attachment 144684 [details, diff]
gpm-1.20.1-mdk-alt-consolename.patch

Together with the previous patch this patch also affects same parts of code, but I did not found why this patch is required. This requires investigation too.
Comment 3 SpanKY gentoo-dev 2008-12-31 10:18:07 UTC
i dont suppose people have tested gpm-1.20.5 ?
Comment 4 Alexey Shvetsov archtester gentoo-dev 2008-12-31 12:01:29 UTC
(In reply to comment #3)
> i dont suppose people have tested gpm-1.20.5 ?
> 

currently no
but i can test it today on amd64 machine
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2009-02-23 12:08:26 UTC
Thank you Mike for heads up. This issue is really fixed in gpm-1.20.5. At least I'm unable to reproduce this problem.