Git Product home page Git Product logo

tritondatacenter / illumos-joyent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from illumos/illumos-gate

265.0 91.0 111.0 566.9 MB

Community developed and maintained version of the OS/Net consolidation

Home Page: http://www.illumos.org/projects/illumos-gate

Makefile 1.44% Shell 1.45% Perl 0.22% C 94.17% Awk 0.05% Scilab 0.18% C++ 0.44% RenderScript 0.01% DTrace 0.29% D 0.01% Java 0.31% Assembly 1.18% Logos 0.01% IGOR Pro 0.01% HTML 0.14% Python 0.05% PostScript 0.01% XS 0.01% SourcePawn 0.01% TeX 0.04%

illumos-joyent's Introduction

illumos-gate

This is the core illumos source tree.

Building

The illumos build must be run on an illumos-based operating system. See the Building illumos section of our documentation for detailed instructions.

Contributing

Code changes must be reviewed and tested. If you'd like to submit a change for inclusion in the project, please see the Contributing to illumos guide in our documentation.

Community

The illumos community is small but active. We welcome everybody who would like to use the software and participate in the community -- whether you've decades of experience in systems software, or you're just getting started; whether you work for a company that uses illumos, or you just find it personally interesting.

Our Community guide includes details about our Mailing Lists and IRC channels.

Code of Conduct

Participation in our community spaces, and in the project in general, are covered by our Code of Conduct. By participating in the project you agree to abide by its terms.

License

Most of the existing code is licensed under the CDDL and we expect new code will generally be under this license as well. Modifications of existing code may not alter the original license terms. Integrations of code from upstream sources that use another open source license are permissible, subject to approval of the advocates.

illumos-joyent's People

Contributors

ahrens avatar alhazred avatar andy-js avatar arekinath avatar bcantrill avatar bill-sommerfeld avatar citrus-it avatar danmcd avatar gdamore avatar grwilson avatar gwr avatar hrosenfeld avatar jasonbking avatar jclulow avatar jeffpc avatar jgmills avatar jjelinek avatar johnsonnenschein avatar joshwilsdon avatar mbarden avatar melloc avatar mtelka avatar pcd1193182 avatar pfmooney avatar ptribble avatar pyhalov avatar richlowe avatar rmustacc avatar rzezeski avatar tsoome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

illumos-joyent's Issues

unicorn doesn't work with lx zones

I'm trying to use the unicorn application server, which uses kgio under the covers. There are some odd issues with unix socket mode that I need to look into later, but the TCP socket mode (listen 3000) doesn't work at all.

When the workers come up i get this error: https://gist.github.com/bbhoss/05ef9ed5f0e725800701

Output of dtrace -n 'lx-syscall::accept*:return/execname == "ruby"/{ @[probefunc, arg1] = count(); }'

accept4                                                         -22            32670 

A snippet of dtrace -n 'lx-syscall::accept4:entry/execname == "ruby"/{ printf("%d, %d, %d, %d", arg0, arg1, arg2, arg3) }

 45  15048                    accept4:entry 9, 140737487300080, 140737487300076, 524288
 45  15048                    accept4:entry 9, 140737487300288, 140737487300284, 524288
 45  15048                    accept4:entry 9, 140737487300288, 140737487300284, 524288
 45  15048                    accept4:entry 9, 140737487300288, 140737487300284, 524288
 45  15048                    accept4:entry 9, 140737487300288, 140737487300284, 524288

I also ran the tests of kgio, and I got these failures. I'm unsure if they're related: https://gist.github.com/bbhoss/849b92199fc0bae5958a

Finally, I am seeing some odd issues with Puma as well, but haven't been able to investigate them yet. They may be related to this. When sending PUTs/POSTs, I get this: https://gist.github.com/bbhoss/cb260e0208c3707f962c

RT signal issue on LX

I recently had a user mention something about RT signals not working properly on the CentOS 6.6 LX zone. I'm not sure this user was actually making use of RT signals or if they really had any idea what they were talking about but it prompted me to run an old RT signal test of mine. Sure enough, I ran into two issues:

  1. The last two RT signals are considered invalid even though they are in range (63 & 64).
  2. None of the siginfo_t.si_value values are making it through.

Here is the code:

/*
 * The MIT License (MIT)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

/*
 * Copyright 2015 Ryan Zezeski
 */

/*
 * Inspired by both Stevens's rtsignals/test1 and Anton Salikhmetov's
 * 2007 LKML post.
 *
 * http://www.kohala.com/start/unpv22e/unpv22e.html
 * https://lkml.org/lkml/2007/7/10/517
 *
 */
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

/*
 * The seq struct and sh handler are used to record the order in which
 * the signals are delivered to the parent process.  When a signal is
 * delivered the handler records it in seq and then increments the
 * index.
 */
struct seq {
    int sig, num;
};

static struct seq *seqp;

void
sh(int sig, siginfo_t *info, void *unused)
{
    static int i = 0;
    seqp[i].num = info->si_value.sival_int;
    seqp[i++].sig = sig;
}

/*
 * Verify the delivery order of realtime (RT) signals.  RT signals were
 * introduced in POSIX.1b and differ from regular signals in several key
 * ways:
 *
 * 1. Multiple instances of the same signal are queued and must be
 * delivered in FIFO order.
 *
 * 2. If multiple different RT signals are pending then the lower numbered
 * RT signals are delivered first.  I.e., RT signals have a notion of
 * priority.
 *
 * See sections 2.4.2 (Realtime Signal Generation and Delivery) and B.2.4
 * of the POSIX.1-2008 standard for more information.
 */
