Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Space is to place as eternity is to time. -- Joseph Joubert


devel / comp.os.msdos.djgpp / Re: Error handling in __djgpp_map_physical_memory()

SubjectAuthor
* Re: Error handling in __djgpp_map_physical_memory()Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]
`* Re: Error handling in __djgpp_map_physical_memory()Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]
 `- Re: Error handling in __djgpp_map_physical_memory()Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]

1
Re: Error handling in __djgpp_map_physical_memory()

<86le567cmf.fsf@gnu.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=947&group=comp.os.msdos.djgpp#947

  copy link   Newsgroups: comp.os.msdos.djgpp
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.26.MISMATCH!border-4.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 21 Apr 2024 19:14:25 +0000
X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp@delorie.com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1l6OiSZWxCaOgrDOha5t+Bg8zXFWGoxZkPkrbq332do=; b=ikyT6ujMkX8N ToIMwUeE7QbIuq96lhXArW3hTYKaqVBVJu6udwC6GpGLUnvtv/Ef7579+Hd8Af57y+5mmZIDQWZmU JWFR5BkQMcYCcz2TUuwN5RME8rcV89QzJ5l2BYJiYGe08IASOeisePkBgDfwdjgQ4aUAbURhV5Ly7 vM6J0otVauA4m2AdOxdVa7Ycme1NUKx7FLsYL1sFcmVMCntjyxWecpSe1+41Nb1WepeU/6xuFs+uj YeiOGyi+QPfH76Lh5FVtuPfH/GUH75fe3TLfpdf6xDknvRPIaZg99FrdTFZLOKcmR0jKYpYceJtJ3 9eTvEyCRVK+VwGFVPdCL6g==;
Date: Sun, 21 Apr 2024 22:13:28 +0300
Message-Id: <86le567cmf.fsf@gnu.org>
From: djgpp@delorie.com (Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com])
To: Pali <pali@pali.im>
Cc: djgpp@delorie.com
In-Reply-To: <20240421102444.zjl5mmuhqbmuknhn@pali> (message from Pali on Sun, 21 Apr 2024 12:24:44 +0200)
Subject: Re: Error handling in __djgpp_map_physical_memory()
References: <20240421102444.zjl5mmuhqbmuknhn@pali>
Reply-To: djgpp@delorie.com
Errors-To: nobody@delorie.com
X-Mailing-List: djgpp@delorie.com
X-Unsubscribes-To: listserv@delorie.com
Precedence: bulk
Newsgroups: comp.os.msdos.djgpp
Organization: None provided
DJ-Gateway: from mailing list djgpp@delorie.com
Lines: 23
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-wnrQsMh7mIs/Ki5YuSYq0CNCrE7IwjfJ8N5RQ3N6nVS443RxOtBt9N7U2BuP4X5BsLgybWEhhHSozBp!iYRCTqGCQZtwGj3a5hRfeTGsM6xz3H2Lvb0xH/erT8s0
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Eli Zaretskii (eliz@ - Sun, 21 Apr 2024 19:13 UTC

> Date: Sun, 21 Apr 2024 12:24:44 +0200
> From: Pali <pali@pali.im>
> Cc: djgpp@delorie.com
>
> Hello, I have there a change for __djgpp_map_physical_memory function,
> it is improving setting errno in the same way as was done already for
> the function __djgpp_set_page_attributes.

Thanks, I have a couple of minor comments below.

> + /* Base address of the memory handle must be page aligned too. */
> + if (d->address & 0xfff)
> + {
> + errno = EFAULT;

I think this should be EINVAL. An unaligned address is not really
"bad address", it's just that it's not valid for this function.

> + case 0x8023: /* Invalid handle (in ESI) */
> + case 0x8025: /* Invalid linear address (specified range is not within specified block or EBX/EDX is not page-aligned) */
> + errno = EFAULT;

These two should also be EINVAL, IMO.

Re: Error handling in __djgpp_map_physical_memory()

<86jzkq6kb8.fsf@gnu.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=948&group=comp.os.msdos.djgpp#948

  copy link   Newsgroups: comp.os.msdos.djgpp
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-1.nntp.ord.giganews.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 22 Apr 2024 05:25:35 +0000
X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp@delorie.com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
mime-version; bh=GWXboaxhz1KnDWujG0fWjF4AXZ8OiykHcYBw1Cj50ms=; b=Yr7ILVfVKNkA
rEwqMSDSeoUGl1wwxr9focwe57XZzps5/+sgN+UBeAy3HtzTR5KVIG4Ngewoam/FWGZQI8GOD8Per
Xovk1GdJNPn0EkiwQgX7CQITMqVQLbj9pf7Qn0A2xw//taQ7HiDfwlcias1a3+q1yCGSMsnZSZ13t
fOIBfQOiKMfHa6F2T4D3vhMIm7T4VkfXkIASdp1YXPuQKMO46/bE3VbagDH433kOYf9NzQCElzZhn
d18+728Lg0RTvLng48brT7N4SUCdZJ7YLhsneOd9jBg62MDGhCHDhBNGEaHelBAQvVj4c1+xh/iFW
sQ/sfEOsACEN9LMtybKMVw==;
Date: Mon, 22 Apr 2024 08:24:59 +0300
Message-Id: <86jzkq6kb8.fsf@gnu.org>
From: djgpp@delorie.com (Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com])
To: Pali <pali@pali.im>
Cc: djgpp@delorie.com
In-Reply-To: <20240421193338.ankqza2y2ukxjtir@pali> (message from Pali on Sun,
21 Apr 2024 21:33:38 +0200)
Subject: Re: Error handling in __djgpp_map_physical_memory()
References: <20240421102444.zjl5mmuhqbmuknhn@pali>
<86le567cmf.fsf@gnu.org> <20240421193338.ankqza2y2ukxjtir@pali>
Reply-To: djgpp@delorie.com
Errors-To: nobody@delorie.com
X-Mailing-List: djgpp@delorie.com
X-Unsubscribes-To: listserv@delorie.com
Precedence: bulk
Newsgroups: comp.os.msdos.djgpp
Organization: None provided
DJ-Gateway: from mailing list djgpp@delorie.com
Lines: 42
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-X8kHcK6DLfLrsAsWzhjQEvW0NqIqN/PzKUU4oGH7pBqAjzcJeaZXMB1brU0guaLVnbmOm2UFxKEzAf+!cEiorLnp0M9mkAK6MHCP13xxBcibDowR5RwEB8FO7tPQ
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Eli Zaretskii (eliz@ - Mon, 22 Apr 2024 05:24 UTC

> Date: Sun, 21 Apr 2024 21:33:38 +0200
> From: Pali <pali@pali.im>
> Cc: djgpp@delorie.com
>
> > > + /* Base address of the memory handle must be page aligned too. */
> > > + if (d->address & 0xfff)
> > > + {
> > > + errno = EFAULT;
> >
> > I think this should be EINVAL. An unaligned address is not really
> > "bad address", it's just that it's not valid for this function.
>
> This is base address of the memory handle found by the DJGPP's
> __djgpp_memory_handle function. Not the address passed as input
> parameter by caller. So I thought that EFAULT is better there.
>
> > > + case 0x8023: /* Invalid handle (in ESI) */
> > > + case 0x8025: /* Invalid linear address (specified range is not within specified block or EBX/EDX is not page-aligned) */
> > > + errno = EFAULT;
> >
> > These two should also be EINVAL, IMO.
>
> EFAULT errno is mostly returned when the passed pointer is invalid, e.g.
> out of the process space. So I thought that EFAULT is better error code
> than EINVAL for the case when the DPMI server say that it rejected
> linear address. Linear address for this DPMI call is defined by the
> handle and offset.
>
> That is the reason why I chose these errno codes.

Maybe we should first agree what is "bad address", then? To me, it
means address that is outside of the program's address space, or
something that cannot be an address at all. That's not what happens
here.

> Anyway, I used exactly same errno codes as in merged change for the
> __djgpp_set_page_attributes function. And I think that these two
> functions should use same errno codes for common errors. So in case you
> think that there should be EINVAL (and not EFAULT) then it should be
> changed for both functions.

If agree about the above, then yes, they both should be modified.

Re: Error handling in __djgpp_map_physical_memory()

<86y18ri2yb.fsf@gnu.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=950&group=comp.os.msdos.djgpp#950

  copy link   Newsgroups: comp.os.msdos.djgpp
Path: i2pn2.org!i2pn.org!news.swapon.de!weretis.net!feeder9.news.weretis.net!border-4.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 03 May 2024 10:51:31 +0000
X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp@delorie.com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
mime-version; bh=2jiHXIreW4VlkKmuSjT4eVzfdgK/BE1T+7BXkNecoBI=; b=HugDoO9CR3zo
Cr/UHXssWCMUHMjsyZpKj05XTKIlrAfXJq/m1kt+br0biEy4b8h+ByD2hLkr/sh/1eVi47xfst4df
D2dxRFSvi22fmBO6SkAxZzXdSiIVqzFPNAu1y0JrA406/7skywycDQ7uN4DTgRKH4XZa/UkUDpxmU
2D6Msf6SrGCRfe7jiteLBCKSJCrpdCN6Be9sbL45PcDQxJBknzyQGozrKqwLNMWvM89NfqGnt8dN1
CbpEkpE03WdnuUVC6sE4x6LPyC9s6gBhwYxXxpw8KtdfMmZA5uiQOCNDOnYyy5soIiTTis7KilMSW
IWtfvlIPm9BKnzyzMe+9hw==;
Date: Fri, 03 May 2024 13:50:52 +0300
Message-Id: <86y18ri2yb.fsf@gnu.org>
From: djgpp@delorie.com (Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com])
To: Pali <pali@pali.im>
Cc: djgpp@delorie.com
In-Reply-To: <20240503094443.wbbcczzjjkxwfqrs@pali> (message from Pali on Fri,
3 May 2024 11:44:43 +0200)
Subject: Re: Error handling in __djgpp_map_physical_memory()
References: <20240421102444.zjl5mmuhqbmuknhn@pali>
<86le567cmf.fsf@gnu.org>
<20240421193338.ankqza2y2ukxjtir@pali>
<86jzkq6kb8.fsf@gnu.org>
<20240422085506.7hzsool3u56xnsw2@pali> <20240503094443.wbbcczzjjkxwfqrs@pali>
Reply-To: djgpp@delorie.com
Errors-To: nobody@delorie.com
X-Mailing-List: djgpp@delorie.com
X-Unsubscribes-To: listserv@delorie.com
Precedence: bulk
Newsgroups: comp.os.msdos.djgpp
Organization: None provided
DJ-Gateway: from mailing list djgpp@delorie.com
Lines: 18
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-66NF+rQiGCSeWoReQvCB6QsZZcL3VY1AhA9Qe6zF2WVa8BTxA/gA9jJAWm598lfkDlmm8EZEIB13MAl!qxV+B3R4h4UtQCeG7PXKhvmZYiUa/BLzYb9qJL5GU9EZ
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Eli Zaretskii (eliz@ - Fri, 3 May 2024 10:50 UTC

> Date: Fri, 3 May 2024 11:44:43 +0200
> From: Pali <pali@pali.im>
> Cc: djgpp@delorie.com
>
> > > If agree about the above, then yes, they both should be modified.
> >
> > Could you please do it? Also updates documentation setattr.txh file
> > where is newly mentioned EFAULT code.
>
> Hello Eli, od you need from me to send a new change with replacing
> EFAULT by EINVAL? Or would you do this replacement during applying
> current change? I think that this is the only issue with change.

I can do it, but I need to find free time for that (of which there is
not too much lately, given my other engagements). Or you could send
an updated patch. Your call.

Thanks.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor