#108 hangs in state USEM

Luminance_HDR_2.1.0
open
Davide
Program (114)
5
2012-10-08
2012-01-21
H2
No

Luminance from trunk gets stuck in state usem, when creating a new hdr oder loading an existing one. Some searching revealed that this probably related to locking, semaphores, mutexes. Possibly OpenMP.

Here's luminance output on command-line:
hannes@fbsdmain /opt % /opt/qtpfsgui-trunk/luminance-hdr
QDir::currentPath() = "/opt"
QCoreApplication::applicationDirPath() = "/opt/qtpfsgui-trunk"
"/home/hannes/.LuminanceHDR/saved_parameters.db"
Database opened
HdrViewer::mapFrameToImage() [NEW]= 2311.28 msec
MainWindow::updateActions( 0 )
MainWindow::updateActionsHdrImage()
resizeFrame() = 362.77 msec
MainWindow::generatePreviews()
pfscopy() = 0.283 msec
transformRGB2XYZ() = 0.154 msec
pfstmo_mantiuk06 (Mode: Contrast Mapping, scaleFactor: pfscopy() = 0.22 msec0.1, saturationFactor:
0.8, detailFactor: 0.8

Here's a procstat, that shows where in the kernel the program is busy:
hannes@fbsdmain ~ % procstat -k 8541
PID TID COMM TDNAME KSTACK
8541 101321 luminance-hdr - mi_switch sleepq_catch_signals sleepq_wait_sig _sleep do_sem_wait umtx_op_sem_wait amd64_syscall Xfast_syscall
8541 101425 luminance-hdr - mi_switch sleepq_catch_signals sleepq_wait_sig _cv_wait_sig seltdwait sys_poll amd64_syscall Xfast_syscall
8541 101444 luminance-hdr - mi_switch sleepq_catch_signals sleepq_wait_sig _cv_wait_sig seltdwait sys_poll amd64_syscall Xfast_syscall
8541 101445 luminance-hdr - mi_switch sleepq_catch_signals sleepq_wait_sig _sleep do_sem_wait
umtx_op_sem_wait amd64_syscall Xfast_syscall
8541 101446 luminance-hdr - mi_switch sleepq_catch_signals sleepq_wait_sig _sleep do_sem_wait umtx_op_sem_wait amd64_syscall Xfast_syscall
8541 101447 luminance-hdr - mi_switch sleepq_catch_signals sleepq_wait_sig _sleep do_sem_wait
umtx_op_sem_wait amd64_syscall Xfast_syscall
8541 101448 luminance-hdr - mi_switch sleepq_catch_signals sleepq_wait_sig _sleep do_sem_wait __umtx_op_sem_wait amd64_syscall Xfast_syscall

The System is FreeBSD9, amd64, with plenty of CPU and RAM.

Thanks for your help and luminance in general!

Discussion

  • Davide
    Davide
    2012-01-21

    Hi,
    it definitely seems to be a problem related to OpenMP. If you wanna double check that, open the CMakeLists.txt and comment line 153

    FIND_PACKAGE(OpenMP REQUIRED)

    then "make clean" and "make" again. Let me know if this solves the problem.

    Which compiler are you using?

    D.

     
  • H2
    H2
    2012-01-24

    If I disable use of OpenMP, the program can't be linked against libraw anymore, because that requires openmp :/

    I use gcc4.2.1 as comes with FreeBSD. I also have Clang and gcc46 installed, but dont't know how to make CMake use those (haven't bothered to much with CMake yet).

    Thanks for your help

     
  • Davide
    Davide
    2012-01-24

    Hi,
    GCC 4.2.x has a buggy implementation. Unfortunately, I know really well the problem, because Mac OS X has got the same problem.

    You can use GCC 4.6 (Clang doesn't support OpenMP yet). To use a different compiler, clear your CMake cache (aka, remove everything in your build folder) and type:

    $ CC=gcc46 CXX=g++46 cmake <luminance source="" folder="">

    However, if you wanna avoid troubles, all the dependency must be compiled with the same compiler, otherwise you will get multiple inclusion of the standard libraries (from different version of GCC), which will make Luminance crash at runtime.

    If you did compile LibRAW on your own, recompile without OpenMP and then re-link with Luminance.

    Let me know how it goes. Unfortunately my CMake configuration hasn't work properly because it should have disable OpenMP automatically with your compiler.