LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
LinkBack Search this Thread
Old 11-24-2009, 11:04 PM   #1
pandi.k
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
GTK apps hanging in signal handler


Hi all

I am developing a GUI application using GTK+ for my char driver.

And using pthread, write invoked to char interface driver and a signal handler is register for read interface call this is called once a signal notified from driver.

And also am using GTK widget like set a text in GTK edit box in my read signal handler.

Here i facing a problem of FUTEX lock in setting text in edit box after some runs.

If i do not set the text in edit it is passing, otherwise failing.

What could be reason for above failure?

Thanks
 
Old 11-24-2009, 11:06 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 9,428

Rep: Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048
Quote:
Originally Posted by pandi.k View Post
Hi all

I am developing a GUI application using GTK+ for my char driver.

And using pthread, write invoked to char interface driver and a signal handler is register for read interface call this is called once a signal notified from driver.

And also am using GTK widget like set a text in GTK edit box in my read signal handler.

Here i facing a problem of FUTEX lock in setting text in edit box after some runs.

If i do not set the text in edit it is passing, otherwise failing.

What could be reason for above failure?

Thanks
Well, since you don't post any of your code, any real error messages, or tell us what version/distro of Linux, GTK, etc., you're using, how can we tell, or even begin to try to help you??

Since you wrote the program, you're probably the best one to debug it.
 
Old 11-25-2009, 04:12 AM   #3
pandi.k
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Hi,


Here is my working env details.

Fedora core 7,kernel 2.6.21-1-3194, gcc version 4.1.2, GTK version Glade 2.12.1

My application running terminal shows as below,

#> Called ReceivePkt_Handler1
#> Event ID = 0
#> Length Received = 1
#> OverFlow Length = 0
#> Received data=a

After my app hangs, starce of my procees shows as below

#> strace -p 10682
#> Process 10682 attached - interrupt to quit
#> futex(0x4af5c9bc, FUTEX_WAIT, 2, NULL

code snippet is below
{
int i=0, j=0;
int bytes_rcvd,ret;
gchar *data;
unsigned long StaticStreamBuffer[4]={0,0,0,0};

gpstAppData1 ->s32Length = 4096;
gpstAppData1 ->s8CPortID = gConnectionInfoRx[0]->LocalCPortID;
gpstAppData1->s8DeviceID = gConnectionInfoRx[0]->LocalDeviceID;
gpstAppData1->s8Priority = gConnectionInfoRx[0]->Priority;
gpstAppData1->s8E2EEnabled = gConnectionInfoRx[0]->E2EEnabled;
printf("Called ReceivePkt_Handler1\n");

StaticStreamBuffer[0] = gConnectionInfoRx[0]->LocalCPortID;
StaticStreamBuffer[1] = gConnectionInfoRx[0]->LocalDeviceID;

ret = ioctl(gConnectionInfoRx[0]->filedes, UNI_GET_EVENTINFO, StaticStreamBuffer);
if(ret < 0)
{
printf("Ioctl Failed\n");
return;
}

printf("Event ID = %d\n",StaticStreamBuffer[0]);
printf("Length Received = %d\n",StaticStreamBuffer[1]);
printf("OverFlow Length = %d\n",StaticStreamBuffer[2]);

gpstAppData1 ->s32Length =StaticStreamBuffer[1] + + StaticStreamBuffer[2];
bytes_rcvd = read(gConnectionInfoRx[0]->filedes, gpstAppData1, gpstAppData1->s32Length);
gConnectionInfoRx[0]->bytes_rcvd+= bytes_rcvd ;

data=(gchar *)gpstAppData1->aBuffer;
printf("Received data=%s\n",(unsigned char *)gpstAppData1->aBuffer);
gtk_entry_set_text(GTK_ENTRY(receive_bytetx),data);
pos_at_receive += strlen(data);
memset(gpstAppData1->aBuffer,'0',bytes_rcvd);

}


Actually i am facing this problem after certain runs(~5-10).

If comment the line "gtk_entry_set_text(GTK_ENTRY(receive_bytetx),data);" in code, am able pass code successfully at many number of time.


Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
user-define signal handler & coredump for signal 11(SIGSEGV) Alexlun Linux - Software 2 05-24-2009 07:37 AM
How to reinstall a signal handler after exec ( Strange behaviour in signal handling ) lali.p Programming 0 09-21-2008 09:44 PM
How to pass input to a signal handler ? vasanth2001 Programming 8 08-29-2008 09:50 AM
signal handler routine vdx Programming 7 09-24-2007 01:43 AM


All times are GMT -5. The time now is 01:17 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration