[Libva] vainfo crashes with "Program received signal SIGFPE, Arithmetic exception." Need help to troubleshoot.

Gwenole Beauchesne gb.devel at gmail.com
Tue Feb 26 01:59:51 PST 2013


Hi,

Thanks for your detailed reports. How different is box #1 from box #2,
i.e. chipset?

SIGFPE generally means a division by zero ocurred. The only way this
is possible is if (i) one of the object_heap_init() calls failed
during __vaDriverInit() or (ii) if vaTerminate() was called while the
driver was getting initialized. Both cases looks unlikely but
possible.

Could you please try to figure out how __vaDriverInit() failed on box #2?
Do you at least see the "vainfo: Driver version:" message?

There are multiple bugs:
- object_heap_destroy() should check whether heap_increment is zero.
In that case, this is one indication that object_heap() was not
called. That's not 100% sure either, but a good indication
- vaTerminate() should only try to destroy up to what was initialized
through __vaDriverInit();
- Initialization functions should report more meaningful messages when
something fails.

There are multiple causes to your initialization failures in your box #2:
- XOpenDisplay() failed -- do you have a correct DISPLAY or are you
issuing vainfo right from box #2 terminal ?
- vdp_device_create_x11() failed ;
- vdpau_get_api_version() failed or did not return the expected API version ;
- vdpau_get_information_string() failed.

Thanks,
Gwenole.

2013/2/25  <dar8757 at eml.cc>:
> turning on debug flags
>
>         export CFLAGS="-O0 -ggdb"
>         export CXXFLAGS="-O0 -ggdb"
>
> using the following reproducible procedure
>
>         bzr co lp:libvdpau
>         git clone git://anongit.freedesktop.org/git/libva
>         git clone git://anongit.freedesktop.org/vaapi/vdpau-driver
>
>         cd ./libvdpau
>         ./autogen.sh
>         ./configure \
>         --libdir=/usr/local/lib64
>         make
>         make install
>         ldconfig
>
>         cd ../libva
>         ./autogen.sh
>         ./configure --libdir=/usr/local/lib64 \
>         --with-drivers-path=/usr/local/lib64/dri \
>         --enable-dummy-driver \
>         --enable-glx \
>         --enable-egl \
>         --disable-wayland
>         make
>         make install
>         ldconfig
>
>         cd ../vdpau-driver
>         ./autogen.sh
>         ./configure \
>          --libdir=/usr/local/lib64 \
>          --enable-glx \
>          --enable-tracer \
>          --with-sysroot=/usr/local/${LIBDIR}
>         make
>         make install
>         ldconfig
>
> GDB session returns
>
>         gdb vainfo
>                 (gdb) run
>                 Starting program: /usr/local/bin/vainfo
>                 [Thread debugging using libthread_db enabled]
>                 Using host libthread_db library
>                 "/lib64/libthread_db.so.1".
>                 libva info: VA-API version 0.33.0
>                 libva info: va_getDriverName() returns 0
>                 libva info: Trying to open
>                 /usr/local/lib64/dri/nvidia_drv_video.so
>                 libva info: Found init function __vaDriverInit_0_33
>
>                 Program received signal SIGFPE, Arithmetic exception.
>                 0x00007ffff5e4c87c in object_heap_destroy
>                 (heap=0x619c30) at object_heap.c:275
> !!              275         for (i = 0; i < heap->heap_size /
> heap->heap_increment; i++) {
>                 (gdb) bt
>                 #0  0x00007ffff5e4c87c in object_heap_destroy
>                 (heap=0x619c30) at object_heap.c:275
>                 #1  0x00007ffff5e50455 in destroy_heap
>                 (name=0x7ffff5e5f174 "buffer", heap=0x619c30,
>                     destroy_func=0x7ffff5e50337 <destroy_buffer_cb>,
>                     user_data=0x619ae0) at vdpau_driver.c:138
>                 #2  0x00007ffff5e50488 in vdpau_common_Terminate
>                 (driver_data=0x619ae0) at vdpau_driver.c:159
>                 #3  0x00007ffff5e51a75 in vdpau_Terminate_Current
>                 (ctx=0x612d30) at vdpau_driver_template.h:537
>                 #4  0x00007ffff5e51b22 in vdpau_Initialize_Current
>                 (ctx=0x612d30) at vdpau_driver_template.h:563
>                 #5  0x00007ffff5e51f04 in __vaDriverInit_0_33
>                 (ctx=0x612d30) at vdpau_driver.c:317
>                 #6  0x00007ffff7bc494e in va_openDriver (dpy=0x605500,
>                 driver_name=0x6133c0 "nvidia") at va.c:273
>                 #7  0x00007ffff7bc543b in vaInitialize (dpy=0x605500,
>                 major_version=0x7fffffffd96c,
>                 minor_version=0x7fffffffd968)
>                     at va.c:446
>                 #8  0x000000000040119f in main (argc=1,
>                 argv=0x7fffffffda88) at vainfo.c:98
>                 (gdb)
>
> identifying a problem in object_heap.c
>
>
>         vi /usr/local/src/vdpau-driver/src/object_heap.c
>
>                 ...
>                 261     object_heap_destroy(object_heap_p heap)
>                 262     {
>                 263         object_base_p obj;
>                 264         int bucket_index, obj_index, i;
>                 265
>                 266         /* Check if heap is empty */
>                 267         for (i = 0; i < heap->heap_size; i++) {
>                 268             /* Check if object is not still
>                 allocated */
>                 269             bucket_index = i / heap->heap_increment;
>                 270             obj_index = i % heap->heap_increment;
>                 271             obj =
>                 (object_base_p)(heap->bucket[bucket_index] + obj_index *
>                 heap->object_size);
>                 272             ASSERT(obj->next_free != ALLOCATED);
>                 273         }
>                 274
> !!!             275         for (i = 0; i < heap->heap_size /
> heap->heap_increment; i++) {
>                 276             free(heap->bucket[i]);
>                 277         }
>                 278
>                 279         pthread_mutex_destroy(&heap->mutex);
>                 280
>                 281         free(heap->bucket);
>                 282         heap->bucket = NULL;
>                 283         heap->heap_size = 0;
>                 284         heap->next_free = LAST_FREE;
>                 285     }
>
> which, i think (?), appeared in
>
>         http://cgit.freedesktop.org/vaapi/intel-driver/commit/?id=ef5efefaec8b3a4eafde2347b98a973f73745421
> _______________________________________________
> Libva mailing list
> Libva at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libva


More information about the Libva mailing list