int
main(int argc, char *argv[])
{
    int i, j, sig, sival, sigend, numsig, fail = 0;
    pid_t p = getpid(), chld;
    struct sigaction sa;
    sigset_t ss, ssold;
    union sigval sv;

    printf("verify delivery order of pending RT signals...\n");

    /*
     * Range of signals to send.  Each signal is sent 2 times to verify FIFO
     * order.
     */
    if ((SIGRTMIN + (sysconf(_SC_SIGQUEUE_MAX) / 2)) > SIGRTMAX) {
        sigend = SIGRTMAX;
        numsig = ((sigend - SIGRTMIN) + 1) * 2;
    } else {
        sigend = SIGRTMIN + (sysconf(_SC_SIGQUEUE_MAX) / 2) - 1;
        numsig = (sigend - SIGRTMIN) * 2;
    }

    seqp = malloc(sizeof (struct seq) * numsig);

    /*
     * Step 1:
     *
     * Install the signal handler (sh) on this process (the parent).
     */
    sigemptyset(&ss);
    for (i = SIGRTMIN; i <= sigend; i++) {
        sa.sa_sigaction = sh;
        sa.sa_flags = SA_SIGINFO;
        /*
         * Block all higher RT signals to enforce delivery
         * order.
         */
        sigemptyset(&sa.sa_mask);
        for (int k = 0; k <= sigend; k++) {
            sigaddset(&sa.sa_mask, k);
        }
        sigaction(i, &sa, NULL);
        sigaddset(&ss, i);
    }

    /*
     * Step 2:
     *
     * Block all signals that are about to be sent to this process.
     * This is needed to make sure all signals are pending at once.
     * This is related to step 4.
     */
    sigprocmask(SIG_BLOCK, &ss, &ssold);

    /*
     * Step 3:
     *
     * Fork a child process to send each RT signal 2 times to the
     * parent process.  Remember, all signals being sent are RT
     * signals and thus are subject to explicit ordering guarantees
     * spelled out in POSIX.1b.  Lower numbered RT signals are
     * _always_ delivered before higher RT signals.
     */
    if ((chld = fork()) == 0) {
        for (i = SIGRTMIN; i <= sigend; i++) {
            for (j = 0; j < 2; j++) {
                sv.sival_int = j;
                printf("sending signal %d with si_value %d\n",
                    i, j);
                if (sigqueue(p, i, sv) == -1) {
                    perror("problem generating signal");
                    exit(1);
                }
            }
        }
        exit(0);
    }

    /*
     * Step 4:
     *
     * Wait for forked process to finish sending all signals.  This is
     * to make sure that all signals are pending before allowing the
     * kernel to deliver them to the handler.  If you don't both wait
     * and block then the handler will process the signals as they
     * come in and thus we will not be testing the ordering
     * guarentees.  Related to step 2.
     */
    if (wait(NULL) != chld) {
        perror("problem waiting for child");
        exit(1);
    }
    sigprocmask(SIG_SETMASK, &ssold, NULL);

    /*
     * Step 5:
     *
     * Verify that multiple pending RT signals are delivered in
     * correct priority (lower signals first), and that multiple
     * instances of the same RT signal are delivered in FIFO order.
     *
     * E.g. if SIGRTMIN is 42 then the handler should record this
     * ordering:
     *
     * {42, 0}, {42, 1}, {42, 2}, {43, 0}, {43, 1}, {43, 2}, ...
     */
    sig = SIGRTMIN;
    sival = 0;
    for (i = 0; i < numsig; i++) {
        if ((seqp[i].sig != sig) || seqp[i].num != sival) {
            fail = 1;
        }
        sig = ((i + 1) % 2) == 0 ? sig + 1 : sig;
        sival = ((i + 1) % 2) == 0 ? 0 : sival + 1;
    }

    if (fail) {
        sig = SIGRTMIN;
        sival = 0;
        fprintf(stderr, "ERROR: incorrect order\n");
        fprintf(stderr, "Excpted Actual\n");
        for (i = 0; i < numsig; i++) {
            fprintf(stderr, "{%2d,%d}  {%2d,%d}\n",
                sig, sival, seqp[i].sig, seqp[i].num);

            sig = ((i + 1) % 2) == 0 ? sig + 1 : sig;
            sival = ((i + 1) % 2) == 0 ? 0 : sival + 1;
        }
        exit(1);
    }

    free(seqp);

    printf("PASSED\n");
    return (0);
}

Here is the output on CentOS 6.6 LX (a79dc83a-e3a7-11e4-bfe5-d3bb86399352) on Nahum's LX test platform build (20150509T194009Z):

# ./rt_sig_test
verify delivery order of pending RT signals...
sending signal 34 with si_value 0
sending signal 34 with si_value 1
sending signal 35 with si_value 0
sending signal 35 with si_value 1
sending signal 36 with si_value 0
sending signal 36 with si_value 1
sending signal 37 with si_value 0
sending signal 37 with si_value 1
sending signal 38 with si_value 0
sending signal 38 with si_value 1
sending signal 39 with si_value 0
sending signal 39 with si_value 1
sending signal 40 with si_value 0
sending signal 40 with si_value 1
sending signal 41 with si_value 0
sending signal 41 with si_value 1
sending signal 42 with si_value 0
sending signal 42 with si_value 1
sending signal 43 with si_value 0
sending signal 43 with si_value 1
sending signal 44 with si_value 0
sending signal 44 with si_value 1
sending signal 45 with si_value 0
sending signal 45 with si_value 1
sending signal 46 with si_value 0
sending signal 46 with si_value 1
sending signal 47 with si_value 0
sending signal 47 with si_value 1
sending signal 48 with si_value 0
sending signal 48 with si_value 1
sending signal 49 with si_value 0
sending signal 49 with si_value 1
sending signal 50 with si_value 0
sending signal 50 with si_value 1
sending signal 51 with si_value 0
sending signal 51 with si_value 1
sending signal 52 with si_value 0
sending signal 52 with si_value 1
sending signal 53 with si_value 0
sending signal 53 with si_value 1
sending signal 54 with si_value 0
sending signal 54 with si_value 1
sending signal 55 with si_value 0
sending signal 55 with si_value 1
sending signal 56 with si_value 0
sending signal 56 with si_value 1
sending signal 57 with si_value 0
sending signal 57 with si_value 1
sending signal 58 with si_value 0
sending signal 58 with si_value 1
sending signal 59 with si_value 0
sending signal 59 with si_value 1
sending signal 60 with si_value 0
sending signal 60 with si_value 1
sending signal 61 with si_value 0
sending signal 61 with si_value 1
sending signal 62 with si_value 0
sending signal 62 with si_value 1
sending signal 63 with si_value 0
problem generating signal: Invalid argument
ERROR: incorrect order
Excpted Actual
{34,0}  {34,0}
{34,1}  {34,0}
{35,0}  {35,0}
{35,1}  {35,0}
{36,0}  {36,0}
{36,1}  {36,0}
{37,0}  {37,0}
{37,1}  {37,0}
{38,0}  {38,0}
{38,1}  {38,0}
{39,0}  {39,0}
{39,1}  {39,0}
{40,0}  {40,0}
{40,1}  {40,0}
{41,0}  {41,0}
{41,1}  {41,0}
{42,0}  {42,0}
{42,1}  {42,0}
{43,0}  {43,0}
{43,1}  {43,0}
{44,0}  {44,0}
{44,1}  {44,0}
{45,0}  {45,0}
{45,1}  {45,0}
{46,0}  {46,0}
{46,1}  {46,0}
{47,0}  {47,0}
{47,1}  {47,0}
{48,0}  {48,0}
{48,1}  {48,0}
{49,0}  {49,0}
{49,1}  {49,0}
{50,0}  {50,0}
{50,1}  {50,0}
{51,0}  {51,0}
{51,1}  {51,0}
{52,0}  {52,0}
{52,1}  {52,0}
{53,0}  {53,0}
{53,1}  {53,0}
{54,0}  {54,0}
{54,1}  {54,0}
{55,0}  {55,0}
{55,1}  {55,0}
{56,0}  {56,0}
{56,1}  {56,0}
{57,0}  {57,0}
{57,1}  {57,0}
{58,0}  {58,0}
{58,1}  {58,0}
{59,0}  {59,0}
{59,1}  {59,0}
{60,0}  {60,0}
{60,1}  {60,0}
{61,0}  {61,0}
{61,1}  {61,0}
{62,0}  {62,0}
{62,1}  {62,0}
{63,0}  { 0,0}
{63,1}  { 0,0}
{64,0}  { 0,0}
{64,1}  { 0,0}

