Send inn-workers mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."


Today's Topics:

   1. buffindexed shmem.c patch (The Doctor)
   2. Re: buffindexed shmem.c patch (Julien ?LIE)
   3. Re: Clean 'make check' against gcc
      -fsanitize=address,undefined (Julien ?LIE)
   4. Re: Clean 'make check' against gcc
      -fsanitize=address,undefined (Richard Kettlewell)
   5. Re: Clean 'make check' against gcc
      -fsanitize=address,undefined (Richard Kettlewell)


----------------------------------------------------------------------

Message: 1
Date: Mon, 22 Jun 2015 09:02:24 -0600
From: The Doctor <[email protected]>
To: [email protected]
Subject: buffindexed shmem.c patch
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Julien and Company.

In some cases in buffindexed/shmem.c , the semaphore compile breaks

Around line 268 please apply this:

        union semun s_u;
        s_u.val=0;
        if (semctl(this->semap, 0, IPC_RMID, s_u) < 0) {
        /*if (semctl(this->semap, 0, IPC_RMID, NULL) < 0) {*/

-- 
Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
God,Queen and country!Never Satan President Republic!Beware AntiChrist rising! 
http://www.fullyfollow.me/rootnl2k  Look at Psalms 14 and 53 on Atheism
Abuse a man unjustly, and you will make friends for him.  -Edgar Watson Howe


------------------------------

Message: 2
Date: Mon, 22 Jun 2015 20:00:05 +0200
From: Julien ?LIE <[email protected]>
To: [email protected]
Subject: Re: buffindexed shmem.c patch
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

Hi The Doctor,

> In some cases in buffindexed/shmem.c, the semaphore compile breaks
> 
> Around line 268 please apply this:
> 
>          union semun s_u;
>          s_u.val=0;
>          if (semctl(this->semap, 0, IPC_RMID, s_u) < 0) {
>          /*if (semctl(this->semap, 0, IPC_RMID, NULL) < 0) {*/

Well spotted, thanks!
Patch applied.

--- storage/buffindexed/shmem.c (r?vision 9902)
+++ storage/buffindexed/shmem.c (copie de travail)
@@ -265,9 +265,19 @@
         else
             debug("shmid %d deleted", this->shmid);
         /* Delete the semaphore too */
+#ifdef HAVE_UNION_SEMUN
+        {
+            union semun semArg;
+            semArg.val = 0;
+            if (semctl(this->semap, 0, IPC_RMID, semArg) < 0) {
+                syswarn("can't remove semaphore %d", this->semap);
+            }
+        }
+#else
         if (semctl(this->semap, 0, IPC_RMID, NULL) < 0) {
             syswarn("can't remove semaphore %d", this->semap);
         }
+#endif
     }
     free( this );
 }

-- 
Julien ?LIE

? Depuis que j'ai chang? mon clavier qwerty pour un clavier azerty,
  je tape deux fois plus vite.
  Pourquoi ? Parce qu'un homme azerty en vaut deux ! ?


------------------------------

Message: 3
Date: Mon, 22 Jun 2015 20:27:58 +0200
From: Julien ?LIE <[email protected]>
To: [email protected]
Subject: Re: Clean 'make check' against gcc
        -fsanitize=address,undefined
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

Hi Richard,

> Patch attached.

OK, thanks for these.


> --- a/tests/innd/artparse-t.c
> +++ b/tests/innd/artparse-t.c
> @@ -59,6 +59,7 @@ fake_innconf(void)
>          free(innconf);
>      }
>      innconf = xmalloc(sizeof(*innconf));
> +    memset(innconf, 0, sizeof *innconf);
>      innconf->logipaddr = false;
>      innconf->maxartsize = 8 * 1024;
>      innconf->pathetc = xstrdup("../data/etc");

Shouldn't the same memset() line be added after the allocation
of innconf in the following files?
- tests/overview/api-t.c
- tests/overview/overview-t.c
- tests/overview/xref-t.c
- lib/innconf.c

"-fsanitize=address,undefined" did not trigger any warning for them?



>     1. memchr can't tolerate a null pointer argument (even for 0 bytes)
>
> --- a/lib/buffer.c
> +++ b/lib/buffer.c
> @@ -245,6 +245,8 @@ buffer_find_string(struct buffer *buffer, const char 
> *string, size_t start,
>      length = strlen(string);
>      do {
>          data = buffer->data + buffer->used + start;
> +        if(!data)
> +            return false;
>          terminator = memchr(data, string[0], buffer->left - start);
>          if (terminator == NULL)
>              return false;

This patch is related to an external library we use (rra-c-util).  It will
be merged into INN when and if Russ takes it into account in a future release
of rra-c-util.

-- 
Julien ?LIE

? Depuis que j'ai chang? mon clavier qwerty pour un clavier azerty,
  je tape deux fois plus vite.
  Pourquoi ? Parce qu'un homme azerty en vaut deux ! ?


------------------------------

Message: 4
Date: Mon, 22 Jun 2015 20:37:34 +0100
From: Richard Kettlewell <[email protected]>
To: [email protected]
Subject: Re: Clean 'make check' against gcc
        -fsanitize=address,undefined
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

On 22/06/15 19:27, Julien ?LIE wrote:
>> --- a/tests/innd/artparse-t.c
>> +++ b/tests/innd/artparse-t.c
>> @@ -59,6 +59,7 @@ fake_innconf(void)
>>          free(innconf);
>>      }
>>      innconf = xmalloc(sizeof(*innconf));
>> +    memset(innconf, 0, sizeof *innconf);
>>      innconf->logipaddr = false;
>>      innconf->maxartsize = 8 * 1024;
>>      innconf->pathetc = xstrdup("../data/etc");
> 
> Shouldn't the same memset() line be added after the allocation
> of innconf in the following files?
> - tests/overview/api-t.c
> - tests/overview/overview-t.c
> - tests/overview/xref-t.c
> - lib/innconf.c

Wouldn't hurt!

> "-fsanitize=address,undefined" did not trigger any warning for them?

It didn't.  I expect they don't access the uninitialized parts of the
structure.  Dynamic analysis can only reveal limited classes of issues...

>>     1. memchr can't tolerate a null pointer argument (even for 0 bytes)
>>
>> --- a/lib/buffer.c
>> +++ b/lib/buffer.c
>> @@ -245,6 +245,8 @@ buffer_find_string(struct buffer *buffer, const char 
>> *string, size_t start,
>>      length = strlen(string);
>>      do {
>>          data = buffer->data + buffer->used + start;
>> +        if(!data)
>> +            return false;
>>          terminator = memchr(data, string[0], buffer->left - start);
>>          if (terminator == NULL)
>>              return false;
> 
> This patch is related to an external library we use (rra-c-util).  It will
> be merged into INN when and if Russ takes it into account in a future release
> of rra-c-util.

OK

ttfn/rjk



------------------------------

Message: 5
Date: Mon, 22 Jun 2015 21:36:24 +0100
From: Richard Kettlewell <[email protected]>
To: [email protected]
Subject: Re: Clean 'make check' against gcc
        -fsanitize=address,undefined
Message-ID: <[email protected]>
Content-Type: text/plain; charset="windows-1252"

Here's another patch fixing an issue identified by the same tool.

ttfn/rjk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: timer.patch
Type: text/x-patch
Size: 1241 bytes
Desc: not available
URL: 
<https://lists.isc.org/pipermail/inn-workers/attachments/20150622/a751d1c7/attachment-0001.bin>

------------------------------

_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers

End of inn-workers Digest, Vol 73, Issue 11
*******************************************

Reply via email to