Re: [PATCH] hurd: Check return value of mach_port_mod_refs() in the dup routine of fcntl()

2025-03-05 Thread Samuel Thibault
Hello, While at it, we'd better also fix sysdeps/mach/hurd/dup3.c the exact same way (which will also fix dup2). Thanks, Samuel Zhaoming Luo, le jeu. 06 mars 2025 06:39:04 +0800, a ecrit: > Ignoring the return value of mach_port_mod_ref() causes the situation > + if (err) > +

[PATCH] hurd: Check return value of mach_port_mod_refs() in the dup routine of fcntl()

2025-03-05 Thread Zhaoming Luo
Ignoring the return value of mach_port_mod_ref() causes the situation that when the reference count of the io server port is full, the caller of dup() still supposes a new file discriptor is allocated. In this patch we check the return value of mach_port_mod_ref() and return an error when it fails.

Re: curl testsuite 537

2025-03-05 Thread Zhaoming Luo
On Mon, Mar 03, 2025 at 01:27:50PM +0100, Samuel Thibault wrote: > Zhaoming Luo, le lun. 03 mars 2025 19:35:37 +0800, a ecrit: > > Test 537 on Hurd opens 0x4 file discriptors and close them[0]. > > The code is really odd. > > if(nitems > 0x7fff) > nitems = 0x4; > > I would have

Re: [RFC PATCH glibc] Check return value of a mach_port_mod_ref() in dup()

2025-03-05 Thread Zhaoming Luo
On Wed, Mar 05, 2025 at 01:12:04PM +0100, Samuel Thibault wrote: > Zhaoming Luo, le mer. 05 mars 2025 20:07:56 +0800, a ecrit: > > On Wed, Mar 05, 2025 at 12:38:39PM +0100, Samuel Thibault wrote: > > > Hello, > > > > Thanks for the quick reply. > > > > > > Zhaoming Luo, le mer. 05 mars 2025 19:25

Re: [RFC PATCH glibc] Check return value of a mach_port_mod_ref() in dup()

2025-03-05 Thread Samuel Thibault
Zhaoming Luo, le mer. 05 mars 2025 20:07:56 +0800, a ecrit: > On Wed, Mar 05, 2025 at 12:38:39PM +0100, Samuel Thibault wrote: > > Hello, > > Thanks for the quick reply. > > > > Zhaoming Luo, le mer. 05 mars 2025 19:25:15 +0800, a ecrit: > > > - Run 'apt source glibc', use quilt to apply this pat

Re: [RFC PATCH glibc] Check return value of a mach_port_mod_ref() in dup()

2025-03-05 Thread Zhaoming Luo
On Wed, Mar 05, 2025 at 12:38:39PM +0100, Samuel Thibault wrote: > Hello, Thanks for the quick reply. > > Zhaoming Luo, le mer. 05 mars 2025 19:25:15 +0800, a ecrit: > > - Run 'apt source glibc', use quilt to apply this patch and build > > the libc package using `dpkg-buildpackage -B`. I got th

Re: [RFC PATCH glibc] Check return value of a mach_port_mod_ref() in dup()

2025-03-05 Thread Samuel Thibault
Hello, Zhaoming Luo, le mer. 05 mars 2025 19:25:15 +0800, a ecrit: > - Run 'apt source glibc', use quilt to apply this patch and build > the libc package using `dpkg-buildpackage -B`. I got the same error as > [0]. > > [0]: > https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hurd-i38

[RFC PATCH glibc] Check return value of a mach_port_mod_ref() in dup()

2025-03-05 Thread Zhaoming Luo
This patch is quite conservative, only the first mach_port_mod_ref() is checked, as I haven't found an elegant way to check both mach_port_mod_ref()s. I haven't successfully tested this patch. I have tried several methods to apply the patch and build but failed: - Clone the glibc source code, try