[lx] Assertion failed: ucp != NULL

Assertion failed: ucp != NULL, file ../common/lx_brand.c, line 793

I found a test which trips this assert often. The
conformance/interfaces/pthread_join/6-3 test of the Open POSIX
TestSuite
which involves threads and signals.

I ran this test via the Autotest framework but it might take less
time to directly use posixtest. Here are the steps for running via
autotest:

# yum -y install git gcc tar patch gdb
# git clone --recursive git://github.com/autotest/autotest.git
# cd autotest
# ./client/autotest-local run posixtest

...wait a while, lots of tests run and may take an hour...

# cd client/tmp/posixtest/src
# ./t0 240 conformance/interfaces/pthread_join/6-3.test

lx-brand: jemalloc test cores (maybe related to OS-3711: lxbrand plex dying in jemalloc)

Took some time to dig into this too. Not sure if this is related but might be worth looking at:

joyent_20150219T102159Z

image_uuid": "14a960b0-614e-11e4-a095-eb789315ae39

configure --enable-debug

make check

test/unit/junk
test_junk_small: pass
test_junk_large: pass
: src/chunk.c:132: Failed assertion: "p[i] == 0"
Aborted (core dumped)
Test harness error

stack
LMfdlibc.so.1syscall+0x30()
LMfdlx_brand.so.1lx_emulate+0x17c(7fffffefef30)
LMfdlx_brand.so.1lx_handler+0xa0()
libc.so.6gsignal+0x39() jet_chunk_alloc+0x198() jet_huge_palloc+0x8c() jet_huge_malloc+0x2b() jet_imalloct+0x83() imallocx+0xd2() jet_mallocx+0x2de() test_junk+0x77() test_junk_huge+0x61() p_test+0xad() main+0x2e() libc.so.6__libc_start_main+0xf5()

does not happen with non debug build. So could be an error in the debug code too.
On a "normal" ubuntu tests do pass though with --enable-debug.

SIOCGIFINDEX seems to be missing,

SIOCGIFINDEX seems to be missing, some app that try to enum interfaces seems to choke on this.

It could be related to some of the 'ioctl 0x8933' message I see with lxunsup.d

Want shared mem support

