Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

After Goliath's defeat, giants ceased to command respect. -- Freeman Dyson


computers / comp.os.vms / Re: Can't memset() more than 4GB - 64KB

SubjectAuthor
* Can't memset() more than 4GB - 64KBJake Hamby
+* Re: Can't memset() more than 4GB - 64KBCraig A. Berry
|`* Re: Can't memset() more than 4GB - 64KBJohn Reagan
| `- Re: Can't memset() more than 4GB - 64KBVAXman-
+* Re: Can't memset() more than 4GB - 64KBJohn Reagan
|`* Re: Can't memset() more than 4GB - 64KBJake Hamby
| +* Re: Can't memset() more than 4GB - 64KBJake Hamby
| |`- Re: Can't memset() more than 4GB - 64KBJohn Reagan
| `* Re: Can't memset() more than 4GB - 64KBJohn Reagan
|  `- Re: Can't memset() more than 4GB - 64KBJake Hamby
`* Re: Can't memset() more than 4GB - 64KBJohnny Billquist
 `* Re: Can't memset() more than 4GB - 64KBJake Hamby
  `- Re: Can't memset() more than 4GB - 64KBJohnny Billquist

1
Can't memset() more than 4GB - 64KB

<f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22571&group=comp.os.vms#22571

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:10b2:b0:69f:9e8d:33eb with SMTP id h18-20020a05620a10b200b0069f9e8d33ebmr1374328qkk.111.1652388135925;
Thu, 12 May 2022 13:42:15 -0700 (PDT)
X-Received: by 2002:a37:9e89:0:b0:69f:c3f6:432e with SMTP id
h131-20020a379e89000000b0069fc3f6432emr1410757qke.454.1652388135711; Thu, 12
May 2022 13:42:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 12 May 2022 13:42:15 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:be3b:152d:39ea:d158;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:be3b:152d:39ea:d158
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
Subject: Can't memset() more than 4GB - 64KB
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Thu, 12 May 2022 20:42:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jake Hamby - Thu, 12 May 2022 20:42 UTC

Quick heads-up: I just finished porting Charles Cazabon's open source "memtester" utility to run with 64-bit pointers on OpenVMS:

https://github.com/jhamby/vms-memtester/

Apart from the expected cursing that size_t is only 32 bits, and after setting my WSMAX, WSQUOTA, and WSEXTENT to sufficiently high values, I discovered that the version of memset() in OpenVMS V8.4-2L3 I64 (I don't have enough RAM on my Alpha to test this) can only fill (memtester fills with 0xff) up to 4GB minus 64KB. If I increase the size beyond that, to (4GB - 8KB) or (4GB - 32KB), the memory region doesn't get fully filled.

Hopefully someone can file as a bug. Definitely a bug to keep in mind when porting apps. I had to add a simple loop to fill the 64-bit region being tested, 4GB - 64KB at a time. I really, really hope that as part of the x86-64 port, VMS will acquire a new ABI mode where size_t (and ideally long as well) are promoted to 64 bits, so that we don't get silent failures by forgetting that memset() can't just fill 6GB in one call.

Jake

Re: Can't memset() more than 4GB - 64KB

<t5k1r6$st7$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22573&group=comp.os.vms#22573

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: craigbe...@nospam.mac.com (Craig A. Berry)
Newsgroups: comp.os.vms
Subject: Re: Can't memset() more than 4GB - 64KB
Date: Thu, 12 May 2022 17:31:00 -0500
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <t5k1r6$st7$1@dont-email.me>
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 12 May 2022 22:31:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e7e679aa73329c4b7e58684b80616864";
logging-data="29607"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BV03uqRtXwzsVr2l0nOecFVgHKK64lWI="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.9.0
Cancel-Lock: sha1:Qn9h6eNW31PDl0sTpILpJYrl03M=
In-Reply-To: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
Content-Language: en-US
 by: Craig A. Berry - Thu, 12 May 2022 22:31 UTC

On 5/12/22 3:42 PM, Jake Hamby wrote:
> Quick heads-up: I just finished porting Charles Cazabon's open source
> "memtester" utility to run with 64-bit pointers on OpenVMS:
>
> https://github.com/jhamby/vms-memtester/
>
> Apart from the expected cursing that size_t is only 32 bits, and
> after setting my WSMAX, WSQUOTA, and WSEXTENT to sufficiently high
> values, I discovered that the version of memset() in OpenVMS V8.4-2L3
> I64 (I don't have enough RAM on my Alpha to test this) can only fill
> (memtester fills with 0xff) up to 4GB minus 64KB. If I increase the
> size beyond that, to (4GB - 8KB) or (4GB - 32KB), the memory region
> doesn't get fully filled.
>
> Hopefully someone can file as a bug. Definitely a bug to keep in mind
> when porting apps. I had to add a simple loop to fill the 64-bit
> region being tested, 4GB - 64KB at a time. I really, really hope that
> as part of the x86-64 port, VMS will acquire a new ABI mode where
> size_t (and ideally long as well) are promoted to 64 bits, so that we
> don't get silent failures by forgetting that memset() can't just fill
> 6GB in one call.

It may eventually be possible to have a compiler mode that changes the
model from LLP64, as it is now, to LP64 or ILP64, at least for the
clang-based compilers.[1] I'm not actually sure that LLP64 even
considers the possibility that size_t and ptrdiff_t won't match the size
of a long pointer as is the case now on VMS. When Alpha was new, the
top priority for VMS was making all the existing VAX code work without
modification. That priority hasn't really changed in the intervening
decades and will likely be evident in initial compiler releases on
x86_64. Tru64 did not have that limitation since it was brand new with
Alpha and so was (I think) LP64 from the start.

[1] https://unix.org/version2/whatsnew/lp64_wp.html

Re: Can't memset() more than 4GB - 64KB

<71d3b7f9-e475-4ed3-a682-c1813c351b76n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22578&group=comp.os.vms#22578

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ad4:5bec:0:b0:45a:a030:cdc7 with SMTP id k12-20020ad45bec000000b0045aa030cdc7mr2836455qvc.93.1652410967687;
Thu, 12 May 2022 20:02:47 -0700 (PDT)
X-Received: by 2002:a05:6214:2308:b0:435:3440:7d3c with SMTP id
gc8-20020a056214230800b0043534407d3cmr2568075qvb.65.1652410967484; Thu, 12
May 2022 20:02:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 12 May 2022 20:02:47 -0700 (PDT)
In-Reply-To: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=73.60.222.222; posting-account=M3IgSwoAAADJd6EnOmsrCCfB6_OyTOkv
NNTP-Posting-Host: 73.60.222.222
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <71d3b7f9-e475-4ed3-a682-c1813c351b76n@googlegroups.com>
Subject: Re: Can't memset() more than 4GB - 64KB
From: xyzzy1...@gmail.com (John Reagan)
Injection-Date: Fri, 13 May 2022 03:02:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2858
 by: John Reagan - Fri, 13 May 2022 03:02 UTC

On Thursday, May 12, 2022 at 4:42:17 PM UTC-4, jake....@gmail.com wrote:
> Quick heads-up: I just finished porting Charles Cazabon's open source "memtester" utility to run with 64-bit pointers on OpenVMS:
>
> https://github.com/jhamby/vms-memtester/
>
> Apart from the expected cursing that size_t is only 32 bits, and after setting my WSMAX, WSQUOTA, and WSEXTENT to sufficiently high values, I discovered that the version of memset() in OpenVMS V8.4-2L3 I64 (I don't have enough RAM on my Alpha to test this) can only fill (memtester fills with 0xff) up to 4GB minus 64KB. If I increase the size beyond that, to (4GB - 8KB) or (4GB - 32KB), the memory region doesn't get fully filled.
>
> Hopefully someone can file as a bug. Definitely a bug to keep in mind when porting apps. I had to add a simple loop to fill the 64-bit region being tested, 4GB - 64KB at a time. I really, really hope that as part of the x86-64 port, VMS will acquire a new ABI mode where size_t (and ideally long as well) are promoted to 64 bits, so that we don't get silent failures by forgetting that memset() can't just fill 6GB in one call.
>
> Jake
Yeah, _memset64 zero-extends the size argument before calling OTS$FILL (which handles 64-bit lengths just fine). As you note, it is all related to size_t being 32-bits and assuming that no single variable can be larger than that. So memset would never have to fill more than that.

However, I don't see this 64kb issue you talk about.

Introducing a new ABI mode is certainly one of the things we are looking at.. Testing C++/clang right now with LLP64 is a challenge.

Re: Can't memset() more than 4GB - 64KB

<af8912e6-0a4c-48e5-8674-d8c75fa29c98n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22579&group=comp.os.vms#22579

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6214:400e:b0:45a:ece1:1789 with SMTP id kd14-20020a056214400e00b0045aece11789mr2545342qvb.131.1652411099266;
Thu, 12 May 2022 20:04:59 -0700 (PDT)
X-Received: by 2002:a05:620a:40cf:b0:6a0:4c65:bed6 with SMTP id
g15-20020a05620a40cf00b006a04c65bed6mr2321230qko.78.1652411099082; Thu, 12
May 2022 20:04:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 12 May 2022 20:04:58 -0700 (PDT)
In-Reply-To: <t5k1r6$st7$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=73.60.222.222; posting-account=M3IgSwoAAADJd6EnOmsrCCfB6_OyTOkv
NNTP-Posting-Host: 73.60.222.222
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com> <t5k1r6$st7$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <af8912e6-0a4c-48e5-8674-d8c75fa29c98n@googlegroups.com>
Subject: Re: Can't memset() more than 4GB - 64KB
From: xyzzy1...@gmail.com (John Reagan)
Injection-Date: Fri, 13 May 2022 03:04:59 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3314
 by: John Reagan - Fri, 13 May 2022 03:04 UTC

On Thursday, May 12, 2022 at 6:31:05 PM UTC-4, Craig A. Berry wrote:
> On 5/12/22 3:42 PM, Jake Hamby wrote:
> > Quick heads-up: I just finished porting Charles Cazabon's open source
> > "memtester" utility to run with 64-bit pointers on OpenVMS:
> >
> > https://github.com/jhamby/vms-memtester/
> >
> > Apart from the expected cursing that size_t is only 32 bits, and
> > after setting my WSMAX, WSQUOTA, and WSEXTENT to sufficiently high
> > values, I discovered that the version of memset() in OpenVMS V8.4-2L3
> > I64 (I don't have enough RAM on my Alpha to test this) can only fill
> > (memtester fills with 0xff) up to 4GB minus 64KB. If I increase the
> > size beyond that, to (4GB - 8KB) or (4GB - 32KB), the memory region
> > doesn't get fully filled.
> >
> > Hopefully someone can file as a bug. Definitely a bug to keep in mind
> > when porting apps. I had to add a simple loop to fill the 64-bit
> > region being tested, 4GB - 64KB at a time. I really, really hope that
> > as part of the x86-64 port, VMS will acquire a new ABI mode where
> > size_t (and ideally long as well) are promoted to 64 bits, so that we
> > don't get silent failures by forgetting that memset() can't just fill
> > 6GB in one call.
> It may eventually be possible to have a compiler mode that changes the
> model from LLP64, as it is now, to LP64 or ILP64, at least for the
> clang-based compilers.[1] I'm not actually sure that LLP64 even
> considers the possibility that size_t and ptrdiff_t won't match the size
> of a long pointer as is the case now on VMS. When Alpha was new, the
> top priority for VMS was making all the existing VAX code work without
> modification. That priority hasn't really changed in the intervening
> decades and will likely be evident in initial compiler releases on
> x86_64. Tru64 did not have that limitation since it was brand new with
> Alpha and so was (I think) LP64 from the start.
>
> [1] https://unix.org/version2/whatsnew/lp64_wp.html
There is so much bad code out there that uses size_t or ptrdiff_t instead of intptr_t
that I'm getting tired of even trying to justify it anymore.

Re: Can't memset() more than 4GB - 64KB

<00B74A1A.0CEEBC9A@SendSpamHere.ORG>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22584&group=comp.os.vms#22584

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!pr9o9uw/KLhPSFYv2ok3sg.user.46.165.242.75.POSTED!not-for-mail
From: VAXm...@SendSpamHere.ORG
Newsgroups: comp.os.vms
Subject: Re: Can't memset() more than 4GB - 64KB
Date: Fri, 13 May 2022 10:20:48 GMT
Organization: c.2022 Brian Schenkenberger. Prior employers of copyright holder and their agents must first obtain written permission to copy this posting.
Message-ID: <00B74A1A.0CEEBC9A@SendSpamHere.ORG>
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com> <t5k1r6$st7$1@dont-email.me> <af8912e6-0a4c-48e5-8674-d8c75fa29c98n@googlegroups.com>
Reply-To: VAXman- @SendSpamHere.ORG
Injection-Info: gioia.aioe.org; logging-data="38356"; posting-host="pr9o9uw/KLhPSFYv2ok3sg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: VAXm...@SendSpamHere.ORG - Fri, 13 May 2022 10:20 UTC

In article <af8912e6-0a4c-48e5-8674-d8c75fa29c98n@googlegroups.com>, John Reagan <xyzzy1959@gmail.com> writes:
>{...snip..}
>There is so much bad code out there that uses size_t or ptrdiff_t instead of intptr_t
>that I'm getting tired of even trying to justify it anymore.

But, but, but, ... C!

--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.

Re: Can't memset() more than 4GB - 64KB

<t5m95g$2ck$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22591&group=comp.os.vms#22591

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.185.159.157.200!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: Can't memset() more than 4GB - 64KB
Date: Fri, 13 May 2022 20:48:15 +0200
Organization: MGT Consulting
Message-ID: <t5m95g$2ck$1@news.misty.com>
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 13 May 2022 18:48:16 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="185.159.157.200";
logging-data="2452"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.9.0
Content-Language: en-US
In-Reply-To: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
 by: Johnny Billquist - Fri, 13 May 2022 18:48 UTC

On 2022-05-12 22:42, Jake Hamby wrote:
> Quick heads-up: I just finished porting Charles Cazabon's open source "memtester" utility to run with 64-bit pointers on OpenVMS:
>
> https://github.com/jhamby/vms-memtester/
>
> Apart from the expected cursing that size_t is only 32 bits, and after setting my WSMAX, WSQUOTA, and WSEXTENT to sufficiently high values, I discovered that the version of memset() in OpenVMS V8.4-2L3 I64 (I don't have enough RAM on my Alpha to test this) can only fill (memtester fills with 0xff) up to 4GB minus 64KB. If I increase the size beyond that, to (4GB - 8KB) or (4GB - 32KB), the memory region doesn't get fully filled.

I would have expected that you could run this even if you have way less
ram. That's what virtual memory and demand paging is there for.

> Hopefully someone can file as a bug. Definitely a bug to keep in mind when porting apps. I had to add a simple loop to fill the 64-bit region being tested, 4GB - 64KB at a time. I really, really hope that as part of the x86-64 port, VMS will acquire a new ABI mode where size_t (and ideally long as well) are promoted to 64 bits, so that we don't get silent failures by forgetting that memset() can't just fill 6GB in one call.

Sound like it might behaving exactly as it should.
The size argument to memset is a size_t. If size_t is only 32 bits, how
would memset ever be able to set more than 4G?

I would have expected the compiler to also warn you if you threw a
64-bit value as the argument to memset, pointing out the type
incompatibility and risk for truncation.

Johnny

Re: Can't memset() more than 4GB - 64KB

<c9bb985f-7e75-4fc4-9a13-e3b08bf46348n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22599&group=comp.os.vms#22599

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:2552:b0:67b:32e2:2400 with SMTP id s18-20020a05620a255200b0067b32e22400mr6629819qko.768.1652538386467;
Sat, 14 May 2022 07:26:26 -0700 (PDT)
X-Received: by 2002:ac8:5704:0:b0:2f7:3b31:7c7d with SMTP id
4-20020ac85704000000b002f73b317c7dmr1597570qtw.681.1652538386238; Sat, 14 May
2022 07:26:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sat, 14 May 2022 07:26:25 -0700 (PDT)
In-Reply-To: <t5m95g$2ck$1@news.misty.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:758d:c07f:8dc2:9c0a;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:758d:c07f:8dc2:9c0a
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com> <t5m95g$2ck$1@news.misty.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c9bb985f-7e75-4fc4-9a13-e3b08bf46348n@googlegroups.com>
Subject: Re: Can't memset() more than 4GB - 64KB
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Sat, 14 May 2022 14:26:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2853
 by: Jake Hamby - Sat, 14 May 2022 14:26 UTC

On Friday, May 13, 2022 at 11:48:19 AM UTC-7, Johnny Billquist wrote:
> Sound like it might behaving exactly as it should.
> The size argument to memset is a size_t. If size_t is only 32 bits, how
> would memset ever be able to set more than 4G?
>
> I would have expected the compiler to also warn you if you threw a
> 64-bit value as the argument to memset, pointing out the type
> incompatibility and risk for truncation.

I think I may have been unclear in my original post. I was able to memset up to 0xffff0000 bytes successfully, but not any higher. I originally tried to loop and fill 0xffffe000 (4GB minus one 8K page), and then discovered that memtester failed because the entire range wasn't filled properly. I then verified that memset(buf, 255, 0xffff8000) fails but memset(buf, 255, 0xffff0000) succeeds, at least on OpenVMS V8.4-2L3 on a dual-CPU rx2620.

You're right, I would've expected the compiler to warn me about my original attempt to memset() with a 64-bit value. Maybe I should've added /STANDARD=LATEST. The C compiler is usually so strict about type mismatches by default, but not here.

As for virtual memory and demand paging, this program tests RAM by repeatedly writing to two halves of a giant memory buffer, then comparing them for equality. If I had a week to wait for it, I could possibly run memtester on >4G of virtual memory on an Alpha with 2GB of physical memory, except that my PAGEFILE.SYS isn't big enough and I'm not going to wait a week for it to get to the part where it would pass or fail. :)

Jake

Re: Can't memset() more than 4GB - 64KB

<5f95a1b3-cfe3-44a8-9abd-0e4e5548953fn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22600&group=comp.os.vms#22600

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a37:c44:0:b0:69f:81cb:1d6a with SMTP id 65-20020a370c44000000b0069f81cb1d6amr6941159qkm.494.1652538891863;
Sat, 14 May 2022 07:34:51 -0700 (PDT)
X-Received: by 2002:a05:6214:27c6:b0:45a:bb16:1022 with SMTP id
ge6-20020a05621427c600b0045abb161022mr8780733qvb.118.1652538891658; Sat, 14
May 2022 07:34:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sat, 14 May 2022 07:34:51 -0700 (PDT)
In-Reply-To: <71d3b7f9-e475-4ed3-a682-c1813c351b76n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:758d:c07f:8dc2:9c0a;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:758d:c07f:8dc2:9c0a
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com> <71d3b7f9-e475-4ed3-a682-c1813c351b76n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5f95a1b3-cfe3-44a8-9abd-0e4e5548953fn@googlegroups.com>
Subject: Re: Can't memset() more than 4GB - 64KB
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Sat, 14 May 2022 14:34:51 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2520
 by: Jake Hamby - Sat, 14 May 2022 14:34 UTC

On Thursday, May 12, 2022 at 8:02:49 PM UTC-7, xyzz...@gmail.com wrote:
> Yeah, _memset64 zero-extends the size argument before calling OTS$FILL (which handles 64-bit lengths just fine). As you note, it is all related to size_t being 32-bits and assuming that no single variable can be larger than that. So memset would never have to fill more than that.
>
> However, I don't see this 64kb issue you talk about.

Strange. It's really easy for me to reproduce, by fiddling with the value of max_clear_bytes on line 525 of memtester.c in my fork of the tree: https://github.com/jhamby/vms-memtester

If I call memset() with a value larger than 0xffff0000, then on the third test, after filling the region with random values and then calling memset(buf, 255, length) at the end of the second test, the following tests perform XOR, AND, OR, etc. on the data that's in the buffer, and expect it to be identical in both halves afterwards, because it should've been completely filled with 0xff at the end of the previous test.

> Introducing a new ABI mode is certainly one of the things we are looking at. Testing C++/clang right now with LLP64 is a challenge.

That's good to hear!

Jake

Re: Can't memset() more than 4GB - 64KB

<204a3c11-2c3b-4a42-b98f-6c09f4a1e175n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22601&group=comp.os.vms#22601

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:4e42:0:b0:2f4:fc3c:b0c8 with SMTP id e2-20020ac84e42000000b002f4fc3cb0c8mr9006008qtw.684.1652539347624;
Sat, 14 May 2022 07:42:27 -0700 (PDT)
X-Received: by 2002:a05:622a:7:b0:2f3:c136:b7bc with SMTP id
x7-20020a05622a000700b002f3c136b7bcmr8966305qtw.243.1652539347441; Sat, 14
May 2022 07:42:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sat, 14 May 2022 07:42:27 -0700 (PDT)
In-Reply-To: <5f95a1b3-cfe3-44a8-9abd-0e4e5548953fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:758d:c07f:8dc2:9c0a;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:758d:c07f:8dc2:9c0a
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
<71d3b7f9-e475-4ed3-a682-c1813c351b76n@googlegroups.com> <5f95a1b3-cfe3-44a8-9abd-0e4e5548953fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <204a3c11-2c3b-4a42-b98f-6c09f4a1e175n@googlegroups.com>
Subject: Re: Can't memset() more than 4GB - 64KB
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Sat, 14 May 2022 14:42:27 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2192
 by: Jake Hamby - Sat, 14 May 2022 14:42 UTC

On Saturday, May 14, 2022 at 7:34:53 AM UTC-7, Jake Hamby wrote:
> > Introducing a new ABI mode is certainly one of the things we are looking at. Testing C++/clang right now with LLP64 is a challenge.
> That's good to hear!

I'm hoping that a 64-bit time_t would be part of the new ABI mode as well. The current unsigned 32-bit type is yet another portability issue. At least you no longer have to support VAX floating-point in the new modes, so it should hopefully be just one new mode and set of overrides for all the C/C++ standard library functions that use the modified types.

BTW, I'm assuming that OTS$FILL is an internal routine since it isn't documented or listed in OTS$ROUTINES.H? I did look there, and the closest thing that I saw was OTS$MOVE5, for VAX compatibility, which does more than I needed.

Jake

Re: Can't memset() more than 4GB - 64KB

<2a715b42-3bb7-4736-9992-305159cf2150n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22602&group=comp.os.vms#22602

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:5fd4:0:b0:2f3:f0d7:757a with SMTP id k20-20020ac85fd4000000b002f3f0d7757amr8811061qta.557.1652540973980;
Sat, 14 May 2022 08:09:33 -0700 (PDT)
X-Received: by 2002:a05:622a:6082:b0:2f1:1f9c:251e with SMTP id
hf2-20020a05622a608200b002f11f9c251emr9079798qtb.230.1652540973779; Sat, 14
May 2022 08:09:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sat, 14 May 2022 08:09:33 -0700 (PDT)
In-Reply-To: <204a3c11-2c3b-4a42-b98f-6c09f4a1e175n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=73.60.222.222; posting-account=M3IgSwoAAADJd6EnOmsrCCfB6_OyTOkv
NNTP-Posting-Host: 73.60.222.222
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
<71d3b7f9-e475-4ed3-a682-c1813c351b76n@googlegroups.com> <5f95a1b3-cfe3-44a8-9abd-0e4e5548953fn@googlegroups.com>
<204a3c11-2c3b-4a42-b98f-6c09f4a1e175n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2a715b42-3bb7-4736-9992-305159cf2150n@googlegroups.com>
Subject: Re: Can't memset() more than 4GB - 64KB
From: xyzzy1...@gmail.com (John Reagan)
Injection-Date: Sat, 14 May 2022 15:09:33 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2769
 by: John Reagan - Sat, 14 May 2022 15:09 UTC

On Saturday, May 14, 2022 at 10:42:29 AM UTC-4, jake....@gmail.com wrote:
> On Saturday, May 14, 2022 at 7:34:53 AM UTC-7, Jake Hamby wrote:
> > > Introducing a new ABI mode is certainly one of the things we are looking at. Testing C++/clang right now with LLP64 is a challenge.
> > That's good to hear!
> I'm hoping that a 64-bit time_t would be part of the new ABI mode as well.. The current unsigned 32-bit type is yet another portability issue. At least you no longer have to support VAX floating-point in the new modes, so it should hopefully be just one new mode and set of overrides for all the C/C++ standard library functions that use the modified types.
>
> BTW, I'm assuming that OTS$FILL is an internal routine since it isn't documented or listed in OTS$ROUTINES.H? I did look there, and the closest thing that I saw was OTS$MOVE5, for VAX compatibility, which does more than I needed.
>
> Jake
VAX floating isn't related to any pointer/size_t issues. We have VAX floating on the non-C++ compilers. For C++, I'm thinking about writing a C++ class to provide VAX floating support without hacking it into clang.

OTS$FILL is in LIBOTS.EXE, not LIBRTL.EXE. While the LIBOTS routines use the OTS$ prefix, they are not related to the documented OTS$ROUTINES.H routines. They are compiler-private calls (much like how compiler_rt is to LLVM).

Re: Can't memset() more than 4GB - 64KB

<c4538ef9-17f6-4dcb-a0e5-46b76f84e9adn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22603&group=comp.os.vms#22603

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ad4:5aaa:0:b0:45a:a137:49d3 with SMTP id u10-20020ad45aaa000000b0045aa13749d3mr8746957qvg.61.1652541086077;
Sat, 14 May 2022 08:11:26 -0700 (PDT)
X-Received: by 2002:ac8:4e8c:0:b0:2f3:d53a:add3 with SMTP id
12-20020ac84e8c000000b002f3d53aadd3mr9055797qtp.300.1652541085899; Sat, 14
May 2022 08:11:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sat, 14 May 2022 08:11:25 -0700 (PDT)
In-Reply-To: <5f95a1b3-cfe3-44a8-9abd-0e4e5548953fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=73.60.222.222; posting-account=M3IgSwoAAADJd6EnOmsrCCfB6_OyTOkv
NNTP-Posting-Host: 73.60.222.222
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
<71d3b7f9-e475-4ed3-a682-c1813c351b76n@googlegroups.com> <5f95a1b3-cfe3-44a8-9abd-0e4e5548953fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c4538ef9-17f6-4dcb-a0e5-46b76f84e9adn@googlegroups.com>
Subject: Re: Can't memset() more than 4GB - 64KB
From: xyzzy1...@gmail.com (John Reagan)
Injection-Date: Sat, 14 May 2022 15:11:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2794
 by: John Reagan - Sat, 14 May 2022 15:11 UTC

On Saturday, May 14, 2022 at 10:34:53 AM UTC-4, jake....@gmail.com wrote:
> On Thursday, May 12, 2022 at 8:02:49 PM UTC-7, xyzz...@gmail.com wrote:
> > Yeah, _memset64 zero-extends the size argument before calling OTS$FILL (which handles 64-bit lengths just fine). As you note, it is all related to size_t being 32-bits and assuming that no single variable can be larger than that. So memset would never have to fill more than that.
> >
> > However, I don't see this 64kb issue you talk about.
> Strange. It's really easy for me to reproduce, by fiddling with the value of max_clear_bytes on line 525 of memtester.c in my fork of the tree: https://github.com/jhamby/vms-memtester
>
> If I call memset() with a value larger than 0xffff0000, then on the third test, after filling the region with random values and then calling memset(buf, 255, length) at the end of the second test, the following tests perform XOR, AND, OR, etc. on the data that's in the buffer, and expect it to be identical in both halves afterwards, because it should've been completely filled with 0xff at the end of the previous test.
> > Introducing a new ABI mode is certainly one of the things we are looking at. Testing C++/clang right now with LLP64 is a challenge.
> That's good to hear!
>
> Jake
I didn't take much time (<1 minute) to try to reproduce. I don't have lots of time to track down github sources. If you can send one to me, I'd appreciate it.

Re: Can't memset() more than 4GB - 64KB

<t5tadb$klr$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22627&group=comp.os.vms#22627

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.185.159.157.200!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: Can't memset() more than 4GB - 64KB
Date: Mon, 16 May 2022 12:52:26 +0200
Organization: MGT Consulting
Message-ID: <t5tadb$klr$1@news.misty.com>
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
<t5m95g$2ck$1@news.misty.com>
<c9bb985f-7e75-4fc4-9a13-e3b08bf46348n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 16 May 2022 10:52:27 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="185.159.157.200";
logging-data="21179"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.9.0
Content-Language: en-US
In-Reply-To: <c9bb985f-7e75-4fc4-9a13-e3b08bf46348n@googlegroups.com>
 by: Johnny Billquist - Mon, 16 May 2022 10:52 UTC

On 2022-05-14 16:26, Jake Hamby wrote:
> On Friday, May 13, 2022 at 11:48:19 AM UTC-7, Johnny Billquist wrote:
>> Sound like it might behaving exactly as it should.
>> The size argument to memset is a size_t. If size_t is only 32 bits, how
>> would memset ever be able to set more than 4G?
>>
>> I would have expected the compiler to also warn you if you threw a
>> 64-bit value as the argument to memset, pointing out the type
>> incompatibility and risk for truncation.
>
> I think I may have been unclear in my original post. I was able to memset up to 0xffff0000 bytes successfully, but not any higher. I originally tried to loop and fill 0xffffe000 (4GB minus one 8K page), and then discovered that memtester failed because the entire range wasn't filled properly. I then verified that memset(buf, 255, 0xffff8000) fails but memset(buf, 255, 0xffff0000) succeeds, at least on OpenVMS V8.4-2L3 on a dual-CPU rx2620.

I think you missed that in your original post you said you tried to
clear 6G. :-)
That was more what my response targeted.

The part about missing the last few bytes do sound like a bug, but I
can't really tell if it actually is there or not, since I don't have a
machine to test on (I only have VAXen here...).

> You're right, I would've expected the compiler to warn me about my original attempt to memset() with a 64-bit value. Maybe I should've added /STANDARD=LATEST. The C compiler is usually so strict about type mismatches by default, but not here.

That do sounds broken if it didn't complain.

> As for virtual memory and demand paging, this program tests RAM by repeatedly writing to two halves of a giant memory buffer, then comparing them for equality. If I had a week to wait for it, I could possibly run memtester on >4G of virtual memory on an Alpha with 2GB of physical memory, except that my PAGEFILE.SYS isn't big enough and I'm not going to wait a week for it to get to the part where it would pass or fail. :)

Fair enough. Execution time can certainly be horrible. But it sounded
like you said it was not possible, which is what I was disagreeing with.
I would most likely not want to try and run this either.

Johnny

Re: Can't memset() more than 4GB - 64KB

<19a570e2-3feb-42b4-94eb-33ad3d2d7cf3n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22766&group=comp.os.vms#22766

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ad4:5cac:0:b0:45a:8e5c:677 with SMTP id q12-20020ad45cac000000b0045a8e5c0677mr6168222qvh.125.1652999350947;
Thu, 19 May 2022 15:29:10 -0700 (PDT)
X-Received: by 2002:a37:2f06:0:b0:6a0:5596:f395 with SMTP id
v6-20020a372f06000000b006a05596f395mr4521233qkh.298.1652999350758; Thu, 19
May 2022 15:29:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 19 May 2022 15:29:10 -0700 (PDT)
In-Reply-To: <c4538ef9-17f6-4dcb-a0e5-46b76f84e9adn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:66be:b97e:1166:ceab;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:66be:b97e:1166:ceab
References: <f909cc4a-be89-4eb4-9af1-f45481378501n@googlegroups.com>
<71d3b7f9-e475-4ed3-a682-c1813c351b76n@googlegroups.com> <5f95a1b3-cfe3-44a8-9abd-0e4e5548953fn@googlegroups.com>
<c4538ef9-17f6-4dcb-a0e5-46b76f84e9adn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <19a570e2-3feb-42b4-94eb-33ad3d2d7cf3n@googlegroups.com>
Subject: Re: Can't memset() more than 4GB - 64KB
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Thu, 19 May 2022 22:29:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1804
 by: Jake Hamby - Thu, 19 May 2022 22:29 UTC

On Saturday, May 14, 2022 at 8:11:27 AM UTC-7, xyzz...@gmail.com wrote:
> > Jake
> I didn't take much time (<1 minute) to try to reproduce. I don't have lots of time to track down github sources. If you can send one to me, I'd appreciate it.

I'll put together a standalone test case. BTW, I forgot to mention this would be the __memset() builtin provided by the C compiler and not the one in the CRTL. I haven't tested the non-builtin memset yet.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor