Bug 120240 - w3m segfaults when calling getch()
w3m segfaults when calling getch()
Product: Fedora
Classification: Fedora
Component: w3m (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Akira TAGOH
Depends On:
Blocks: FC2Target
  Show dependency treegraph
Reported: 2004-04-06 22:41 EDT by Akira TAGOH
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version: 0.5-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-04-21 02:11:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Akira TAGOH 2004-04-06 22:41:08 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.4.1)

Description of problem:
it seems that the applications which linked against gpm doesn't work
at the same time, when it's ran, that application crashes.

Here is the backtrace:
$ gdb --args w3m -o http://www.google.co.jp/
GNU gdb Red Hat Linux (6.0post-0.20040223.8rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) r
Starting program: /usr/bin/w3m http://www.google.co.jp/
Detaching after fork from child process 2035.
Detaching after fork from child process 2037.
Program received signal SIGSEGV, Segmentation fault.
0x07e50af0 in Gpm_Wgetch (win=0x0) at lib/libcurses.c:80
80              return GET(win);
(gdb) bt
#0  0x07e50af0 in Gpm_Wgetch (win=0x0) at lib/libcurses.c:80
#1  0x08091aec in do_getch () at terms.c:1852
#2  0x0804c927 in main (argc=4, argv=0xfef02194, envp=0xfef021a8) at
#3  0x0099ef43 in __libc_start_main () from /lib/tls/libc.so.6
#4  0x0804b691 in _start ()

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.run gnome-terminal and screen then
2.run w3m http://www.google.co.jp/
3.press any key

Actual Results:  w3m crashes.

Expected Results:  w3m works well.

Additional info:
Comment 1 Derek Poon 2004-04-19 08:10:59 EDT
The cause of the segfault is that w3m is not linked with libncurses,
which defines the wgetch() function.  The linker does not complain
when building or running w3m because gpm has declared wgetch to be a
weak symbol -- see gpm-1.20.1-weak-wgetch.patch in the gpm SRPM.

The solution is to append -lncurses at the end of the W3M_LIBS macro
in w3m's Makefile.  That should be accomplished by patching the
configure script.  A less robust kludge would be to simply change
w3m.spec to use a --with-termlib=ncurses argument when calling configure.

(Bug component should probably be changed from gpm to w3m, and a more
accurate summary would be "w3m segfaults when calling getch()".)
Comment 2 Akira TAGOH 2004-04-19 22:49:53 EDT
ok, I have read the changelog for -weak-wgetch.patch. this will be
fixed in w3m. reassign it then.
Comment 3 Akira TAGOH 2004-04-21 02:11:56 EDT
Fixed in 0.5-3
Comment 4 Thomas E. Dickey 2004-10-03 10:10:20 EDT
The analysis is incorrect.  See

Note You need to log in before you can comment on or make changes to this bug.