Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 9604 - urlview segfaults, when compiled with ncurses
Summary: urlview segfaults, when compiled with ncurses
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Nick Hadaway
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-24 09:01 UTC by Christian V. J. Brüssow
Modified: 2003-02-04 19:42 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian V. J. Brüssow 2002-10-24 09:01:00 UTC
Hi,

I've emerged urlview-0.9 to use within mutt, but the following goes even for the
commandline: urlview segfaults, when it finds a valid URL in its input, and when
it is compiled with ncurses. I have recompiled it with ./configure --with-slang,
and everything works fine.

I have: Gentoo 1.4_rc1, gcc-3.2, ncurses-5.2.20020511-r2 (as everything above is
masked), and slang-1.4.5-r2.

Christian
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-10-24 13:41:50 UTC
what compiler optimisations are you using?
Comment 2 Christian V. J. Brüssow 2002-10-25 05:03:17 UTC
I have the follwoing in /etc/make.conf:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=athlon -O2 -pipe -fomit-frame-pointer"

Christian
Comment 3 Nick Hadaway 2002-11-23 10:01:19 UTC
I have experienced no problems with urlview.  Using the same version as you or
the newest ncurses-5.3-r1... I have also compiled it both with gcc-3.2 and
gcc-3.2.1 and have had no problems.

Can you give me an example of how you use it with mutt as I am testing it
standalone...
Comment 4 Christian V. J. Brüssow 2002-11-24 12:11:38 UTC
I have the following in my ~/.muttrc:
macro   pager	"\Cb"	"|urlview -\n"

But it also segfaults when I call it at the command prompt and give it a file
with a valid URL in it, e.g.:

$ cat textfile|urlview

If there is no URL in that file, it says "No URLs found.", without segfaulting.
So, it is not a mutt-urlview problem.
Comment 5 Nick Hadaway 2002-12-01 21:40:02 UTC
And just in case ncurses was a problem, I just emerged it on our current stable
profile with the same ncurses version as you.

Try removing -fomit-frame-pointer from your compile options... this will cause
problems with some packages that I have seen.
Comment 6 Christian V. J. Brüssow 2002-12-04 14:41:22 UTC
Sorry for the late reply.
I have recompiled ncurses (5.3-r1) and urlview (0.9) with
CFLAGS="-O2", and CXXFLAGS=$CFLAGS in my /etc/make.conf, but the result remains
the same: urlview segfaults when reading a file with a valid url in it.
BTW: an upgrade from gcc-3.2 to gcc-3.2.1 changed nothing.
Comment 7 Nick Hadaway 2003-01-20 08:38:30 UTC
I still don't have any problems with urlview and just emerged it on a
different test system with the latest gcc,ncurses, etc... I have tested
urlview in both a console and x-window envrionment.  As I have not been able
to re-create your problem on multiple test systems I am not sure what the
problem is.

Do you have any special locale settings or terminal settings that you use?  The log of your latest compile and/or a log or a backtrace from a run of urlview might be helpful as well.
Comment 8 Christian V. J. Brüssow 2003-01-21 14:40:51 UTC
Hello,

My locale settings: LC_ALL=de_DE@euro, LANG=de_DE@euro, but even if I set them
to "C" or "POSIX", urlview segfaults. BTW it only segfaults, when reading from a
pipe, so:

cat file_with_url|urlview - ==> segmentation fault
urlview file_with_url ==> it works!

Here a strace:
$ strace cat urlfile|urlview
execve("/bin/cat", ["cat", "urlfile"], [/* 69 vars */]) = 0
uname({sys="Linux", node="tethys.terminus.net", ...}) = 0
brk(0)                                  = 0x804c9a8
open("/etc/ld.so.preload", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
close(3)                                = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=68192, ...}) = 0
mmap2(NULL, 68192, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40014000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360^\1"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1408568, ...}) = 0
mmap2(NULL, 1231972, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40025000
mprotect(0x40149000, 35940, PROT_NONE)  = 0
mmap2(0x40149000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x124)
= 0x40149000
mmap2(0x4014e000, 15460, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4014e000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40152000
munmap(0x40014000, 68192)               = 0
brk(0)                                  = 0x804c9a8
brk(0x804d9a8)                          = 0x804d9a8
brk(0x804e000)                          = 0x804e000
fstat64(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
open("urlfile", O_RDONLY|O_LARGEFILE)   = 3
fstat64(3, {st_mode=S_IFREG|0640, st_size=59, ...}) = 0
read(3, "Dies ist ein Test.\nDies: http://"..., 4096) = 59
write(1, "Dies ist ein Test.\nDies: http://"..., 59) = 59
read(3, "", 4096)                       = 0
close(3)                                = 0
_exit(0)                                = ?
Segmentation fault

Maybe an ncurses problem? As spice (app-sci/spice) segfaults, too, and it is
compiled with ncurses, here a last lines from a strace run:

$ strace cat RC-Hochpass.cir|spice
...open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360^\1"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1408568, ...}) = 0
mmap2(NULL, 1231972, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40025000
mprotect(0x40149000, 35940, PROT_NONE)  = 0
mmap2(0x40149000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x124)
= 0x40149000
mmap2(0x4014e000, 15460, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4014e000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40152000
munmap(0x40014000, 68192)               = 0
brk(0)                                  = 0x804c9a8
brk(0x804d9a8)                          = 0x804d9a8
brk(0x804e000)                          = 0x804e000
fstat64(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
open("RC-Hochpass.cir", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0600, st_size=396, ...}) = 0
read(3, "Hochpass\n* Stand: Son 19 Jan 200"..., 4096) = 396
write(1, "Hochpass\n* Stand: Son 19 Jan 200"..., 396) = 396
read(3, "", 4096)                       = 0
close(3)                                = 0
_exit(0)                                = ?

Circuit: Hochpass


internal error -- segmentation violation

But, spice segfaults even, when not reading from a pipe, so maybe I'm totally wrong.

Thank you for your trouble,
Christian