LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-17-2015, 12:57 AM   #1
ccc23
LQ Newbie
 
Registered: Mar 2015
Posts: 6

Rep: Reputation: Disabled
open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = 7 writev(7, [{"*** glibc detected ***


Hi ,

I am using a Linux platform (3.12.13 & 2.6.35.3),& imx5x series processor.
In my program I am using the two serial port for read write operation /dev/ttymxc2 & /dev/ttymxc1 .After some duration the /dev/tty open system call executes which is not a part of my program & the error comes open("/dev/tty", ...) writev(7, [{"*** glibc detected *** ", 23}.

Please suggest some solution ,the port which i am not using in my code still system call executed to open /dev/tty/ .

These are some strace log .


open("/dev/ttymxc2", O_RDWR|O_NOCTTY|O_NONBLOCK) = 4
nanosleep({0, 200000000}, NULL) = 0
ioctl(4, TCFLSH, 0x2) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B9600 opost -isig -icanon -echo ...}) = 0
ioctl(4, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B9600 opost -isig -icanon -echo ...}) = 0
open("/dev/ttymxc0", O_RDWR|O_NONBLOCK) = 5
ioctl(5, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B115200 opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B115200 opost -isig -icanon -echo ...}) = 0
open("/dev/ttymxc1", O_RDWR|O_NOCTTY|O_NONBLOCK) = 6
nanosleep({0, 200000000}, NULL) = 0
ioctl(6, TCFLSH, 0x2) = 0
ioctl(6, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B9600 opost -isig -icanon -echo ...}) = 0
ioctl(6, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B9600 opost -isig -icanon -echo ...}) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f2d000
write(1, "in main \n", 9) = 9
write(1, " Leaving process fun \n", 22) = 22
sigreturn() (mask []) = 71
write(1, "bab0 bab0\n", 11) = 11
open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = 7
writev(7, [{"*** glibc detected *** ", 23}, {"./test11_2", 10}, {": ", 2}, {"double free or corruption (!prev"..., 33}, {": 0x", 4}, {"00bfa0c0", 8}, {" ***\n", 5}], 7) = 85
mmap2(NULL, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x76d2d000
munmap(0x76d2d000, 864256) = 0
munmap(0x76f00000, 184320) = 0
mprotect(0x76e00000, 135168, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
write(1, "final out", 9) = 9
gettid() = 8796
tgkill(8796, 8796, SIGABRT) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=8796, si_uid=0} ---
+++ killed by SIGABRT +++
 
Old 03-17-2015, 06:19 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = 7
writev(7, [{"*** glibc detected *** ", 23}, {"./test11_2", 10}, {": ", 2}, {"double free or corruption (!prev"..., 33}, {": 0x", 4}, {"00bfa0c0", 8}, {" ***\n", 5}], 7) = 85
/dev/tty is opened for the purpose of printing the error message, your program doesn't open tty but it does cause the error.

Double free or corruption sounds like pointer troubles to me, did you close a file handle or free some memory at that point?
 
1 members found this post helpful.
Old 03-18-2015, 06:04 AM   #3
ccc23
LQ Newbie
 
Registered: Mar 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi ,
I solve the double free error .

But after sometime I am getting the following error & program gets hang.
I am using signal alarm & settings are given below.

struct itimerval delay;

// int i=0;
signal(SIGALRM,alarm_handler);

delay.it_value.tv_sec = 0;
delay.it_value.tv_usec = 400000;
delay.it_interval.tv_sec = 0;
delay.it_interval.tv_usec = 400000;

ret = setitimer(ITIMER_REAL, &delay, NULL);
if(ret)
{
perror("setitimer");
//return -1;
}


the program will hang up for infinite time & futex error comes.

Can you please help for how to set the restart time when this error comes.

These are some strace logs:

close(7) = 0
write(1, "\n", 1) = 1
open("/sys/class/gpio/export", O_WRONLY) = 7
write(7, "111", 3) = 3
close(7) = 0
open("/sys/class/gpio/gpio111/value", O_WRONLY) = 7
write(7, "1", 1) = 1
close(7) = 0
open("/sys/class/gpio/unexport", O_WRONLY) = 7
write(7, "111", 3) = 3
close(7) = 0
open("/sys/class/gpio/export", O_WRONLY) = 7
write(7, "4", 1) = 1
close(7) = 0
open("/sys/class/gpio/gpio4/value", O_WRONLY) = 7
write(7, "0", 1) = 1
close(7) = 0
open("/sys/class/gpio/unexport", O_WRONLY) = 7
write(7, "4", 1) = 1
close(7) = 0
write(1, " MAIN START ********lat 1516.03"..., 64) = 64
write(1, "\n", 1) = 1
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
write(1, " status value hex in main 40 \n", 30) = 30
gettimeofday({946685166, 936965}, NULL) = 0
futex(0xc20f0, FUTEX_WAIT, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
+++ killed by SIGINT +++
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Port Access Denied using open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY); morty346 Programming 11 01-02-2011 05:23 PM
"bad tty" & "file descriptor error" while building RPM on F13 gosssamer Linux - Software 7 12-28-2010 05:02 PM
open ("/dev/my_dev",O_RDWR): Operation not permitted zvivered Linux - Embedded & Single-board computer 4 09-10-2009 10:09 AM
Serial Port Access Denied using open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY); morty346 Linux - Newbie 4 02-11-2009 08:13 AM
Can't exec "firefox 1.5", "prompts glibc detected" SPo2 Linux - General 1 06-04-2006 11:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 06:39 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration