I'm seeing a rather odd hang with ksh 2014-06-06 on OS X 10.7.5 when using
the builtin cut and grep in a pipeline:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ type cut
cut is a shell builtin version of /usr/bin/cut
$ type grep
grep is a shell builtin version of /usr/bin/grep
$ cat pattern_file
x11 x12
$ cat file
x11
x21
$ cut -f 1 -d ' ' pattern_file | grep -Ff /dev/stdin file
...hang...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Using dtrace to get a stack trace of the ksh process during the hang reveals
the following:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ sudo dtruss -sp 7646
Password:
SYSCALL(args)            = return
mmap(0x1E0962C49000, 0x700800000, 0x3, 0x1002, 0xFFFFFFFF, 0x6)
  = 0x62C49000 0

              libsystem_kernel.dylib`__mmap+0xa
              ksh`_vmsegalloc+0x5b4
              ksh`bestpackextend+0x1fb
              ksh`bestpackalloc+0x379
              ksh`bestalloc+0x245
              ksh`bestresize+0x7d2
              ksh`_ast_realloc+0x117
              ksh`_sfexcept+0x3ff
              ksh`sfwr+0x75a
              ksh`_sfflsbuf+0x1b5
              ksh`sfputr+0x1f8
              ksh`addre+0x301
              ksh`compile+0x2fe
              ksh`grep+0xb0f
              ksh`b_grep+0x1d2
              ksh`sh_exec+0x2286
              ksh`sh_exec+0x467a
              ksh`sh_exec+0x53e8
              ksh`exfile+0xe5b
              ksh`sh_main+0x126a
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--
Nathan Weeks
IT Specialist
USDA-ARS Corn Insects and Crop Genetics Research Unit
Crop Genome Informatics Laboratory
Iowa State University
http://weeks.public.iastate.edu/
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to