Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70254 - net-misc/urlview segfault on amd64 environment
Summary: net-misc/urlview segfault on amd64 environment
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-06 05:10 UTC by OKUMURA N. Shin-ya
Modified: 2005-02-26 04:18 UTC (History)
0 users

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


Attachments
patch for the missing include bug (include-fix.patch,238 bytes, patch)
2005-02-06 09:11 UTC, Bernhard Ager
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description OKUMURA N. Shin-ya 2004-11-06 05:10:43 UTC
net-misc/urlview-0.9 segfaults on amd64 environment as follows;

urlview $MAIL
--
UrlView 0.9: (1 matches) Press Q or Ctrl-C to Quit!

->    1 http://cxx.uclibc.org/
--
(and type [1] and [enter], then shows;)
--
URL: http://cxx.uclibc.org/
--
(and type [enter], then segfaults.)

gdb backtrace was as follows;
(gdb) bt
#0 0x0000002a95826ab0 in strlen () from /lib/libc.so.6
#1 0x0000002a957fcb62 in vfprintf () from /lib/libc.so.6
#2 0x0000002a9581b8b6 in vsnprintf () from /lib/libc.so.6
#3 0x0000002a95803463 in snprintf () from /lib/libc.so.6
#4 0x000000000040214c in main (argc=-1073749536,
argv=0x7fbffff748)
    at urlview.c:510

This bug seems come from LP64 problem.
The segmentation fault happens at
--
snprintf (buf, sizeof (buf), command, quote (scratch, sizeof (scratch), url[current]));
--
Function 'quote' is not prototyped in urlview.c, so it is mistaked to return int value (32bit), but not pointer to char (64bit).

I added '#include "quote.h"' at 48th line of urlview.c,
and then it works correctly here, in current.
Comment 1 Bernhard Ager 2005-02-06 09:11:26 UTC
Created attachment 50542 [details, diff]
patch for the missing include bug

Actually this patch adds the missing #include to line 43 to prevent a clash
with the no-trailing-newline.patch

Please apply and mark urlview ~amd64
Comment 2 Simon Stelling (RETIRED) gentoo-dev 2005-02-26 04:18:57 UTC
sorry for the huge delay, but finally, it's fixed :)