x11vnc and gimp (probably others) want shared mem support. Some like x11vnc can have it disabled. Gimp is unable to open a jpg file without it :(

root@lxubuntu64:~# gimp
Failed to execute child process "dbus-launch" (No such file or directory)
//bin/dbus-launch terminated abnormally without any error message

(script-fu:93556): LibGimp-ERROR **: shmat() failed: Invalid argument
Could not attach to gimp shared memory segment
GIMP-Error: Plug-in crashed: "script-fu"
(/usr/lib/gimp/2.0/plug-ins/script-fu)

The dying plug-in may have messed up GIMP's internal state. You may want to save your images and restart GIMP to be on the safe side.


(file-jpeg:93560): LibGimp-ERROR **: shmat() failed: Invalid argument
Could not attach to gimp shared memory segment

(file-jpeg:93561): LibGimp-ERROR **: shmat() failed: Invalid argument
Could not attach to gimp shared memory segment

(file-jpeg:93563): LibGimp-ERROR **: shmat() failed: Invalid argument
Could not attach to gimp shared memory segment

Here is a truss of gimp trying to open a jpg file. http://sjorge.sinners.be/joyent/gimp.truss.bz2

[lx brand] prelink(8) causes SEGV

Running prelink(8) on a binary may cause it to segfault on LX. I
encountered this when converting a baremetal CentOS 6.5 instance into
an LX zone. I noticed that running ldd /bin/ls crashed with a
segfault. The segfault happens early in the runtime, after the AS has
been setup and the first time that LX jumps into linux userland.

Below is a minimal reproducer on Joyent's official CentOS 6.6 LX image:

# ldd /bin/ls
        lx_vdso.so.1 =>  (0x00007fffff270000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003e70a00000)
        librt.so.1 => /lib64/librt.so.1 (0x0000003e6fe00000)
        libcap.so.2 => /lib64/libcap.so.2 (0x0000003e76a00000)
        libacl.so.1 => /lib64/libacl.so.1 (0x0000003e74e00000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003e6f200000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003e6f600000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fffff200000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e6fa00000)
# yum install prelink
# objdump -h /lib64/ld-2.12.so | grep prelink
# prelink /lib64/ld-2.12.so
# objdump -h /lib64/ld-2.12.so | grep prelink
 26 .gnu.prelink_undo 00000908  0000000000000000  0000000000000000  00025360  2**3
# ldd /bin/ls
ldd: exited with unknown exit code (139)

Here is truss output of ld after it has been prelink'd.

# /native/usr/bin/truss /lib64/ld-2.12.so --verify /bin/ls
execve("/lib64/ld-2.12.so", 0x7FFFFFEFF638, 0x7FFFFFEFF658)  argc = 3
sysinfo(SI_MACHINE, "i86pc", 257)       = 6
mmap(0x00000000, 56, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF440000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF410000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF400000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF3F0000
memcntl(0x7FFFFF44E000, 96976, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF3E0000
memcntl(0x7FFFFF4B6000, 74816, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
resolvepath("/native/lib/64/ld.so.1", "/native/lib/amd64/ld.so.1", 1023) = 25
resolvepath("/native/usr/lib/amd64/lx_brand.so.1", "/native/usr/lib/amd64/lx_brand.so.1", 1023) = 35
stat("/native/usr/lib/amd64/lx_brand.so.1", 0x7FFFFFEFF310) = 0
open("/var/ld/64/ld.config", O_RDONLY)      = 3
fstat(3, 0x7FFFFFEFF070)            = 0
mmap(0x00000000, 188, PROT_READ, MAP_SHARED, 3, 0) = 0x7FFFFF3D0000
close(3)                    = 0
stat("/native/lib/64/libc.so.1", 0x7FFFFFEFEA00) = 0
resolvepath("/native/lib/64/libc.so.1", "/native/lib/amd64/libc.so.1", 1023) = 27
open("/native/lib/64/libc.so.1", O_RDONLY)  = 3
mmapobj(3, MMOBJ_INTERPRET, 0x7FFFFF3E0C68, 0x7FFFFFEFE55C, 0x00000000) = 0
close(3)                    = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF1F0000
memcntl(0x7FFFFF230000, 465608, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
stat("/native/lib/64/libmapmalloc.so.1", 0x7FFFFFEFEA00) Err#2 ENOENT
stat("/native/usr/lib/64/libmapmalloc.so.1", 0x7FFFFFEFEA00) = 0
resolvepath("/native/usr/lib/64/libmapmalloc.so.1", "/native/usr/lib/amd64/libmapmalloc.so.1", 1023) = 39
open("/native/usr/lib/64/libmapmalloc.so.1", O_RDONLY) = 3
mmapobj(3, MMOBJ_INTERPRET, 0x7FFFFF1F0B88, 0x7FFFFFEFE55C, 0x00000000) = 0
close(3)                    = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF1C0000
memcntl(0x7FFFFF1D0000, 5056, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
stat("/native/lib/64/librpcsvc.so.1", 0x7FFFFFEFE4E0) = 0
resolvepath("/native/lib/64/librpcsvc.so.1", "/native/lib/amd64/librpcsvc.so.1", 1023) = 32
open("/native/lib/64/librpcsvc.so.1", O_RDONLY) = 3
mmapobj(3, MMOBJ_INTERPRET, 0x7FFFFF1F0D38, 0x7FFFFFEFE03C, 0x00000000) = 0
close(3)                    = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF190000
memcntl(0x7FFFFF1A0000, 17680, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
stat("/native/lib/64/libnsl.so.1", 0x7FFFFFEFE4E0) = 0
resolvepath("/native/lib/64/libnsl.so.1", "/native/lib/amd64/libnsl.so.1", 1023) = 29
open("/native/lib/64/libnsl.so.1", O_RDONLY)    = 3
mmapobj(3, MMOBJ_INTERPRET, 0x7FFFFF190B30, 0x7FFFFFEFE03C, 0x00000000) = 0
close(3)                    = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF0D0000
memcntl(0x7FFFFF0E0000, 170816, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0x7FFFFF0C0000
getcontext(0x7FFFFFEFED60)
getrlimit(RLIMIT_STACK, 0x7FFFFFEFF0C0)     = 0
getpid()                    = 44359 [44357]
lwp_private(0, 0, 0x7FFFFF0C2A40)       = 0x00000000
setustack(0x7FFFFF0C2AE8)
lwp_cond_broadcast(0x7FFFFF1F01A8)      = 0
lwp_cond_broadcast(0x7FFFFF1C01A8)      = 0
sigfillset(0x7FFFFF3C9480)          = 0
lwp_cond_broadcast(0x7FFFFF0D01A8)      = 0
lwp_cond_broadcast(0x7FFFFF1901A8)      = 0
lwp_cond_broadcast(0x7FFFFF3E01A8)      = 0
sysconfig(_CONFIG_PAGESIZE)         = 4096
fcntl(0, F_DUPFD, 0x00000000)           = 3
lseek(0, 0, SEEK_CUR)               = 17710
close(0)                    = 0
fcntl(3, F_DUP2FD, 0x00000000)          = 0
close(3)                    = 0
fcntl(1, F_DUPFD, 0x00000000)           = 3
close(1)                    = 0
fcntl(3, F_DUP2FD, 0x00000001)          = 1
close(3)                    = 0
fcntl(2, F_DUPFD, 0x00000000)           = 3
close(2)                    = 0
fcntl(3, F_DUP2FD, 0x00000002)          = 2
close(3)                    = 0
zone_lookup(0x00000000)             = 50
zone_getattr(50, 32768, 0x7FFFFF4FED40, 16) = 16
brand(1, 0x7FFFFFEFF5A0, 0x00000000, 0x0000000A, 0x00006F73, 0x00000000) = 0
brand(128, 0x00000001, 0x7FFFFFEFF4EC, 0x7FFFFFEFF4E8, 0x00000000, 0x00000000) = 0
uucopy(0x7FFFFFEFF4EC, 0x7FFFFF4FED54, 4)   = 0
uucopy(0x7FFFFFEFF4E8, 0x7FFFFFEFF54C, 4)   = 0
brand(3, 0x7FFFFFEFF570, 0x7FFFFFEFF4E8, 0x00000000, 0x00000000, 0x00000000) = 0
modctl(MODGETMAJBIND, 0x7FFFFF4E72BD, 0x00000003, 0x7FFFFFEFF52C, 0x00000000) = 0
stat("/dev/null", 0x7FFFFFEFF4A0)       = 0
stat("/dev/zero", 0x7FFFFFEFF4A0)       = 0
modctl(MODGETMAJBIND, 0x7FFFFF4E7293, 0x00000007, 0x7FFFFFEFF52C, 0x7FFFFFEFF4A0) = 0
stat("/dev/random", 0x7FFFFFEFF4A0)     = 0
stat("/dev/urandom", 0x7FFFFFEFF4A0)        = 0
modctl(MODGETMAJBIND, 0x7FFFFF4E72C0, 0x00000003, 0x7FFFFFEFF52C, 0x7FFFFFEFF4A0) = 0
stat("/dev/tty", 0x7FFFFFEFF4A0)        = 0
modctl(MODGETMAJBIND, 0x7FFFFF4E72C3, 0x00000006, 0x7FFFFFEFF52C, 0x7FFFFFEFF4A0) = 0
stat("/dev/console", 0x7FFFFFEFF4A0)        = 0
modctl(MODGETMAJBIND, 0x7FFFFF4E72C9, 0x00000009, 0x7FFFFFEFF52C, 0x7FFFFFEFF4A0) = 0
modctl(MODGETMAJBIND, 0x7FFFFF4E72D2, 0x00000007, 0x7FFFFFEFF52C, 0x7FFFFFEFF4A0) = 0
modctl(MODGETMAJBIND, 0x7FFFFF4E72DE, 0x00000004, 0x7FFFFFEFF52C, 0x7FFFFFEFF4A0) = 0
open("/native/usr/lib/brand/lx/amd64/lx_vdso.so.1", O_RDONLY) = 3
mmapobj(3, MMOBJ_INTERPRET, 0x7FFFFFEFF3B0, 0x7FFFFFEFF54C, 0x00000000) = 0
close(3)                    = 0
schedctl()                  = 0x7FFFFF0A2000
lwp_sigmask(SIG_SETMASK, 0xFFBFFEFF, 0xFFFFFFF7, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGWAITING, 0x7FFFFFEFF3E0, 0x00000000) = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFFF7, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGLWP, 0x7FFFFFEFF3E0, 0x00000000)   = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFFF6, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGFREEZE, 0x7FFFFFEFF3E0, 0x00000000) = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFFF4, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGTHAW, 0x7FFFFFEFF3E0, 0x00000000)  = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFFF0, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGCANCEL, 0x7FFFFFEFF3E0, 0x00000000) = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFFF0, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGLOST, 0x7FFFFFEFF3E0, 0x00000000)  = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFFE0, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGXRES, 0x7FFFFFEFF3E0, 0x00000000)  = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFFC0, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGJVM1, 0x7FFFFFEFF3E0, 0x00000000)  = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFF80, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGJVM2, 0x7FFFFFEFF3E0, 0x00000000)  = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFF00, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGINFO, 0x7FFFFFEFF3E0, 0x00000000)  = 0
lwp_sigmask(SIG_SETMASK, 0x7FBFFEFF, 0xFFFFFE00, 0x000001FF, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
sigaction(SIGHUP, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGINT, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGQUIT, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGILL, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGTRAP, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGABRT, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGBUS, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGFPE, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGKILL, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGUSR1, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGSEGV, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGUSR2, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGPIPE, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGALRM, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGTERM, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGEMT, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGCLD, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGCONT, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGSTOP, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGTSTP, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGTTIN, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGTTOU, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGURG, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGXCPU, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGXFSZ, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGVTALRM, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGPROF, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGWINCH, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGPOLL, 0x00000000, 0x7FFFFFEFF4F0)  = 0
sigaction(SIGPWR, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGSYS, 0x00000000, 0x7FFFFFEFF4F0)   = 0
sigaction(SIGRTMIN, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+1, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+2, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+3, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+4, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+5, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+6, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+7, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+8, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+9, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+10, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+11, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+12, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+13, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+14, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMIN+15, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-15, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-14, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-13, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-12, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-11, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-10, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-9, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-8, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-7, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-6, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-5, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-4, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-3, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-2, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX-1, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGRTMAX, 0x00000000, 0x7FFFFFEFF4F0) = 0
sigaction(SIGPWR, 0x7FFFFFEFF440, 0x00000000)   = 0
lwp_sigmask(SIG_SETMASK, 0x00000000, 0x00000000, 0x00000000, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF0A0000
getcontext(0x7FFFFF0A0040)
sysconfig(_CONFIG_STACK_PROT)           = 3
mmap(0x00000000, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON, 4294967295, 0) = 0x7FFFFF05F000
brand(147, 0x7FFFFF09F000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) = 0
getcontext(0x7FFFFFEFF1F0)
brand(139, 0x7FFFFFEFF1F0, 0x00000000, 0x00000000, 0x00000000, 0x7FFFFF200B00) = 0
    Incurred fault #6, FLTBOUNDS  %pc = 0x7FFFFF203C99
      siginfo: SIGSEGV SEGV_MAPERR addr=0x7FCFFF200040
    Received signal #11, SIGSEGV [default]
      siginfo: SIGSEGV SEGV_MAPERR addr=0x7FCFFF200040

logadm man page missing `-F`

I was attempting to debug TritonDataCenter/smartos-live#319 (OS-3097) and started looking into logadm code and documentation. It seems that the only brief mention of -F is in the help page.


Some background (from IRC):

Unfortunately, it looks like -F falls into the brief window where we had source code updates, but not manual page updates.
Back at Sun/Oracle, the manual pages weren't kept inside the main OS repo, so it was possible for them to get out of date, and there are a few things like this that are in that category.

[lx] pthread_once() and thread cancellation

When two threads invoke pthread_once() on the same control variable
and the thread that wins is asynchronously canceled it will cause the
other to deadlock waiting for a wake call. This can be reproduced by
the conformance/interfaces/pthread_once/3-1.test test from the Open
POSIX Test Suite
.

wget 'http://downloads.sourceforge.net/project/posixtest/posixtest/posixtestsuite-1.5.2/posixtestsuite-1.5.2.tar.gz'
tar zxvf posixtestsuite-1.5.2.tar.gz
cd posixtestsuite
make LDFLAGS="-lpthread" conformance/interfaces/pthread_once/3-1.test
./conformance/interfaces/pthread_once/3-1.test

This test fails on both CentOS 6.6 and Ubuntu 14.04 lx zones, but
passes on KVM Linux and a native SmartOS zone (with some code
modifications around PTHREAD_ONCE_INIT). If you look at the glibc
code used by CentOS and Ubuntu (Ubuntu actually uses eglibc but the
code around pthread_once() is the same I think) you will notice that
a) there is a comment about thread cancellation and b) compared to
the latest
glibc it is missing a pthread_cleanup_push() to
clear_once_control(). However, there is an asm file
(nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S) which seems to
perform the proper cleanup and would explain why KVM Linux works.
Unfortunately I'm still an asm noob and am not sure how to debug this
further, but I'm happy to try anything that might help.

