Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Links (web browser)
@ 1999-11-26 18:52 Jurij Smakov
  1999-11-27 23:50 ` Michal Jaegermann
  0 siblings, 1 reply; 2+ messages in thread
From: Jurij Smakov @ 1999-11-26 18:52 UTC (permalink / raw)
  To: axp-list

Hello!

I'm not using Alpha as a desktop, but knowing the problems with web
browsers for this architecture I wanted to point out, that there is
a new text-based browser out there. It is called "links" and home page
is 

http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/links/

It can render tables (even slashdot.org appears quite decently)
and has a nice user interface with pull-down menus.
Unfortunately, it does not run on Alpha "out-of-the-box" (it compiles ok,
but segfaults), but probably someone with porting experience could
give it a shot.  

Best regards,

|       _      | Condensed Matter Theory Group | Phone      : +46-8-7907210   |
| Jurij Smakov | Department of Physics         | Fax        : +46-8-104879    |
|              | Royal Inst. of Technology     |------------------------------|
|   Graduate   | S-10044 Stockholm             | jurijus@theophys.kth.se      |
|   Student    | Sweden                        | www.theophys.kth.se/~jurijus |


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Links (web browser)
  1999-11-26 18:52 Links (web browser) Jurij Smakov
@ 1999-11-27 23:50 ` Michal Jaegermann
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Jaegermann @ 1999-11-27 23:50 UTC (permalink / raw)
  To: axp-list

Jurij Smakov wrote:
> 
> It is called "links" and home page is 
> 
> http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/links/
>
...
> Unfortunately, it does not run on Alpha "out-of-the-box" (it compiles ok,
> but segfaults),

No, actually "compiles ok" is very far from beeing the case.  If you try
to compile with -Wall (which you always should as an obvious thing to
do) then, among multiple other things you will see these:

gcc -DHAVE_CONFIG_H -I. -I. -I.     -O2 -g -Wall -c html.c
html.c: In function `new_menu_item':
html.c:1151: warning: cast to pointer from integer of different size
html.c: In function `menu_labels':
html.c:1211: warning: cast from pointer to integer of different size
html.c: In function `menu_contains':
html.c:1218: warning: cast from pointer to integer of different size
gcc -DHAVE_CONFIG_H -I. -I. -I.     -O2 -g -Wall -c html_r.c
html_r.c: In function `html_special':
html_r.c:548: warning: cast to pointer from integer of different size
gcc -DHAVE_CONFIG_H -I. -I. -I.     -O2 -g -Wall -c menu.c
menu.c: In function `display_codepage':
menu.c:244: warning: cast from pointer to integer of different size
menu.c: In function `assumed_codepage':
menu.c:252: warning: cast from pointer to integer of different size
menu.c: In function `charset_list':
menu.c:273: warning: cast to pointer from integer of different size
session.c: In function `add_time_to_str':
session.c:38: warning: int format, different type arg (arg 3)
session.c:39: warning: int format, different type arg (arg 3)
session.c:39: warning: int format, different type arg (arg 4)
session.c:40: warning: int format, different type arg (arg 3)
session.c:41: warning: int format, different type arg (arg 3)
session.c: In function `do_move':
session.c: In function `win_func':
session.c:1082: warning: cast to pointer from integer of different size
session.c:1082: warning: cast to pointer from integer of different size
gcc -DHAVE_CONFIG_H -I. -I. -I.     -O2 -g -Wall -c terminal.c
terminal.c: In function `in_term':
terminal.c:278: warning: cast from pointer to integer of different size
terminal.c: In function `close_handle':
terminal.c:556: warning: cast from pointer to integer of different size
terminal.c: In function `unblock_terminal':
terminal.c:563: warning: cast to pointer from integer of different size
terminal.c: In function `exec_on_terminal':
terminal.c:596: warning: cast to pointer from integer of different size
gcc -DHAVE_CONFIG_H -I. -I. -I.     -O2 -g -Wall -c types.c
types.c: In function `add_ct_fn':
types.c: In function `really_del_ct':
types.c:187: warning: cast from pointer to integer of different size
types.c: In function `menu_del_ct':
types.c:199: warning: cast from pointer to integer of different size
types.c: In function `menu_add_ct':
types.c:217: warning: cast from pointer to integer of different size
types.c: In function `add_ext_fn':
types.c: In function `really_del_ext':
types.c:362: warning: cast from pointer to integer of different size
types.c: In function `menu_del_ext':
types.c:374: warning: cast from pointer to integer of different size
types.c: In function `menu_add_ext':
types.c:390: warning: cast from pointer to integer of different size
gcc -DHAVE_CONFIG_H -I. -I. -I.     -O2 -g -Wall -c url.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -O2 -g -Wall -c view.c
view.c: In function `selected_item':
view.c:1220: warning: cast from pointer to integer of different size

You can possibly get away with the stuff in html.c.  Parts in session.c,
terminal.c and types.c are obviously quite broken - even on Intel
regardless of the fact that there you can pretend that nothing happened.
The author is, at least partially, aware of this as you can see a
comment like:

 /* !!! FIXME: doesn't work on 64b machines */

in terminal.c.  Also various structures are laid out and used in such
manner that one gets tons of an 'unaligned access' even before the
program really started.

The bomb on a startup is caused directly by a 

struct event {
	int ev;
	int x;
	int y;
	int b;
};

defined like that in links.h.  In a function 'win_func()' from session.c
an attempted use (shudder!) is as follows:
			    read_session_info(win->term->fdin, ses,
			     (char *)ev->b + sizeof(int),
			     *(int *)ev->b))
where 'ev' is a pointer to something of a 'struct event' type.
Dereferencing a pointer which was first cut to 'int' is not going to
fly, I am afraid, and one gets a well deserved SIGSEGV.

The program is likely easier to fix than Mozilla :-) but it is highly
unfortunate that even nowadays people are writing a new code in such
sloppy manner.  "Porting to Alpha" should be understood as an overpolite
translation of "fixing nasty bugs" (like using "%d" format in sprintf to
store in variables which were even __declared__ as long).  It may be not
as easy to fix as you may think; interdependencies can be quite
convoluted and catching all function calls where you can loose
half of your pointer and misalign a stack can be quite a task after
not so small chunk of code was already written.

  Michal


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-11-27 23:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-11-26 18:52 Links (web browser) Jurij Smakov
1999-11-27 23:50 ` Michal Jaegermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox