[openib-general] RE: [PATCH] Opensm - fix segfault on exit - cont.

Yael Kalka yael at mellanox.co.il
Mon Dec 19 23:11:12 PST 2005


Hi Hal,
The compiler version is gcc (GCC) 4.0.2
As you see from the patch - something strange is going on with the
compiler(probably).
I have a pointer that its value is null, but it still enters the if
statement, and
doesn't handle it as zero.
There are many more places where we have if statements on pointers
similar to this
case, and this compiler change can be very problematic.
Do you/anyone else know about this change in the gcc version? Is this
behavior 
controlled by some flag?
Thanks,
Yael


-----Original Message-----
From: Hal Rosenstock [mailto:halr at voltaire.com]
Sent: Monday, December 19, 2005 1:42 PM
To: Yael Kalka
Cc: openib-general at openib.org; Eitan Zahavi
Subject: Re: [PATCH] Opensm - fix segfault on exit - cont.


Hi Yael,

On Mon, 2005-12-19 at 04:19, Yael Kalka wrote:
> Hi Hal,
> 
> I've noticed that under certain operating systems,

Seems more likely like a compiler difference rather than OS difference.
Can you mention on which distribution/compiler this made a difference ?

> when driver isn't 
> loaded, the SM still exits with segfault.
> The following patch fixes this.
> 
> Thanks,
> Yael
> 
> Signed-off-by:  Yael Kalka <yael at mellanox.co.il>
> 
> Index: libvendor/osm_vendor_ibumad.c
> ===================================================================
> --- libvendor/osm_vendor_ibumad.c       (revision 4522)
> +++ libvendor/osm_vendor_ibumad.c       (working copy)
> @@ -552,7 +552,7 @@ osm_vendor_delete(
>  
>         /* umad receiver thread ? */
>         p_ur = (*pp_vend)->receiver;
> -       if (&p_ur->signal)
> +       if (&p_ur->signal != NULL)

If this makes a difference, there are other uses of similar syntax which
should be changed :-(

>                 cl_event_destroy( &p_ur->signal );
>         cl_spinlock_destroy( &(*pp_vend)->cb_lock );
>         cl_spinlock_destroy( &(*pp_vend)->match_tbl_lock );

-- Hal



More information about the general mailing list