[openib-general] Segmentation fault when calling osmv_get_query_svc_rec()

Hal Rosenstock halr at voltaire.com
Wed Nov 22 04:20:00 PST 2006


Hi Steve,

On Wed, 2006-11-22 at 06:22, Steven Wooding wrote:
> Hi Hal,
>  
> The debugger reveals that the pointer p_sa_mad is equal to 0xffffffff.
> When the osmv_get_query_result() returns it tries to use
> p_sa_mad->data and that's what causes the seg fault.
>  
> I also noticed that mad_size=0 in the osm_madw_t structure.
>  
> What could have caused this to only happen in my user code?

I'm not 100% sure it's your user code. I want to eliminate the following
first prior to looking some more at what is going on:

There are two changes to make and see if this helps:

1. Save your original versions of osm_vendor_ibumad_sa.c and
osm_vendor_ibumad.c

2. Make the following change in osm_vendor_ibumad_sa.c:

Add the following in:
182,187c180

   /* put back the request madw */
   if (p_req_madw)
     osm_mad_pool_put(p_bind->p_mad_pool, p_req_madw);

after:
 Exit:

  /* free the copied query request if found */
  if (p_query_req_copy) cl_free(p_query_req_copy);

3. Copy OFED 1.1 osm_vendor_ibumad.c over. There are a number of
important bug fixes which may impact this. (Yes, I know the memory
allocation is using malloc/free directly but things should work or you
can hand edit these).

4. Rebuild

5. Rerun and see if still have same failure

You can back these out if you don't like but I think they are
improvements.

-- Hal

> Cheers,
>  
> Steve.
> 
>  
> On 21 Nov 2006 12:38:11 -0500, Hal Rosenstock <halr at voltaire.com>
> wrote: 
>         On Tue, 2006-11-21 at 12:09, Steven Wooding wrote:
>         > Hi,
>         >
>         > I've come across a problem with my code when doing a Service
>         Record 
>         > lookup. It's all fine until I call osmv_get_query_svc_rec(),
>         which
>         > then calls osmv_get_query_result(). The segmentation fault
>         then occurs
>         > on the return line.
>         >
>         > I'm using OFED release 1.0 (I tried upgrading to 1.1, but
>         that fails
>         > to build, complaining about the C++ preprocessor "/lib/cpp"
>         failing
>         > it's sanity check).
>         >
>         > A run of "osmtest -f s" works fine, so it is something in my
>         code. 
>         >
>         > Can anybody suggest what I can do next to solve this
>         problem?
>         
>         Look at it with the debugger to see why it is seg faulting.
>         That might
>         provide a clue as to what is going wrong.
>         
>         -- Hal
>         
>         >
>         > Thanks a lot.
>         >
>         > Cheers,
>         >
>         > Steve.
>         >
>         > PS. System is RHEL4, with Intel Compiler.
>         >
>         >
>         ______________________________________________________________________
>         >
>         > _______________________________________________
>         > openib-general mailing list
>         > openib-general at openib.org
>         > http://openib.org/mailman/listinfo/openib-general
>         >
>         > To unsubscribe, please visit
>         http://openib.org/mailman/listinfo/openib-general
>         
> 





More information about the general mailing list