lx-brand: dataset's not mounted

I added a delegated dataset to a lx branded zone.
They do not seem to get mounted!

I can use /native/usr/sbin/zfs to create a few datasets

/native/usr/sbin/zfs create -o mountpoint=/srv/www zones/`/native/usr/bin/zonename`/data/www
/native/usr/sbin/zfs create -o mountpoint=/home -o canmount=no zones/`/native/usr/bin/zonename`/data/homes
/native/usr/sbin/zfs create -o quota=5G zones/`/native/usr/bin/zonename`/data/homes/sjorge

If you do this on a native zone, the stuff shows up under /srv/www, /home/sjorge,...

Manually running /native/usr/sbin/zfs mount -a seems mounts the stuff. But it is needed every reboot.
/etc/mtab reflects this, however linux mount does not.

Some more integration for this would be awesome. Perhaps lxinit can take care of this?

[lxbrand] /run/lock missing makes programs complain

In usr/src/lib/brand/lx/zone/lx_boot_zone_ubuntu.ksh at line 183 a tmpfs is mounted on /run.
Some of the required dirs are created e.g. in setup_net.

We should also create /run/lock. .e.g of effect programs: aptitude

I think this should be rather trivial to fix :)

Zlogin <UUID> Error

Hello
I am trying to login by zlogin cmd in smartOS , but it's raising me error

zlogin 20b8c32c-b800-4651-97bf-d99a7e4491b3

[Connected to zone '20b8c32c-b800-4651-97bf-d99a7e4491b3' pts/3]
zlogin: makeutx failed

[Connection to zone '20b8c32c-b800-4651-97bf-d99a7e4491b3' pts/3 closed]

How can we resolve it

[lx-brand] intra-process limit on lx_sched_affinity()

The intra-process limit on lx_sched_affinity() breaks tools like taskset(1).

# taskset -p 65010
sched_getaffinity: Operation not permitted
failed to get pid 65010's affinity

https://github.com/joyent/illumos-joyent/blob/master/usr/src/uts/common/brand/lx/syscall/lx_sched.c#L88

Furthermore, the sched_getaffinity(2) manual seems to indicate that EPERM only applies to sched_setaffinity(2). Even if it applies to get as well it should only be set if the user IDs don't match.

       EPERM  (sched_setaffinity())  The  calling process does not have appropriate privileges.  The caller needs an effective user ID equal to
              the user ID or effective user ID of the process identified by pid, or it must possess the CAP_SYS_NICE capability.

lx-brand: procfs unimplemented /proc/#/comm

root@trinity:~# dpkg -i plexmediaserver_0.9.12.2.1124-e797a3e_amd64.deb
Selecting previously unselected package plexmediaserver.
(Reading database ... 18097 files and directories currently installed.)
Preparing to unpack plexmediaserver_0.9.12.2.1124-e797a3e_amd64.deb ...
Unpacking plexmediaserver (0.9.12.2.1124-e797a3e) ...
Setting up plexmediaserver (0.9.12.2.1124-e797a3e) ...
OK
cat: /proc/1/comm: No such file or directory
plexmediaserver start/running, process 40066
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for mime-support (3.54ubuntu1) ...
root@trinity:~# find /proc -name comm

