Opening the unused port & system call open("/dev/tty", ...) writev(7, [{"*** glibc detected *** ", 23} -


i using linux platform (3.12.13 & 2.6.35.3),& imx5x series processor. in program using 2 serial port read write operation /dev/ttymxc2 & /dev/ttymxc1 .after duration /dev/tty open system call executes not part of program & error comes open("/dev/tty", ...) writev(7, [{"* glibc detected * ", 23}.

please suggest solution ,the port not using in code still system call executed open /dev/tty/ .

these 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 sigabrt +++ 

please suggest solution

you need fix heap corruption bug glibc discovered you.

one way run program under valgrind, don't believe it's available imx5x.

another way run program export malloc_check_=2. see documentation.

yet way use addresssanitizer (if toolchain supports it).


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -