Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 48568
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: jiminaus [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Patch to fix POSIX locking on Darwin
Date: Mon, 10 Aug 2009 12:29:31 +1000
To: bug-Mail-Box [...] rt.cpan.org
From: Jim In Aus <jiminaus [...] gmail.com>
I've just moved from FreeBSD (VM under Windows) to a Mac OS X (yeah!!). I've hit an issue with Mail-Box-2.090 on Mac OS X 10.5.8 with perl 5.8.9. In the sub _try_lock of Mail::Box::Locker::POSIX, the call to fcntl is resulting in an invalid argument errno. I think darwin's definition for the flock structure is different from what's been coded for. Attached is a patch which moves Mail::Box::Locker::POSIX from using a hard-coded pack to create a flock structure and directly calling fcntl, to using the File-FcntlLock-0.10 CPAN module by JTT. This modules calculates the offsets of the fields within the flock structure for the platform when it's installed. Using this code, the POSIX locker now works on Mac OS X. I think it would also shield the POSIX locker from other platform differences and from 32-bit/64-bit issues as well?

Message body is not shown because sender requested not to inline it.

Subject: [rt.cpan.org #48568] Second attempt at patch
Date: Mon, 10 Aug 2009 12:37:26 +1000
To: bug-Mail-Box [...] rt.cpan.org
From: Jim In Aus <jiminaus [...] gmail.com>
Sorry Mark. I didn't read line fcntl line in _try_lock that I'd replaced correctly. I've attached a corrected patch.
Subject: [rt.cpan.org #48568] Doh
Date: Mon, 10 Aug 2009 12:38:43 +1000
To: bug-Mail-Box [...] rt.cpan.org
From: Jim In Aus <jiminaus [...] gmail.com>
Doh, it's not my day!

Message body is not shown because sender requested not to inline it.

On Sun Aug 09 22:39:08 2009, jiminaus@gmail.com wrote: Show quoted text
> Doh, it's not my day!
Sorry, I had missed this bug-report, probably due to too much spam. I will consider your patch, but hessitate because it adds another dependency (even more than one). Besides, the used package uses binary components which makes installation more difficult. I'll be back to you soon.
I have added a new locker, named Mail::Box::Locker::FcntlLock, which is the ::Locker::POSIX code with your patches. I did not want to make MailBox dependent on another (rarely used?) binary module. Will be released later today in 2.093
Subject: Re: [rt.cpan.org #48568] Patch to fix POSIX locking on Darwin
Date: Thu, 24 Dec 2009 21:17:35 +1100
To: bug-Mail-Box [...] rt.cpan.org
From: Jim In Aus <jiminaus [...] gmail.com>
Hi Mark, Thanks for this. I'll update my modules and my code. I do understand not wanting to link to another module, especially a binary module. But I'm curious that the POSIX locker doesn't break more often (eg. FreeBSD vs Linux, 32-bit vs 64-bit) or have steps be taken to ensure the structure is binary compatible? (Rhetorical, just thinking out loud) Regards, Jim On 2009 Dec 24, at 20:56, Mark Overmeer via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=48568 > > > I have added a new locker, named Mail::Box::Locker::FcntlLock, which is > the ::Locker::POSIX code with your patches. I did not want to make > MailBox dependent on another (rarely used?) binary module. > > Will be released later today in 2.093
Subject: Re: [rt.cpan.org #48568] Patch to fix POSIX locking on Darwin
Date: Thu, 24 Dec 2009 11:54:16 +0100
To: Jim In Aus via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Jim In Aus via RT (bug-Mail-Box@rt.cpan.org) [091224 10:48]: Show quoted text
> Queue: Mail-Box > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48568 > > > But I'm curious that the POSIX locker doesn't break more often > (eg. FreeBSD vs Linux, 32-bit vs 64-bit) or have steps be taken to ensure > the structure is binary compatible? (Rhetorical, just thinking out loud)
I don't know. I have stolen that code myself, a very long time ago. And no-one ever complained. There are tests for the POSIX lock, so apparently it does work everywhere else. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net