Return-Path: X-Original-To: apmail-corinthia-dev-archive@minotaur.apache.org Delivered-To: apmail-corinthia-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4EDB617ECA for ; Mon, 23 Feb 2015 11:22:02 +0000 (UTC) Received: (qmail 88362 invoked by uid 500); 23 Feb 2015 11:22:02 -0000 Delivered-To: apmail-corinthia-dev-archive@corinthia.apache.org Received: (qmail 88333 invoked by uid 500); 23 Feb 2015 11:22:02 -0000 Mailing-List: contact dev-help@corinthia.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@corinthia.incubator.apache.org Delivered-To: mailing list dev@corinthia.incubator.apache.org Received: (qmail 88321 invoked by uid 99); 23 Feb 2015 11:22:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Feb 2015 11:22:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gabriela.gibson@gmail.com designates 209.85.223.169 as permitted sender) Received: from [209.85.223.169] (HELO mail-ie0-f169.google.com) (209.85.223.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Feb 2015 11:21:57 +0000 Received: by iecrl12 with SMTP id rl12so22437970iec.4 for ; Mon, 23 Feb 2015 03:20:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ms5bffpWsf3RFHftrTOrviBnBT53VXPoB0Bh97ELBAs=; b=iDY3ROhcwS9NmZg8f0QEatLf1DovT96/HK2WHzKnZWuTLT5+tCyEHUIRuwjc7Brn7g Jw85aczLDr1smiEH8Oh7j9g7AT1pDrKtPyM/HMzizbkvIclvusfP8F4FweAAkdaNlAoF ryAQk/RPi87tBTBEwqWtscX/TZdt9I/XGhJEjKDc8JvxGyIxsadtdYDN7eLkdboZA+iL 13Sx82wqpVQueFU4pMYHK2Fht3Me+PGJn7WHvI1vfTjDs/lgf5DqWqFMXT9zc/IEMkPQ yKxfy5BPFn/DqDw8m9zKDnmkX/2mDdRP4Yeu36/Hl1YwNTioMSwGt1jyoB9W8NjK2/7l eTSQ== X-Received: by 10.107.137.226 with SMTP id t95mr13262866ioi.10.1424690407178; Mon, 23 Feb 2015 03:20:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.29.14 with HTTP; Mon, 23 Feb 2015 03:19:47 -0800 (PST) In-Reply-To: <003201d04eb7$e4f49400$aeddbc00$@acm.org> References: <811A01B4-256D-4BF1-BCC7-55E3294DACAB@apache.org> <003201d04eb7$e4f49400$aeddbc00$@acm.org> From: Gabriela Gibson Date: Mon, 23 Feb 2015 11:19:47 +0000 Message-ID: Subject: Re: Checking malloc success and adding perror() To: dev@corinthia.incubator.apache.org, dennis.hamilton@acm.org Content-Type: multipart/alternative; boundary=001a113ec7b6a28b6d050fbf9528 X-Virus-Checked: Checked by ClamAV on apache.org --001a113ec7b6a28b6d050fbf9528 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you very much for that Dennis, this does make life very easy! G On Sun, Feb 22, 2015 at 3:54 PM, Dennis E. Hamilton wrote: > @Gabriela, > > Another way to submit the patches is to open an Issue on this and then > upload the patch as an attachment to a comment when it is ready. Zip > should also work fine. > > The Corinthia JIRA is at . > You will need to create a login for yourself. That will work for all > Apache projects that use JIRA, so you only need to do that once. The > landing page, above, is a Summary dashboard for the Corinthia subtree > ("key"). Noodle around on the sidebar to browse issues themselves. Also= , > look at the "More" pull-down on the menu bar at the top of issue pages. > > E.g., on the COR Summary page, click Issues. On the Issues page view All > issues or all Unresolved using links at the top. I think if you create t= he > issue, you can assign it to yourself and, if not, one of us should be abl= e > to assign it to you. > > You could report the bug (i.e., unchecked allocations) or you could creat= e > a task (or both) and there are probably subtasks that are worth creating = to > your overall effort. You can create sub-tasks on any issue. Again, if y= ou > don't have sufficient karma, ask one of us to do it. > > You can experiment with JIRA a little if not familiar with the Apache > setup of it. There's little that can't be adjusted if you decide on a > different structure for organization of issue bits after working a little > while. > > Have fun! (I once worked for a company VP whose idea of fun was shipping > code. I think that applies here for open-source big time.) > > - Dennis > > -----Original Message----- > From: jan i [mailto:jani@apache.org] > Sent: Sunday, February 22, 2015 04:47 > To: dev@corinthia.incubator.apache.org > Subject: Re: Checking malloc success and adding perror() > > On Sunday, February 22, 2015, Peter Kelly wrote: > > > Sounds great - I would just suggest putting the x* function > > implementations in Wrapper.c rather than having a separate copy in the > > files for each supported platform. Wrapper.c is sort of our generic pla= ce > > to put things which work the same way on all platforms but still need t= o > > live in the platform module (as is the case for the zip functions which > are > > currently there). > > +1 to use wrapper.c > > rgds > jan i > > > > > The memory allocation functions are identical for all platforms so I > think > > it would be better to avoid the code duplication - especially since we= =E2=80=99ll > > likely modify these for error handling/cleanup etc. and only want to do > so > > in one place. > > > > If the diffs are really big, you could perhaps post them as zip files t= o > > cut down on the size. Either that or post them somewhere we can get the= m; > > whatever is most convenient for you. > > > > =E2=80=94 > > Dr Peter M. Kelly > > pmkelly@apache.org > > > > PGP key: http://www.kellypmk.net/pgp-key < > http://www.kellypmk.net/pgp-key> > > (fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966) > > > > > On 22 Feb 2015, at 7:13 pm, Gabriela Gibson > > wrote: > > > > > > Hi, > > > > > > I propose to do the following: > > > > > > 1) Replace all the calls to *allocs (malloc, calloc, realloc) > > > {and also free()} with matching x* functions in DocFormats. > > > > > > 2) These new x*alloc functions will live in their respective > > > platform/src files, and will contain a call to the original > > > *alloc function and a simple exit handler. > > > > > > 3) I will create test cases in platform/tests/ for each of those > > > functions. I can either put them in WrapperTests.c or create a > > > new, MallocTests.c file for them. > > > > > > 4) I will start out with free(), just to be certain I get the shape > right > > > before I process the rest of the to-do list. > > > > > > 5) I will ship this as a 'git diff' files. > > > > > > What do you think? > > > > > > G > > > > > > On Wed, Feb 18, 2015 at 9:19 PM, Gabriela Gibson < > > gabriela.gibson@gmail.com > > > > wrote: > > > > > >> Hi, > > >> > > >> Reading through the source, I see that a lot of mallocs() do not hav= e > a > > >> > > >> [[ > > >> if(foo =3D=3D NULL) { > > >> perror("Foo: Out of memory.\n"); > > >> return _exit(EXIT_FAILURE); > > >> } > > >> ]] > > >> > > >> check. > > >> > > >> I can add those if you like. > > >> > > >> G > > >> -- > > >> Visit my Coding Diary: http://gabriela-gibson.blogspot.com/ > > >> > > > > > > > > > > > > -- > > > Visit my Coding Diary: http://gabriela-gibson.blogspot.com/ > > > > > > -- > Sent from My iPad, sorry for any misspellings. > > --=20 Visit my Coding Diary: http://gabriela-gibson.blogspot.com/ --001a113ec7b6a28b6d050fbf9528--