Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, March 2008
QMUTEX SEGV at lock


Message 1 in thread


A
{
    mutex X

    funcA()
   {
        mutex.lock();
        ...
        ....
        ...
        mutex.unlock();
   }

    starter()
   {
         B* inst1 = new B( this ); //here this is A
         C* inst2 = new C( this ); //here this is A
         inst1->start();
         inst2->start();
        while(  !inst1->finsihed() &&  !inst2->finsihed() )
        {
              wait and check for error in thread outputed data
        }

  }

}

A is the intializer of B and C so it has a pointer of A which can be 
consider as parent not inherited

class B::QThread
{
    run()
   {
        Aptr->funcA();
  }
}


class C::QThread
{
    run()
   {
        Aptr->funcA();
  }
}

whenever C calls funcA the mutex gets a segv while calling the lock and 
ends up failing deep in the qt library.

-- 
 [ signature omitted ] 

Message 2 in thread

small change
Srikanth Bemineni wrote:
>
>
> A
> {
>    mutex X
>
>    funcA()
>   {
>        X.lock();
>        ...
>        ....
>        ...
>        X.unlock();
>   }
>
>    starter()
>   {
>         B* inst1 = new B( this ); //here this is A
>         C* inst2 = new C( this ); //here this is A
>         inst1->start();
>         inst2->start();
>        while(  !inst1->finsihed() &&  !inst2->finsihed() )
>        {
>              wait and check for error in thread outputed data
>        }
>
>  }
>
> }
>
> A is the intializer of B and C so it has a pointer of A which can be 
> consider as parent not inherited
>
> class B::QThread
> {
>    run()
>   {
>        Aptr->funcA();
>  }
> }
>
>
> class C::QThread
> {
>    run()
>   {
>        Aptr->funcA();
>  }
> }
>
> whenever C calls funcA the mutex gets a segv while calling the lock 
> and ends up failing deep in the qt library.
>


-- 
 [ signature omitted ] 

Message 3 in thread

Srikanth Bemineni wrote:
>whenever C calls funcA the mutex gets a segv while calling the lock and
>ends up failing deep in the qt library.

Please post a compileable example instead of pseudo-code. Also, please 
post the stack trace and a valgrind log.

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.