[openib-general] [osm] segfault in libibumad

Hal Rosenstock halr at voltaire.com
Fri Jun 10 14:05:29 PDT 2005


On Fri, 2005-06-10 at 15:46, Bernhard Fischer wrote:
> On Fri, Jun 10, 2005 at 03:22:32PM -0400, Hal Rosenstock wrote:
> >On Fri, 2005-06-10 at 14:50, Bernhard Fischer wrote:
> 
> >> I'm not sure if userspace is supposed to work without sysfs. What do
> >> you think?
> >
> >It shouldn't segv...
> 
> Yes, but should it work? I don't know if its possible and implemented
> (in the long run) to get to and query the respective API versions in
> order not to rely on sysfs.

It is not designed to run without sysfs. sysfs is a requirement for
OpenIB.

> >> In osm_vendor_init(), i'd set int r = -1, n_cas = -1; and would say
> >> else\nif ((n_cas = umad_get_cas_names.
> >> Also, in umad_get_cas_names() i guess only freeing namelist if
> >> scandir did not return <0 may be better..
> >
> >Yes to both.
> 
> >Can you try this patch ? Thanks.
> 
> >-	free(namelist);
> >+	if (n >= 0)
> >+		free(namelist);
> yes, should do.
> 
> >-	}
> >+	} else
> >+		r = n_cas = -1;
> yes, but why not just initialize r and n_cas to -1?

OK. Did you try it ?

-- Hal




More information about the general mailing list