BAD TRAP: type=e (#pf Page fault) rp=ffffff001552f980 addr=8 occurred in module "genunix" due to a NULL pointer dereference

BAD TRAP: type=e (#pf Page fault) rp=ffffff001552f980 addr=8 occurred in module "genunix" due to a NULL pointer dereference

imgadm:

pf Page fault

Bad kernel fault at addr=0x8
pid=54973, pc=0xfffffffffba3a955, sp=0xffffff001552fa70, eflags=0x10282
cr0: 8005003b<pg,wp,ne,et,ts,mp,pe> cr4: 426b8<osxsav,vmxe,xmme,fxsr,pge,pae,pse,de>
cr2: 8
cr3: 23c6db000
cr8: 0

    rdi: ffffff02fd6947c0 rsi: ffffff031f160080 rdx: ffffff02fd6947d0
    rcx: ffffff02fd6947d0  r8:          2840000  r9:             21f0
    rax:                0 rbx: ffffff02fd6947c0 rbp: ffffff001552fa80
    r10:                1 r11:                1 r12:               18
    r13: ffffff031f160080 r14: ffffff02d90a8800 r15: ffffff02efcabb68
    fsb:                0 gsb: ffffff02d6aa8540  ds:               4b
     es:               4b  fs:                0  gs:              1c3
    trp:                e err:                2 rip: fffffffffba3a955
     cs:               30 rfl:            10282 rsp: ffffff001552fa70
     ss:               38

ffffff001552f860 unix:die+df ()
ffffff001552f970 unix:trap+df3 ()
ffffff001552f980 unix:cmntrap+e6 ()
ffffff001552fa80 genunix:list_remove+25 ()
ffffff001552fac0 zfs:dsl_dir_tempreserve_clear+79 ()
ffffff001552fb00 zfs:dmu_tx_commit+ba ()
ffffff001552fd10 zfs:zfs_write+91a ()
ffffff001552fdb0 genunix:fop_write+8b ()
ffffff001552fe80 genunix:write+250 ()
ffffff001552feb0 genunix:write32+1e ()
ffffff001552ff10 unix:brand_sys_sysenter+1d3 ()

syncing file systems...

Maybe it's already clear without dump. (Probably not)
Will upload asap. But will take a while.

Platform joyent_20150330T233217Z

[lx] SNMP + UDP wants IP_PKTINFO

Summary

SNMP wants IP_PKTINFO when running over UDP. This is decided at
compile-time, there is no way to disable at runtime besides running
over a different protocol.

Steps to Reproduce

# yum -y install net-snmp net-snmp-utils
# service snmpd start
Starting snmpd: Error opening specified endpoint ""
Server Exiting with code 1
                                                           [FAILED]

Run with debug and you'll see that it fails setting IP_PKTINFO
against the udp domain so it falls back to udp6 which then fails
for a different reason.

# snmpd -D -LS0-6d -LE0-7 -p /var/run/snmpd.pid
...
netsnmp_udp: couldn't set IP_PKTINFO: Protocol not available

Workaround

Other transports, like TCP, work just fine.

panic in fop_getattr()

The following will leak anonymous memory causing the machine to eventually become unresponsive:

include <stdio.h>

include <sys/inotify.h>

int main()
{
while (close(inotify_init()) == 0) ;
}

while this test-code is running, "vmstat 1" shows a steady loss of free memory. Even after terminating the test, we see no recovery of free memory.

My colleague Youzhong noted that the vmem_create() on line 1081 of https://github.com/joyent/illumos-joyent/blob/master/usr/src/uts/common/io/inotify.c needs a complementary vmem_destroy() in the inotify_detach() routine.

We’re in the process of testing and verifying this.

Thanks,
-Ken & Youzhong

lx-brand: fuse emulation?

Probably going to be too much work, but a lot of things use fuse on linux.
Lot of crypto stuff, opening exotic containers,... would be nice to have.

But it's not super important.

lx: working nfs or cifs mounting (native or linux)

I've been battling this for a while now but I don't think it can be fixed without lots of bootstrapping somewhere.

Trying to use native mount_smbfs and nfs client deamons need to run, /etc/netconfig needs to exit (no problem, even prepended /dev/udp,... with /native... but the code still tries to use /dev/udp.

Also somehow the stuff is not well chrooted and wants a lot of stuff from etc.

Here is a truss output from a system where /etc/netconfig exists and smbiod-svc is running:

execve("/native/usr/lib/fs/smbfs/mount", 0x08047718, 0x08047730)  argc = 5
sysinfo(SI_MACHINE, "i86pc", 257)               = 6
mmap(0x00000000, 32, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFB0000
sysconfig(_CONFIG_PAGESIZE)                     = 4096
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFA0000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEF90000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEF80000
memcntl(0xFEFB5000, 48924, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
memcntl(0x08050000, 5340, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
resolvepath("/lib/ld.so.1", 0x0804702C, 1023)   Err#2 ENOENT
resolvepath("/native/usr/lib/fs/smbfs/mount", "/native/usr/lib/fs/smbfs/mount", 1023) = 30
stat64("/native/usr/lib/fs/smbfs/mount", 0x080473AC) = 0
open("/var/ld/ld.config", O_RDONLY)             = 3
fstat64(3, 0x08046F2C)                          = 0
mmap(0x00000000, 168, PROT_READ, MAP_SHARED, 3, 0) = 0xFEF70000
close(3)                                        = 0
stat64("/native/lib/libc.so.1", 0x08046BCC)     = 0
resolvepath("/native/lib/libc.so.1", "/native/lib/libc.so.1", 1023) = 21
open("/native/lib/libc.so.1", O_RDONLY)         = 3
mmapobj(3, MMOBJ_INTERPRET, 0xFEF80B70, 0x08046C38, 0x00000000) = 0
close(3)                                        = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEE00000
memcntl(0xFEE10000, 254204, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
stat64("/native/lib/libsmbfs.so.1", 0x080468FC) Err#2 ENOENT
stat64("/native/usr/lib/libsmbfs.so.1", 0x080468FC) = 0
resolvepath("/native/usr/lib/libsmbfs.so.1", "/native/usr/lib/libsmbfs.so.1", 1023) = 29
open("/native/usr/lib/libsmbfs.so.1", O_RDONLY) = 3
mmapobj(3, MMOBJ_INTERPRET, 0xFEE007C8, 0x08046968, 0x00000000) = 0
close(3)                                        = 0
memcntl(0xFEDD0000, 25924, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEDC0000
getcontext(0x080471EC)
getrlimit(RLIMIT_STACK, 0x080471E4)             = 0
getpid()                                        = 5788 [5787]
lwp_private(0, 1, 0xFEDC2A40)                   = 0x000001C3
setustack(0xFEDC2AA0)
lwp_cond_broadcast(0xFEE000FC)                  = 0
lwp_cond_broadcast(0xFEE009AC)                  = 0
lwp_cond_broadcast(0xFEF8062C)                  = 0
sysi86(SI86FPSTART, 0xFEF64E4C, 0x0000133F, 0x00001F80) = 0x00000001
sysconfig(_CONFIG_PAGESIZE)                     = 4096
open("/usr/lib/locale//en_US.UTF-8/LC_CTYPE/LCL_DATA", O_RDONLY) Err#2 ENOENT
brk(0x08064380)                                 = 0
brk(0x08066380)                                 = 0
getuid()                                        = 0 [0]
getuid()                                        = 0 [0]
open("/usr/lib/locale//en_US.UTF-8/LC_CTYPE/LCL_DATA", O_RDONLY) Err#2 ENOENT
ioctl(1, TCGETA, 0x0804667E)                    = 0
fstat64(1, 0x080465C0)                          = 0
write(1, " c a n ' t   s e t   l o".., 20)      = 20
getuid()                                        = 0 [0]
getuid()                                        = 0 [0]
getpid()                                        = 5788 [5787]
open("/proc/5788/psinfo", O_RDONLY)             Err#2 ENOENT
mmap(0x00010000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEDA0000
getuid()                                        = 0 [0]
getuid()                                        = 0 [0]
open64("/var/run/name_service_door", O_RDONLY)  Err#2 ENOENT
open("/etc/nsswitch.conf", O_RDONLY)            = 3
fstat64(3, 0x08046AD0)                          = 0
fstat64(3, 0x080469D0)                          = 0
ioctl(3, TCGETA, 0x08046A8E)                    Err#25 ENOTTY
read(3, " #\n #   / e t c / n s s".., 2048)     = 1688
mmap(0x00010000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFED80000
read(3, 0x08065AEC, 2048)                       = 0
llseek(3, 0, SEEK_CUR)                          = 1688
close(3)                                        = 0
stat64("/native/lib/nss_files.so.1", 0x08046680) = 0
resolvepath("/native/lib/nss_files.so.1", "/native/lib/nss_files.so.1", 1023) = 26
open("/native/lib/nss_files.so.1", O_RDONLY)    = 3
mmapobj(3, MMOBJ_INTERPRET, 0xFEFFDE40, 0x080466EC, 0x00000000) = 0
close(3)                                        = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFED70000
memcntl(0xFE9A0000, 10624, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
lwp_cond_broadcast(0xFED700FC)                  = 0
brk(0x08066380)                                 = 0
brk(0x08068380)                                 = 0
open("/etc/passwd", O_RDONLY)                   = 3
fstat64(3, 0x08046D50)                          = 0
fstat64(3, 0x08046C50)                          = 0
ioctl(3, TCGETA, 0x08046D0E)                    Err#25 ENOTTY
read(3, " r o o t : x : 0 : 0 : r".., 1024)     = 929
llseek(3, 0xFFFFFFFFFFFFFC7F, SEEK_CUR)         = 32
close(3)                                        = 0
access("/usr/bin/sh", X_OK)                     Err#2 ENOENT
open("/dev/null", O_RDWR)                       = 3
fcntl(3, F_GETFD, 0xFED70100)                   = 0
pipe([4,5], 0)                                  = 0
access("/usr/bin/sh", X_OK)                     Err#2 ENOENT
lwp_sigmask(SIG_SETMASK, 0xFFBFFEFF, 0xFFFFFFFF, 0x000001FF, 0x00000000) = 0x00000000 [0x00000000]
vforkx(FORK_NOSIGCHLD|FORK_WAITPID)             = 5790
lwp_sigmask(SIG_SETMASK, 0x00000000, 0x00000000, 0x00000000, 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
close(5)                                        = 0
fcntl(4, F_DUP2FD, 0x00000003)                  = 3
close(4)                                        = 0
fstat64(3, 0x08046720)                          = 0
fstat64(3, 0x08046620)                          = 0
ioctl(3, TCGETA, 0x080466DE)                    Err#22 EINVAL
read(3, 0x080664F4, 5120)                       = 0
open("/root/.nsmbrc", O_RDONLY)                 Err#2 ENOENT
llseek(3, 0, SEEK_CUR)                          Err#29 ESPIPE
close(3)                                        = 0
resolvepath("/mnt/movies", "/mnt/movies", 1024) = 11
stat("/mnt/movies", 0x08047634)                 = 0
getuid()                                        = 0 [0]
getgid()                                        = 0 [0]
stat64("/native/lib/libsocket.so.1", 0x08046AA8) = 0
resolvepath("/native/lib/libsocket.so.1", "/native/lib/libsocket.so.1", 1023) = 26
open("/native/lib/libsocket.so.1", O_RDONLY)    = 3
mmapobj(3, MMOBJ_INTERPRET, 0xFED70740, 0x08046B14, 0x00000000) = 0
close(3)                                        = 0
memcntl(0xFED50000, 17428, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
stat64("/native/lib/libnsl.so.1", 0x08046738)   = 0
resolvepath("/native/lib/libnsl.so.1", "/native/lib/libnsl.so.1", 1023) = 23
open("/native/lib/libnsl.so.1", O_RDONLY)       = 3
mmapobj(3, MMOBJ_INTERPRET, 0xFED70DF8, 0x080467A4, 0x00000000) = 0
close(3)                                        = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFED40000
memcntl(0xFEB10000, 78456, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
sigfillset(0xFEF643A0)                          = 0
lwp_cond_broadcast(0xFED400FC)                  = 0
lwp_cond_broadcast(0xFED70924)                  = 0
open("/etc/netconfig", O_RDONLY)                = 3
fstat64(3, 0x08046CA0)                          = 0
fstat64(3, 0x08046BA0)                          = 0
ioctl(3, TCGETA, 0x08046C5E)                    Err#25 ENOTTY
read(3, " #   C D D L   H E A D E".., 2560)     = 2197
read(3, 0x080664F4, 2560)                       = 0
llseek(3, 0, SEEK_CUR)                          = 2197
llseek(3, 0, SEEK_SET)                          = 0
read(3, " #   C D D L   H E A D E".., 2560)     = 2197
read(3, 0x080664F4, 2560)                       = 0
llseek(3, 0, SEEK_CUR)                          = 2197
close(3)                                        = 0
open("/dev/udp", O_RDONLY)                      = 3
ioctl(3, SIOCGLIFNUM, 0x08047184)               = 0
close(3)                                        = 0
open("/dev/udp", O_RDONLY)                      = 3
ioctl(3, SIOCGLIFNUM, 0x08047184)               = 0
close(3)                                        = 0
brk(0x08068380)                                 = 0
brk(0x0806A380)                                 = 0
brk(0x0806A380)                                 = 0
brk(0x0806C380)                                 = 0
open("/etc/default/nss", O_RDONLY)              = 3
fstat64(3, 0x08047070)                          = 0
fstat64(3, 0x08046F70)                          = 0
ioctl(3, TCGETA, 0x0804702E)                    Err#25 ENOTTY
read(3, " #   / e t c / d e f a u".., 2048)     = 1756
read(3, 0x0806653C, 2048)                       = 0
llseek(3, 0, SEEK_CUR)                          = 1756
close(3)                                        = 0
open("/dev/nsmb", O_RDWR)                       Err#2 ENOENT
open("/dev/nsmb", O_RDWR)                       Err#2 ENOENT
open("/dev/nsmb", O_RDWR)                       Err#2 ENOENT
open("/native/proc/self/auxv", O_RDONLY)        = 3
fstat(3, 0x08047408)                            = 0
read(3, "D807\0\0BF7F04\bDE07\0\0".., 176)      = 176
close(3)                                        = 0
fstat64(2, 0x08046580)                          = 0
write(2, " m o u n t", 5)                       = 5
write(2, " :  ", 2)                             = 2
write(2, " f a i l e d   t o   o p".., 21)      = 21
write(2, " :   s y s e r r   =  ", 11)          = 11
write(2, " N o   s u c h   f i l e".., 25)      = 25
write(2, "\n", 1)                               = 1
write(2, " m o u n t", 5)                       = 5
write(2, " :  ", 2)                             = 2
write(2, " / /", 2)                             = 2
write(2, " 1 7 2 . 1 6 . 2 0 . 1 0".., 13)      = 13
write(2, " :   l o g i n   f a i l".., 14)      = 14
write(2, " :   s y s e r r   =  ", 11)          = 11
write(2, " N o   s u c h   f i l e".., 25)      = 25
write(2, "\n", 1)                               = 1
_exit(3)

Completely stuck at this point.

lx_boot_zone_redhat relies on /tmp being cleared on reboot

The lx_boot_zone_redhat relies on /tmp being cleared on a reboot/halt.
This will remove /tmp/.lx_net_up allow the network to start again on the next zone boot.

However on CentOS /tmp does not get cleared on reboot/halt. (using a minimal install) -- also same behavior on a vm.

[lx] SIGEV_THREAD_ID emulation needed

To properly support SIGEV_THREAD events lx must emulate the
SIGEV_THREAD_ID notification method. The current lx emulation
naively maps SIGEV_THREAD_ID to SIGEV_THREAD. This is
insufficient. When making a SIGEV_THREAD timer, glibc (and other
libc libraries like musl) creates a helper thread and a new sigevent
structure
before making the timer_create(2) syscall. This leads
to a segfault because the new sigevent has its original data stashed
away in a struct timer pointed to by sigev_value and the
sigev_notify_function member now contains stack garbage.

The ideal fix is to emulate Linux's SIGEV_THREAD_ID. This can be
done by using the native SIGEV_THREAD and adding a new lx-specific
cmd to the brand syscall. I already have a working patch which I'll
have up shortly.

Replication is easy with the Open POSIX Test Suite:

# wget 'http://downloads.sourceforge.net/project/posixtest/posixtest/posixtestsuite-1.5.2/posixtestsuite-1.5.2.tar.gz'
# tar zxvf posixtestsuite-1.5.2.tar.gz
# cd posixtestsuite
# make LDFLAGS="-lpthread -lrt" ./conformance/interfaces/fork/18-1.test
# ./conformance/interfaces/fork/18-1.test
Segmentation fault (core dumped)

Viewing the sigevent switcheroo is easy enough using printf and DTrace.

# sed -i '/se.sigev_notify_attributes.*/a \\tprintf("&notification: %p\\n", &notification);' conformance/interfaces/fork/18-1.c
# make LDFLAGS="-lpthread -lrt" ./conformance/interfaces/fork/18-1.test
# dtrace -n 'pid$target::timer_create:entry { print(*(userland struct sigevent *)args[1]); }' -c 'conformance/interfaces/fork/18-1.test'
dtrace: description 'pid$target::timer_create:entry ' matched 1 probe
&notification: 0x400cf0
dtrace: pid 72926 has exited
CPU     ID                    FUNCTION:NAME
  2  87996               timer_create:entry struct sigevent {
    int sigev_notify = 0x3
    int sigev_signo = 0x2a
    union sigval sigev_value = {
        int sival_int = 0x6015a0
        void *sival_ptr = 0x6015a0
    }
    void (*)() sigev_notify_function = 0x1
    pthread_attr_t *sigev_notify_attributes = 0
    int __sigev_pad2 = 0xffeff190
}

By the time illumos naitve timer_create(3C) is called the
sigev_notify_function is pointing to garbage.

lx-brand Segmenation fault in vala Programm (quine-relay)

Created a Dockerimage for https://github.com/mame/quine-relay (Not sure if it works on "normal" Linux docker host, can't test at the Moment. But would guess it does.) It cores.

14: Vala -> Verilog

valac QR.vala
In file included from /usr/local/share/quine-relay/QR.vala.c:6:
In file included from /usr/include/glib-2.0/glib-object.h:23:
In file included from /usr/include/glib-2.0/gobject/gbinding.h:29:
In file included from /usr/include/glib-2.0/gobject/gobject.h:29:
In file included from /usr/include/glib-2.0/gobject/gboxed.h:27:
/usr/include/glib-2.0/gobject/glib-types.h:346: warning: multi-character character constant
./QR > QR.v
Segmentation fault (core dumped)

core and binary here: http://buildfarm.opencsw.org/~jh/quine.tar.gz

coal platform: joyent_20150320T005835Z

Testing: docker run -t holzi/quine-relay

(of cause it should run all the way to be a cool demo :) )

As this is based on Ubuntu 14.10 don't know how good that works with lx-brand anyway.

lx brand - regression of rsyslogd?

Hey All,

rsyslog is hanging again on update! we had this a while ago too and it got fixed by @bcantrill.
This time it seems to be in the starting phase not the stopping one.

To replicate:

  1. build a fresh smartos image
    (2. do a fresh install - optional)
  2. import either the 64-bit or 32-bit image
  3. provision either one of the images
  4. aptitude update
  5. aptitude upgrade
  6. watch it hang on rsyslog update

@nshalman confirmed he could replicate. sad puppies all around

Filing a bug since a regression like this may get overlooked in the spreadsheet, I got a truss output but it does not tell (me) much.

http://sjorge.sinners.be/illumos/joyent/rsyslogd_regession/

Happy hunting, feel free to reach out to me on IRC if you have any questions

[lxbrand] firefox, thunderbird, plex and others want clone(2)

Seems firefox, thunderbird and others have problems forking processes. Preventing them from working correctly or at all.

clone(2) requires that all or none of CLONE_VM, CLONE_FS, CLONE_FILES, CLONE_THREAD and CLONE_SIGHAND be set.\0

This only seems to occur on 64-bit though.

[lx] clock_getres(2) always returns 0 when ts is NULL

The lx clock_getres(2) emulation is slightly wrong. When tp == NULL
it always returns success without actually checking the clock id,
whereas Linux checks the validity of the clock.

From what I can tell the only reliance on this behavior is glibc's
(2.19) clock_getcpuclockid(3). I.e. it relies on this behavior to
verify the generated clock id before returning it to the user.

http://code.metager.de/source/xref/gnu/glibc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c#33

(Note that the link is latest code but 2.19 is the same.)

I'm not sure if this really effects many programs. I found this bug
via the posix test suite:

conformance/interfaces/clock_getcpuclockid/1-2

lx-brand: make ipadm behave like in smartmachines

Being able to use ipadm like we can in native zones to configure the network stack would be nice.
Currently delete-if and create-if seem to be working, but that's about it.

create-addr results in:

ipadm: Error in setting local address: Operation failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.