[OmniOS-discuss] LX: real ksh93 broken

Dan McDonald danmcd at omniti.com
Thu May 11 14:15:13 UTC 2017


> On May 11, 2017, at 5:11 AM, Ludovic Orban <lorban at bitronix.be> wrote:
> 
> If my understanding of the LX code is correct, sysconf(_SC_CHILD_MAX) ends up being translated to lx_getrlimit() which would return the value of zone.max-lwps. Looks like an odd default to me, but I can't say for sure. Since I haven't configured any rctl on my lx zone, apparently the default is MAX_INT. I assume smartos uses a different default, but I wish I could double-check that.
> 
> Now, I'm not sure how this could or should be fixed.

What's REALLY weird is that our implementation of lx_getrlimit() is NO DIFFERENT from illumos-joyent's.  The ONLY differences in $SRC/uts/common/brand/lx/ are lint fixes on the OmniOS side, none of which go near lx_getrlimit().

I wonder if it's a function of which libc/glibc you have?  A quick way to find out is to run the attached D script, and then run the ulimit command to see how (and if) we get here and what happens.  Here's what I get, which yields MAX_INT:

bloody(~)[1]% bg
[1]    sudo /tmp/lx-rlimit-proc.d &
bloody(~)[0]% sudo zlogin lx1 ulimit -u
CPU FUNCTION                                 
  5  -> lx_getrlimit                          
2147483647
              libc.so.6`0x7ffffe2fc0a7

              lx_brand`lx_syscall_enter+0x16f
              unix`sys_syscall+0x145

  5   | lx_getrlimit:entry                    
  5    -> lx_getrlimit_common                 
  5    <- lx_getrlimit_common                 Returns 0x0
  5    -> get_udatamodel                      
  5    <- get_udatamodel                      Returns 0x200000
  5    -> copyout                             
  5    <- kcopy                               Returns 0x0
  5  <- lx_getrlimit                          Returns 0x0
bloody(~)[0]%   6  -> lx_getrlimit                          
              0x7ffffe6fc0a7

              lx_brand`lx_syscall_enter+0x16f
              unix`sys_syscall+0x145

  6   | lx_getrlimit:entry                    
  6    -> lx_getrlimit_common                 
  6    <- lx_getrlimit_common                 Returns 0x0
  6    -> get_udatamodel                      
  6    <- get_udatamodel                      Returns 0x200000
  6    -> copyout                             
  6    <- kcopy                               Returns 0x0
  6  <- lx_getrlimit                          Returns 0x0
  6  -> lx_getrlimit                          
              0x7ffffe6fc0a7

              lx_brand`lx_syscall_enter+0x16f
              unix`sys_syscall+0x145

  6   | lx_getrlimit:entry                    
  6    -> lx_getrlimit_common                 
  6    <- lx_getrlimit_common                 Returns 0x0
  6    -> get_udatamodel                      
  6    <- get_udatamodel                      Returns 0x200000
  6    -> copyout                             
  6    <- kcopy                               Returns 0x0
  6  <- lx_getrlimit                          Returns 0x0


I'd be interested in knowing what happens on the SmartOS box.  I also wonder if SmartOS launches the zone processes with lower limits already in place or not?

Dan





More information about the OmniOS-discuss mailing list