[LinuxPPS] Not seeing PPS with new stuff (MORE)

Rodolfo Giometti giometti at enneenne.com
Thu Jun 12 22:44:14 CEST 2008


On Thu, Jun 12, 2008 at 11:55:23AM -0600, clemens at dwf.com wrote:
> 
> > Strange behaviour... the proces should be killable... can you please
> > run ttyctrl with strace?
> > 
> >    strace ttyctrl <params>
> > 
> 
> OK here's what I see:
> 
> [root at deneb Desktop]# strace ./ttyctrl -X -s 17 /dev/ttyS0
> execve("./ttyctrl", ["./ttyctrl", "-X", "-s", "17", "/dev/ttyS0"], [/* 45 vars */]) = 0
> brk(0)                                  = 0x804a000
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=79274, ...}) = 0
> mmap2(NULL, 79274, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7eff000
> close(3)                                = 0
> open("/lib/libc.so.6", O_RDONLY)        = 3
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\237S\0004\0\0\0"..., 512) = 512
> fstat64(3, {st_mode=S_IFREG|0755, st_size=1589908, ...}) = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7efe000
> mmap2(0x524000, 1308068, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x524000
> mmap2(0x65e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13a) = 0x65e000
> mmap2(0x661000, 9636, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x661000
> close(3)                                = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7efd000
> set_thread_area({entry_number:-1 -> 6, base_addr:0xb7efd6c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
> mprotect(0x65e000, 8192, PROT_READ)     = 0
> mprotect(0x520000, 4096, PROT_READ)     = 0
> munmap(0xb7eff000, 79274)               = 0
> open("/dev/ttyS0", O_RDWR)              = 3
> ioctl(3, TIOCSETD, [17])                = 0

The ioctl returns with no errors, ok.

> pause(
> 
> ---
> 
> Now if I give ttyctrl a kill -9 from another window, the last line of the strace changes to
> 
> pause()                                 = ? ERESTARTNOHAND (To be restarted)
> 
> ---
> 
> Additional kills do not change anything in the strace, and the process is still there.

Really strange! I don't understand why the process hangs. =:-o

> ---
> 
> If I now go to another window, and run the strace again, I see:
> 
> [root at deneb Desktop]# strace ./ttyctrl -X -s 17 /dev/ttyS0
> execve("./ttyctrl", ["./ttyctrl", "-X", "-s", "17", "/dev/ttyS0"], [/* 45 vars */]) = 0
> brk(0)                                  = 0x804a000
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=79274, ...}) = 0
> mmap2(NULL, 79274, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f39000
> close(3)                                = 0
> open("/lib/libc.so.6", O_RDONLY)        = 3
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\237S\0004\0\0\0"..., 512) = 512
> fstat64(3, {st_mode=S_IFREG|0755, st_size=1589908, ...}) = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f38000
> mmap2(0x524000, 1308068, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x524000
> mmap2(0x65e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13a) = 0x65e000
> mmap2(0x661000, 9636, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x661000
> close(3)                                = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f37000
> set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f376c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
> mprotect(0x65e000, 8192, PROT_READ)     = 0
> mprotect(0x520000, 4096, PROT_READ)     = 0
> munmap(0xb7f39000, 79274)               = 0
> open("/dev/ttyS0", O_RDWR
> 
> ---
> 
> and nothing happens in the strace when I do a kill on this ttyctrl.

It seems like a kernel locks in not relaxed into the kernel...

> Hope this gives you some ideas.

What about kernel messages during these commands? Did you enabled
DEBUGging messages?

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at linux.it
Embedded Systems                     phone:	+39 349 2432127
UNIX programming                     skype:     rodolfo.giometti



More information about the LinuxPPS mailing list