* Re: some questions.
[not found] <Pine.LNX.3.91.970416144742.30218B-100000@ns2.cmpu.net>
@ 1997-04-16 19:52 ` Ximenes
0 siblings, 0 replies; 10+ messages in thread
From: Ximenes @ 1997-04-16 19:52 UTC (permalink / raw)
Due to negligence at 03:06 PM 4/16/97 -0500, Anthony Pardini let this roam
freely into my Inbox of Terror:
|>
|>
|>On Almost every piece of software I try to compile on my alpha running
|>redhat 4.1 with the applicable updates, I get warning cast form pointer
|>to integer of different size.
This is about the most common error around in C. On x86's pointers and
integers are the same size, on 64-bit archs like the Alpha, they're not.
It's a fairly easy fix, as well :)
|>kernel: netstat(5524): unalighned trap at 000001555556ba89c:
0000000011ffff904 2d 10
This is another coding fubar. Alphas want natural alignment; programs that
don't have this are said to not be '64-bit clean'. It's nothing serious,
but it does cause a performance hit.
Xi
Ximenes Zalteca ~~~~ { Being right too soon is }
x@dal.net ~~~~~~~~~~~ ( socially unacceptable. }
ximenes@netset.com ~~~~~~~~~~~~ ximenes@null.net
-----BEGIN GEEK CODE BLOCK-----
GCS/O d- s+>++:-- !a C++++ UL+>++ P L>++ E---- N
@W-- o? K-? w---() O- M-- V-- @PS+ PE Y+ r++ y++
PGP 5-() X+ R*+ tv b+++ DI++ D++ G e* h++ t+(++)
------END GEEK CODE BLOCK------
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* some questions.
@ 1997-04-16 20:06 Anthony Pardini
0 siblings, 0 replies; 10+ messages in thread
From: Anthony Pardini @ 1997-04-16 20:06 UTC (permalink / raw)
On Almost every piece of software I try to compile on my alpha running
redhat 4.1 with the applicable updates, I get warning cast form pointer
to integer of different size.
I also get syslog messages about:
kernel: makedepend: memory violation at pc=155556c7a40 rp=1555556b129c
(bad address == 20115cb0
kernel: netstat(5524): unalighned trap at 000001555556ba89c: 0000000011ffff904 2d 10
Its an AlphaPC164 500mhz
2.0.28 Kernel.
any comments / suggestions?
Tony
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: some questions.
@ 1997-04-17 1:20 Jim Paradis
0 siblings, 0 replies; 10+ messages in thread
From: Jim Paradis @ 1997-04-17 1:20 UTC (permalink / raw)
Anthony Pardini wrote:
>
> On Almost every piece of software I try to compile on my alpha running
> redhat 4.1 with the applicable updates, I get warning cast form pointer
> to integer of different size.
You have what's called a "64-bit-dirtiness" problem. Throughout the
80s, nearly all implementations of C on 32-bit processors sized data
types such that ints, longs, and pointers were all 32 bits. A lot of
lazy programmers used these datatypes interchangeably, and their code
still worked. Hell *I* even did this in my early years in the
industry (hanging head in shame 8-) ).
With Linux/Alpha and Digital UNIX, these assumptions no longer apply.
Ints are 32 bits, while longs and pointers are 64 bits. If you try
to stuff a 64-bit pointer into a 32-bit int, you chop off the high
bits. If you push a 32-bit int into a 64-bit pointer, you may have
sign-extension problems. Then again, you may get away with it.
> kernel: makedepend: memory violation at pc=155556c7a40 rp=1555556b129c
> (bad address == 20115cb0
This is exactly symptomatic of using an int to hold a pointer. 64-bit
Linux/Alpha programs put the program code by default at 0x120000000,
followed by the initialized data, the uninitialized data, and the heap.
Shared libraries go in starting at 0x15555556000.
Chances are what happened above is you stuffed a pointer value 0x120115cb0
into an int, which lopped it off to 0x20115cb0, which is an invalid address.
--
Jim Paradis jrp@jrp.tiac.net http://www.tiac.net/users/jrp/index.html
"It's not procrastination, it's my new Just-In-Time Workload Management System!"
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: some questions.
[not found] <33557AE8.73908639@jrp.tiac.net>
@ 1997-04-17 2:59 ` CHIH-HSIANG HENRY YAO
0 siblings, 0 replies; 10+ messages in thread
From: CHIH-HSIANG HENRY YAO @ 1997-04-17 2:59 UTC (permalink / raw)
Since so many codes were written with this assumption, one would assume
that some body would come up with a C compiler that forces 32bit
compitablity you know like a compiler flag or something. Sure, would save
me a lot of time fixing idoitic bugs. All I really care is something
that works better than emulations. Does it exists? Are there any reason why
not?
from Henry Chih-Hsiang Yao
chihhsia@seas.ucla.edu
On Wed, 16 Apr 1997, Jim Paradis wrote:
> Anthony Pardini wrote:
> >
> > On Almost every piece of software I try to compile on my alpha running
> > redhat 4.1 with the applicable updates, I get warning cast form pointer
> > to integer of different size.
>
> You have what's called a "64-bit-dirtiness" problem. Throughout the
> 80s, nearly all implementations of C on 32-bit processors sized data
> types such that ints, longs, and pointers were all 32 bits. A lot of
> lazy programmers used these datatypes interchangeably, and their code
> still worked. Hell *I* even did this in my early years in the
> industry (hanging head in shame 8-) ).
>
> With Linux/Alpha and Digital UNIX, these assumptions no longer apply.
> Ints are 32 bits, while longs and pointers are 64 bits. If you try
> to stuff a 64-bit pointer into a 32-bit int, you chop off the high
> bits. If you push a 32-bit int into a 64-bit pointer, you may have
> sign-extension problems. Then again, you may get away with it.
>
> > kernel: makedepend: memory violation at pc=155556c7a40 rp=1555556b129c
> > (bad address == 20115cb0
>
> This is exactly symptomatic of using an int to hold a pointer. 64-bit
> Linux/Alpha programs put the program code by default at 0x120000000,
> followed by the initialized data, the uninitialized data, and the heap.
> Shared libraries go in starting at 0x15555556000.
>
> Chances are what happened above is you stuffed a pointer value 0x120115cb0
> into an int, which lopped it off to 0x20115cb0, which is an invalid address.
>
> --
> Jim Paradis jrp@jrp.tiac.net http://www.tiac.net/users/jrp/index.html
> "It's not procrastination, it's my new Just-In-Time Workload Management System!"
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
>
>
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: some questions.
@ 1997-04-17 3:16 Javier Henderson
0 siblings, 0 replies; 10+ messages in thread
From: Javier Henderson @ 1997-04-17 3:16 UTC (permalink / raw)
>Since so many codes were written with this assumption, one would assume
>that some body would come up with a C compiler that forces 32bit
>compitablity you know like a compiler flag or something. Sure, would save
>me a lot of time fixing idoitic bugs. All I really care is something
>that works better than emulations. Does it exists? Are there any reason why
>not?
Well, I don't know about gcc, but DEC C for VMS on Alpha will generate the
appropriate fetch-shift-mask combinations to get it with aligned accesses if it
knows that something isn't aligned. If it doesn't know, then it will assume it
is aligned and the (slower) exception handler will fix up the exceptions.
There is a __unaligned delaration you can use, even.
There are also 'fetch-long' instructions, but I believe that they use a full
bus cycle to do it.
-Javier
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: some questions.
[not found] <3356D92E.2DFC19BD@jrp.tiac.net>
@ 1997-04-17 17:45 ` jestabro
0 siblings, 0 replies; 10+ messages in thread
From: jestabro @ 1997-04-17 17:45 UTC (permalink / raw)
>>> Jim Paradis said:
>
> What the Digital C compiler offers is the "-taso" switch. This
> stands for "Truncated Address Space Option". The only thing that
> switch does is instruct ld to load the program in "low" memory
> (text at 0x20000000 data at 0x40000000, stack below text).
> Although the compiler still generates 64-bit pointers, because
> all of the memory addresses fit in 32 bits you can still sling
> pointers and longs around with relatively wild abandon...
>
> This trick doesn't seem to work nearly as well on Linux/Alpha.
> The equivalent "ld" switches to make this work (-Ttext, -Tdata)
> seem to be broken... try to use them and you get relocation
> overflows and/or bfd assertion failures.
Another reason might be because a pointer returned by a syscall such as
"mmap" may *NOT* fit into 32-bits. The Xservers use mmap to map framebuffer
memory into their (user) address space, and the pointers typically end up
being somewhere *above* 0x15500000000UL... :-( (yes, that's 8 zeros) :-(
--Jay++
-------------------------------------------------------------------------------
American Non Sequitur Society: we don't make sense, but we do like pizza...
Jay A Estabrook Alpha Migration Tools - LINUX Project
Digital Equipment Corp. (508) 952-4202 or (DTN) 227-4202
151 Taylor Street - TAY1-2 enet: jestabro@amt.tay1.dec.com
Littleton, MA 01460-1407 decnet: tallis::jestabro
-------------------------------------------------------------------------------
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: some questions.
[not found] <Pine.A32.3.91.970416195518.18696A-100000@olvera.seas.ucla.edu>
@ 1997-04-17 21:52 ` Richard Henderson
0 siblings, 0 replies; 10+ messages in thread
From: Richard Henderson @ 1997-04-17 21:52 UTC (permalink / raw)
> Since so many codes were written with this assumption, one would assume
> that some body would come up with a C compiler that forces 32bit
> compitablity you know like a compiler flag or something.
Digital's compiler does this.
On more cynical days I ask why I should coddle to people just so they
can do the Wrong Thing. In reality it probably wouldn't be terribly
difficult to do with gcc and gld. But no one has yet to do so.
r~
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: some questions.
@ 1997-04-17 22:06 david l nicol
0 siblings, 0 replies; 10+ messages in thread
From: david l nicol @ 1997-04-17 22:06 UTC (permalink / raw)
Richard Henderson wrote:
>
> > Since so many codes were written with this assumption, one would assume
> > that some body would come up with a C compiler that forces 32bit
> > compitablity you know like a compiler flag or something.
>
> Digital's compiler does this.
>
> On more cynical days I ask why I should coddle to people just so they
> can do the Wrong Thing. In reality it probably wouldn't be terribly
> difficult to do with gcc and gld. But no one has yet to do so.
>
> r~
A better solution might be a preprocessor that determines what
pointers have been declared as ints or longs,
that is, which ints or longs are being perverted into pointers,
and rewrites the program
with them declared as pointers, and e-mails nastygrams to any e-mail
addresses appearing within comments in the code.
Machinery to make those identifications would be required by the
"compiler flag" project anyway. gcc had enough flags already, IMAO.
_____________________________________________________________________
David Nicol (816) 235 1187 UMKC Network Operations: TACACS, News, perl,
C, shell programming, Unix system administration, problem solving.
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: some questions.
@ 1997-04-18 2:15 Jim Paradis
0 siblings, 0 replies; 10+ messages in thread
From: Jim Paradis @ 1997-04-18 2:15 UTC (permalink / raw)
Richard Henderson wrote:
>
> > Since so many codes were written with this assumption, one would assume
> > that some body would come up with a C compiler that forces 32bit
> > compitablity you know like a compiler flag or something.
>
> Digital's compiler does this.
>
> On more cynical days I ask why I should coddle to people just so they
> can do the Wrong Thing. In reality it probably wouldn't be terribly
> difficult to do with gcc and gld. But no one has yet to do so.
Actually you can do this -- sort of -- with the current tools.
What the Digital C compiler offers is the "-taso" switch. This
stands for "Truncated Address Space Option". The only thing that
switch does is instruct ld to load the program in "low" memory
(text at 0x20000000 data at 0x40000000, stack below text).
Although the compiler still generates 64-bit pointers, because
all of the memory addresses fit in 32 bits you can still sling
pointers and longs around with relatively wild abandon...
This trick doesn't seem to work nearly as well on Linux/Alpha.
The equivalent "ld" switches to make this work (-Ttext, -Tdata)
seem to be broken... try to use them and you get relocation
overflows and/or bfd assertion failures.
The only way I've found to make this work is to go into
/usr/lib/ldscripts, take a script that works to load the kind
of program you're linking (e.g. elf64alpha.x) and change the
initial ". =" declaration from 0x120000000 to 0x20000000,
give the script a new name, and invoke it using the "-T scriptname"
flag to ld (or "-Wl,-Tscriptname" to gcc).
I haven't yet figured out how to map ld args to ld scripts,
otherwise one could just put modified scripts into that
directory and invoke them using linker options...
--
Jim Paradis jrp@jrp.tiac.net
http://www.tiac.net/users/jrp/index.html
"It's not procrastination, it's my new Just-In-Time Workload Management
System!"
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Some Questions.
@ 1997-09-10 19:25 Torsten Zirzlaff
0 siblings, 0 replies; 10+ messages in thread
From: Torsten Zirzlaff @ 1997-09-10 19:25 UTC (permalink / raw)
Hi.
I have some questions regarding lock up and unusual termination.
I had to boot and reboot before my alpha got the nfs-filesystem,
which is hosted on a 386-linux. Today it was the worst and I had to
down-clock my Noname to the usual 233MHz. Well, it is quite annoying
when the boot up locks up two systems.
In addition to that I had a weired behaviour with lynx 2.6. When I
call the altavista pages of the extended search functions it
terminates abnormally with error 11, but the same version on my ole
386 have no problem with it.
Any suggestions what is the reason for that two problems?
I use RH 4.1 with 4.2 updates and alphabits under a 2.0.30 Kernel.
Any hints and suggestion are appreciated.
Ciao
Torsten
--
s-mail: Dudenstr. 24 Torsten Zirzlaff
10965 Berlin
Germany e-mail : zirzlaff@nienor.in-berlin.de
phone: +49 30 789 90 144 zirzlaff@satchmo.physik.tu-berlin.de
data: +49 30 789 90 145
+-----------------------------------------------------------------------------+
| The shortest unit of time in the universe is the New York Second, defined |
| as the period of time between the traffic lights turning green and the cab |
| behind you honking. -- Terry Pratchett 'Lords and Ladies' |
+-----------------------------------------------------------------------------+
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~1997-09-10 19:25 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <3356D92E.2DFC19BD@jrp.tiac.net>
1997-04-17 17:45 ` some questions jestabro
1997-09-10 19:25 Some Questions Torsten Zirzlaff
-- strict thread matches above, loose matches on Subject: below --
1997-04-18 2:15 some questions Jim Paradis
1997-04-17 22:06 david l nicol
[not found] <Pine.A32.3.91.970416195518.18696A-100000@olvera.seas.ucla.edu>
1997-04-17 21:52 ` Richard Henderson
1997-04-17 3:16 Javier Henderson
[not found] <33557AE8.73908639@jrp.tiac.net>
1997-04-17 2:59 ` CHIH-HSIANG HENRY YAO
1997-04-17 1:20 Jim Paradis
1997-04-16 20:06 Anthony Pardini
[not found] <Pine.LNX.3.91.970416144742.30218B-100000@ns2.cmpu.net>
1997-04-16 19:52 ` Ximenes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox