message
stringlengths
6
474
diff
stringlengths
8
5.22k
amdgpu: changed clocks to average
@@ -161,8 +161,8 @@ void amdgpu_metrics_polling_thread() { UPDATE_METRIC_AVERAGE(average_gfx_power_w); UPDATE_METRIC_AVERAGE(average_cpu_power_w); - UPDATE_METRIC_LAST(current_gfxclk_mhz); - UPDATE_METRIC_LAST(current_uclk_mhz); + UPDATE_METRIC_AVERAGE(current_gfxclk_mhz); + UPDATE_METRIC_AVERAGE(current_uclk_mhz); UPDATE_METRIC_MAX(soc_temp_c); UPDATE_METRIC_MAX(gpu_temp_c);
TSCH: improve the readability of add_link and remove_link messages
@@ -171,6 +171,45 @@ tsch_schedule_get_link_by_handle(uint16_t handle) return NULL; } /*---------------------------------------------------------------------------*/ +static const char * +print_link_options(uint16_t link_options) +{ + static char buffer[20]; + unsigned length; + + buffer[0] = '\0'; + if(link_options & LINK_OPTION_TX) { + strcat(buffer, "Tx|"); + } + if(link_options & LINK_OPTION_RX) { + strcat(buffer, "Rx|"); + } + if(link_options & LINK_OPTION_SHARED) { + strcat(buffer, "Sh|"); + } + length = strlen(buffer); + if(length > 0) { + buffer[length - 1] = '\0'; + } + + return buffer; +} +/*---------------------------------------------------------------------------*/ +static const char * +print_link_type(uint16_t link_type) +{ + switch(link_type) { + case LINK_TYPE_NORMAL: + return "NORMAL"; + case LINK_TYPE_ADVERTISING: + return "ADV"; + case LINK_TYPE_ADVERTISING_ONLY: + return "ADV_ONLY"; + default: + return "?"; + } +} +/*---------------------------------------------------------------------------*/ /* Adds a link to a slotframe, return a pointer to it (NULL if failure) */ struct tsch_link * tsch_schedule_add_link(struct tsch_slotframe *slotframe, @@ -218,8 +257,10 @@ tsch_schedule_add_link(struct tsch_slotframe *slotframe, } linkaddr_copy(&l->addr, address); - LOG_INFO("add_link %u %u %u %u %u ", - slotframe->handle, link_options, link_type, timeslot, channel_offset); + LOG_INFO("add_link sf=%u opt=%s type=%s ts=%u ch=%u addr=", + slotframe->handle, + print_link_options(link_options), + print_link_type(link_type), timeslot, channel_offset); LOG_INFO_LLADDR(address); LOG_INFO_("\n"); /* Release the lock before we update the neighbor (will take the lock) */ @@ -260,8 +301,10 @@ tsch_schedule_remove_link(struct tsch_slotframe *slotframe, struct tsch_link *l) if(l == current_link) { current_link = NULL; } - LOG_INFO("remove_link %u %u %u %u ", - slotframe->handle, l->link_options, l->timeslot, l->channel_offset); + LOG_INFO("remove_link sf=%u opt=%s type=%s ts=%u ch=%u addr=", + slotframe->handle, + print_link_options(l->link_options), + print_link_type(l->link_type), l->timeslot, l->channel_offset); LOG_INFO_LLADDR(&l->addr); LOG_INFO_("\n");
Comment scripts in windows tests.
@@ -70,11 +70,10 @@ function sub-build { # Copy scripts and node_module for test $nmPath = ".\source\loaders\node_loader\bootstrap\node_modules" - $scriptsPath = ".\scripts" + # $scriptsPath = ".\scripts" robocopy /e "$nmPath" ".\$BUILD_TYPE\node_modules" /NFL /NDL /NJH /NJS /NC /NS /NP - robocopy /e "$scriptsPath" ".\$BUILD_TYPE\scripts" /NFL /NDL /NJH /NJS /NC /NS /NP - + # robocopy /e "$scriptsPath" ".\$BUILD_TYPE\scripts" /NFL /NDL /NJH /NJS /NC /NS /NP ctest "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" --output-on-failure -C $BUILD_TYPE
Documentation of bufr_filter
@@ -130,17 +130,17 @@ echo "\\endverbatim\\n" echo "-# The <b>switch</b> statement is an enhanced version of the if statement. Its syntax is the following:" echo "\\verbatim" -echo "switch (key1,key2,...,keyn) {" -echo " case val11,val12,...,val1n:" -echo " # block of rules;" -echo " case val21,val22,...,val2n:" -echo " # block of rules;" +echo "switch (key1) {" +echo " case val1:" +echo " # statements" +echo " case val2:" +echo " # statements" echo " default:" -echo " # [ block of rules ]" +echo " # statements" echo "}" echo "\\endverbatim\\n" -echo "Each value of each key given as argument to the switch statement is matched against the values specified in the case statements.\\n" -echo "If there is a match, then the block or rules corresponding to the matching case statement is executed.\\n" +echo "The value of the key given as argument to the switch statement is matched against the values specified in the case statements.\\n" +echo "If there is a match, then the statements corresponding to the matching case are executed.\\n" echo "Otherwise, the default case is executed. The default case is mandatory if the case statements do not cover all the possibilities.\\n" echo "The \"~\" operator can be used to match \"anything\".\\n\\n" @@ -301,7 +301,5 @@ head tmp_file echo "\\endverbatim\\n" -rm -f rules_file || true -rm -f tmp_file || true - - +rm -f rules_file +rm -f tmp_file
Fix module tab verification status text
@@ -662,7 +662,7 @@ BOOLEAN NTAPI PhpModuleTreeNewCallback( switch (getCellText->Id) { case PHMOTLC_NAME: - getCellText->Text = moduleItem->Name->sr; + getCellText->Text = PhGetStringRef(moduleItem->Name); break; case PHMOTLC_BASEADDRESS: PhInitializeStringRefLongHint(&getCellText->Text, moduleItem->BaseAddressString); @@ -733,16 +733,8 @@ BOOLEAN NTAPI PhpModuleTreeNewCallback( } break; case PHMOTLC_VERIFICATIONSTATUS: - if (moduleItem->Type == PH_MODULE_TYPE_MODULE || moduleItem->Type == PH_MODULE_TYPE_KERNEL_MODULE || - moduleItem->Type == PH_MODULE_TYPE_WOW64_MODULE || moduleItem->Type == PH_MODULE_TYPE_MAPPED_IMAGE) - { PhInitializeStringRef(&getCellText->Text, moduleItem->VerifyResult == VrTrusted ? L"Trusted" : L"Not trusted"); - } - else - { - PhInitializeEmptyStringRef(&getCellText->Text); - } break; case PHMOTLC_VERIFIEDSIGNER: getCellText->Text = PhGetStringRef(moduleItem->VerifySignerName);
BugID:23703248: Update existence check for project directory
@@ -308,8 +308,12 @@ def cli(projectname, board, projectdir, templateapp): destdir = os.path.join(projectdir, projectname) destdir = os.path.abspath(destdir) - if os.path.isdir(destdir): + if os.path.exists(destdir): + if os.path.isfile(destdir): + click.echo("[Error] Can't create project directory, the file is existing!\n%s" % destdir) + else: click.echo("[Error] The project directory is existing!\n%s" % destdir) + return 1 else: os.makedirs(destdir)
Preload webpack entry
@@ -17,7 +17,10 @@ import copy from "./lib/helpers/fsCopy"; import rimraf from "rimraf"; import { promisify } from "util"; +declare var MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: any; declare var MAIN_WINDOW_WEBPACK_ENTRY: any; + +declare var SPLASH_WINDOW_PRELOAD_WEBPACK_ENTRY: any; declare var SPLASH_WINDOW_WEBPACK_ENTRY: any; const rmdir = promisify(rimraf); @@ -65,7 +68,8 @@ const createSplash = async (forceNew = false) => { autoHideMenuBar: true, webPreferences: { nodeIntegration: true, - devTools: isDevMode + devTools: isDevMode, + preload: SPLASH_WINDOW_PRELOAD_WEBPACK_ENTRY } }); @@ -109,7 +113,8 @@ const createWindow = async (projectPath: string) => { webPreferences: { nodeIntegration: true, webSecurity: false, - devTools: isDevMode + devTools: isDevMode, + preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY } });
mmapstorage: add opmphmIsBuild
@@ -1037,7 +1037,7 @@ static void copyKeySetToMmap (char * const dest, KeySet * keySet, KeySet * globa static void mmapOpmphmDel (Opmphm * opmphm) { ELEKTRA_NOT_NULL (opmphm); - if (opmphmIsBuild (opmphm)) + if (opmphm && opmphm->size) { if (!test_bit (opmphm->flags, OPMPHM_FLAG_MMAP_GRAPH)) elektraFree (opmphm->graph); opmphm->size = 0;
Fix update date on Raspbian (2) fromMSecsSinceEpoch() isn't available in older Qt versions.
@@ -80,7 +80,7 @@ void DeRestPluginPrivate::initConfig() gwName = GW_DEFAULT_NAME; gwUpdateVersion = GW_SW_VERSION; // will be replaced by discovery handler { - const QDateTime d = QDateTime::fromSecsSinceEpoch(GW_SW_DATE); + const QDateTime d = QDateTime::fromMSecsSinceEpoch(GW_SW_DATE * 1000LLU); gwUpdateDate = d.toString("yyyy-MM-ddTHH:mm:ss"); // ISO 8601; } gwSwUpdateState = swUpdateState.noUpdate;
djgpp: Fix unused-but-set-variable warning I chose to just hide this behind '#ifndef __DJGPP__', instead of listing all the macro combinations where it *is* used. That would make quite a mess.
@@ -527,7 +527,10 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) long ret = 1; int *ip; bio_dgram_data *data = NULL; +# ifndef __DJGPP__ + /* There are currently no cases where this is used on djgpp/watt32. */ int sockopt_val = 0; +# endif int d_errno; # if defined(OPENSSL_SYS_LINUX) && (defined(IP_MTU_DISCOVER) || defined(IP_MTU)) socklen_t sockopt_len; /* assume that system supporting IP_MTU is @@ -847,22 +850,22 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) break; # endif case BIO_CTRL_DGRAM_SET_DONT_FRAG: - sockopt_val = num ? 1 : 0; - switch (data->peer.sa.sa_family) { case AF_INET: # if defined(IP_DONTFRAG) + sockopt_val = num ? 1 : 0; if ((ret = setsockopt(b->num, IPPROTO_IP, IP_DONTFRAG, &sockopt_val, sizeof(sockopt_val))) < 0) ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(), "calling setsockopt()"); # elif defined(OPENSSL_SYS_LINUX) && defined(IP_MTU_DISCOVER) && defined (IP_PMTUDISC_PROBE) - if ((sockopt_val = num ? IP_PMTUDISC_PROBE : IP_PMTUDISC_DONT), - (ret = setsockopt(b->num, IPPROTO_IP, IP_MTU_DISCOVER, + sockopt_val = num ? IP_PMTUDISC_PROBE : IP_PMTUDISC_DONT; + if ((ret = setsockopt(b->num, IPPROTO_IP, IP_MTU_DISCOVER, &sockopt_val, sizeof(sockopt_val))) < 0) ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(), "calling setsockopt()"); # elif defined(OPENSSL_SYS_WINDOWS) && defined(IP_DONTFRAGMENT) + sockopt_val = num ? 1 : 0; if ((ret = setsockopt(b->num, IPPROTO_IP, IP_DONTFRAGMENT, (const char *)&sockopt_val, sizeof(sockopt_val))) < 0) @@ -875,6 +878,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) # if OPENSSL_USE_IPV6 case AF_INET6: # if defined(IPV6_DONTFRAG) + sockopt_val = num ? 1 : 0; if ((ret = setsockopt(b->num, IPPROTO_IPV6, IPV6_DONTFRAG, (const void *)&sockopt_val, sizeof(sockopt_val))) < 0) @@ -882,8 +886,8 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) "calling setsockopt()"); # elif defined(OPENSSL_SYS_LINUX) && defined(IPV6_MTUDISCOVER) - if ((sockopt_val = num ? IP_PMTUDISC_PROBE : IP_PMTUDISC_DONT), - (ret = setsockopt(b->num, IPPROTO_IPV6, IPV6_MTU_DISCOVER, + sockopt_val = num ? IP_PMTUDISC_PROBE : IP_PMTUDISC_DONT; + if ((ret = setsockopt(b->num, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &sockopt_val, sizeof(sockopt_val))) < 0) ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(), "calling setsockopt()");
board/felwinter/led.c: Format with clang-format BRANCH=none TEST=none
@@ -19,25 +19,33 @@ __override const int led_charge_lvl_2 = 94; __override struct led_descriptor led_bat_state_table[LED_NUM_STATES][LED_NUM_PHASES] = { - [STATE_CHARGING_LVL_1] = {{EC_LED_COLOR_AMBER, LED_INDEFINITE} }, - [STATE_CHARGING_LVL_2] = {{EC_LED_COLOR_AMBER, LED_INDEFINITE} }, - [STATE_CHARGING_FULL_CHARGE] = {{EC_LED_COLOR_WHITE, LED_INDEFINITE} }, + [STATE_CHARGING_LVL_1] = { { EC_LED_COLOR_AMBER, + LED_INDEFINITE } }, + [STATE_CHARGING_LVL_2] = { { EC_LED_COLOR_AMBER, + LED_INDEFINITE } }, + [STATE_CHARGING_FULL_CHARGE] = { { EC_LED_COLOR_WHITE, + LED_INDEFINITE } }, [STATE_DISCHARGE_S0] = { { LED_OFF, LED_INDEFINITE } }, - [STATE_DISCHARGE_S0_BAT_LOW] = {{EC_LED_COLOR_AMBER, 1 * LED_ONE_SEC}, + [STATE_DISCHARGE_S0_BAT_LOW] = { { EC_LED_COLOR_AMBER, + 1 * LED_ONE_SEC }, { LED_OFF, 3 * LED_ONE_SEC } }, [STATE_DISCHARGE_S3] = { { LED_OFF, LED_INDEFINITE } }, [STATE_DISCHARGE_S5] = { { LED_OFF, LED_INDEFINITE } }, - [STATE_BATTERY_ERROR] = {{EC_LED_COLOR_AMBER, 1 * LED_ONE_SEC}, + [STATE_BATTERY_ERROR] = { { EC_LED_COLOR_AMBER, + 1 * LED_ONE_SEC }, { LED_OFF, 1 * LED_ONE_SEC } }, }; __override const struct led_descriptor led_pwr_state_table[PWR_LED_NUM_STATES][LED_NUM_PHASES] = { [PWR_LED_STATE_ON] = { { EC_LED_COLOR_WHITE, LED_INDEFINITE } }, - [PWR_LED_STATE_SUSPEND_AC] = {{EC_LED_COLOR_WHITE, 1 * LED_ONE_SEC}, - {LED_OFF, 3 * LED_ONE_SEC} }, - [PWR_LED_STATE_SUSPEND_NO_AC] = {{EC_LED_COLOR_WHITE, 1 * LED_ONE_SEC}, + [PWR_LED_STATE_SUSPEND_AC] = { { EC_LED_COLOR_WHITE, + 1 * LED_ONE_SEC }, { LED_OFF, 3 * LED_ONE_SEC } }, + [PWR_LED_STATE_SUSPEND_NO_AC] = { { EC_LED_COLOR_WHITE, + 1 * LED_ONE_SEC }, + { LED_OFF, + 3 * LED_ONE_SEC } }, [PWR_LED_STATE_OFF] = { { LED_OFF, LED_INDEFINITE } }, };
Actions: CMake Build on various os versions
-name: C/C++ CI +name: Build on: [push, pull_request] jobs: - build: + linux: name: Build (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-16.04] + os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] + fail-fast: false steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Install build tools - if: matrix.os == 'macos-latest' - run: brew install autoconf automake libtool pkg-config - - name: bootstrap and configure - run: ./bootstrap && ./configure --enable-debug - - name: make - run: make - - name: make distcheck - run: make VERBOSE=1 distcheck + run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build + + - name: Build + run: | + mkdir ../build + cd ../build + cmake -G Ninja -DBUILD_TESTING=ONs ../pupnp + ninja + + - name: Test + run: | + cd ../build + ctest --output-on-failure + + windows: + name: Build (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [windows-2016, windows-2019] + fail-fast: false + + steps: + - uses: actions/checkout@v2 + + - name: Install build tools + run: | + choco install ninja vswhere + + - name: Build + run: | + $installationPath = vswhere.exe -prerelease -latest -property installationPath + if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) { + & "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo && set" | foreach-object { + $name, $value = $_ -split '=', 2 + set-content env:\"$name" $value + } + } + mkdir ../build + cd ../build + cmake -G Ninja -DDOWNLOAD_AND_BUILD_DEPS=ON -DBUILD_TESTING=ON ../pupnp + ninja + + - name: Test + run: | + cd ../build + ctest -E pthread4w --output-on-failure # Exclude pthread4w tests on windows + + macos: + name: Build (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-10.13, macos-10.15, macos-11.0] + fail-fast: false + + steps: + - uses: actions/checkout@v2 + + - name: Install build tools + run: brew install pkg-config cmake ninja + + - name: Build + run: | + mkdir ../build + cd ../build + cmake -G Ninja -DBUILD_TESTING=ON ../pupnp + ninja + + - name: Test + run: | + cd ../build + ctest --output-on-failure build_asan: - name: Sanitizer build (ubuntu-16.04) - runs-on: ubuntu-16.04 + name: Sanitizer build (ubuntu-20.04) + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1
Display deprecation messages in GCC.
#define TCOD_DEPRECATED(msg) __declspec(deprecated(msg)) #define TCOD_DEPRECATED_NOMESSAGE __declspec(deprecated) #elif defined(__GNUC__) -#define TCOD_DEPRECATED(msg) __attribute__ ((deprecated)) +#define TCOD_DEPRECATED(msg) __attribute__ ((deprecated(msg))) #define TCOD_DEPRECATED_NOMESSAGE __attribute__ ((deprecated)) #else #define TCOD_DEPRECATED(msg)
Genesis: LED PWM channels' IO type change to push-pull Remove open-drain flags in led pwm ch.0 and ch.2 BRANCH=puff TEST=none
@@ -128,12 +128,10 @@ const struct pwm_t pwm_channels[] = { .flags = PWM_CONFIG_OPEN_DRAIN, .freq = 25000}, [PWM_CH_LED_RED] = { .channel = 0, - .flags = PWM_CONFIG_OPEN_DRAIN | - PWM_CONFIG_DSLEEP, + .flags = PWM_CONFIG_DSLEEP, .freq = 2000 }, [PWM_CH_LED_WHITE] = { .channel = 2, - .flags = PWM_CONFIG_OPEN_DRAIN | - PWM_CONFIG_DSLEEP, + .flags = PWM_CONFIG_DSLEEP, .freq = 2000 }, };
NAT44: allow to configure one interface only as output or input feature following is not possible: set interface nat44 out GigabitEthernet0/3/0 output-feature set interface nat44 out GigabitEthernet0/3/0
@@ -1428,6 +1428,12 @@ int snat_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del) if (sm->out2in_dpo && !is_inside) return VNET_API_ERROR_UNSUPPORTED; + pool_foreach (i, sm->output_feature_interfaces, + ({ + if (i->sw_if_index == sw_if_index) + return VNET_API_ERROR_VALUE_EXIST; + })); + if (sm->static_mapping_only && !(sm->static_mapping_connection_tracking)) feature_name = is_inside ? "nat44-in2out-fast" : "nat44-out2in-fast"; else @@ -1579,6 +1585,12 @@ int snat_interface_add_del_output_feature (u32 sw_if_index, (sm->static_mapping_only && !(sm->static_mapping_connection_tracking))) return VNET_API_ERROR_UNSUPPORTED; + pool_foreach (i, sm->interfaces, + ({ + if (i->sw_if_index == sw_if_index) + return VNET_API_ERROR_VALUE_EXIST; + })); + if (is_inside) { vnet_feature_enable_disable ("ip4-unicast", "nat44-hairpin-dst",
sysdeps/managarm: Stub sys_clock_getres
@@ -71,5 +71,13 @@ int sys_clock_get(int clock, time_t *secs, long *nanos) { return 0; } +int sys_clock_getres(int clock, time_t *secs, long *nanos) { + (void)clock; + (void)secs; + (void)nanos; + mlibc::infoLogger() << "mlibc: clock_getres is a stub" << frg::endlog; + return 0; +} + } //namespace mlibc
removed logo, that didn't work.
[![License](https://img.shields.io/badge/License-BSD%203%20Clause-blue.svg)](LICENSE.md) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2799/badge)](https://bestpractices.coreinfrastructure.org/projects/2799) -![openexr](/ASWF/images/openexr-logo.jpg) ![openexr](/OpenEXR/doc/images/windowExample1.png) +![openexr](/OpenEXR/doc/images/windowExample1.png) **OpenEXR** is a high dynamic-range (HDR) image file format originally developed by Industrial Light & Magic (ILM) in 2003 for use in
Fix for MT keys sending press/release quickly.
@@ -40,6 +40,9 @@ bool zmk_handle_action(zmk_action action, struct zmk_key_event *key_event) .pressed = true}; zmk_handle_key(non_mod_event); + // A small sleep is needed to ensure device layer sends initial + // key, before we send the release. + k_msleep(10); non_mod_event.pressed = false; zmk_handle_key(non_mod_event); }
remove redundant condition *format = % which should never happen
@@ -274,20 +274,18 @@ parse_path_specifier(char * format, struct extractor_specifier *es, ASSERT_S(next_path_idx < N_PATH_MAX, "Too many path specifiers"); char *start = format; - do { - ++format; - } while (*format && *format != ']' && *format != '%'); + for (;*format && *format != ']'; format++) + continue; // until find a ']' or '\0' + + ASSERT_S(*format == ']', "A close bracket ']' is missing"); size_t len = format - start; - ASSERT_S(len < KEY_MAX, "Key is too long (Buffer Overflow)"); + ASSERT_S(len + 1 < KEY_MAX, "Key is too long (Buffer Overflow)"); ASSERT_S(0 != len, "Key has invalid size 0"); strscpy(curr_path->key, start, len + 1); - if (']' == *format) { ++format; // eat up ']' - } - switch (*format) { case '[': {
Initialize allocators when thread local is empty
@@ -200,7 +200,6 @@ OE_EXPORT volatile uint64_t _tdata_align = 1; OE_EXPORT volatile uint64_t _tbss_size = 0; OE_EXPORT volatile uint64_t _tbss_align = 1; -// Number of thread-local relocations. static volatile bool _thread_locals_relocated = false; // TODO: Make this flexible in case more than one page of thread local storage @@ -314,7 +313,7 @@ oe_result_t oe_thread_local_init(oe_sgx_td_t* td) // Copy the template oe_memcpy_s(tls_start, _tdata_size, tdata, _tdata_size); - // Perform thread-local relocations. + // Perform thread-local relocations, only run once. if (!_thread_locals_relocated) { // Note: For an enclave, thread-local relocations always set the @@ -346,17 +345,6 @@ oe_result_t oe_thread_local_init(oe_sgx_td_t* td) _thread_locals_relocated = true; } - - { - static bool _allocator_initialized = false; - bool initialized = _allocator_initialized; - OE_ATOMIC_MEMORY_BARRIER_ACQUIRE(); - if (!initialized) - { - /* Initialize the allocator */ - OE_ATOMIC_MEMORY_BARRIER_RELEASE(); - _allocator_initialized = true; - } } // To properly initialize the allocator, oe_allocator_init must first be @@ -373,9 +361,10 @@ oe_result_t oe_thread_local_init(oe_sgx_td_t* td) // called. This results in incorrect order of the allocator callbacks. // Therefore, we call oe_allocator_init here (via oe_once) // and then call oe_allocator_thread_init. + // Note that we need to initialize the allocator even when thread-local data + // is empty (i.e., tls_start is NULL when tdata and tbss are zero). _initialize_allocator(); oe_allocator_thread_init(); - } result = OE_OK; done: @@ -426,11 +415,11 @@ oe_result_t oe_thread_local_cleanup(oe_sgx_td_t* td) /* Clear tls section if it exists */ uint8_t* fs = _get_fs_from_td(td); uint8_t* tls_start = _get_thread_local_data_start(td); - if (tls_start) - { + // Invoke the cleanup function even when the thread-local data is empty + // (i.e., tls_start is NULL when tdata and tbss are zero). oe_allocator_thread_cleanup(); + if (tls_start) oe_memset_s(tls_start, (uint64_t)(fs - tls_start), 0, 0); - } return OE_OK; }
Use `ccaInfo.ccaState` to decide whether CCA is complete This commit changes the logic of `get_cca_info()` in the CC26xx IEEE mode driver. We now use the command's return status bits to determine whether the radio's CCA monitoring function has concluded, instead of drawing conclusions based on RSSI readings.
@@ -359,13 +359,12 @@ transmitting(void) * It is the caller's responsibility to make sure the RF is on. This function * will return RF_GET_CCA_INFO_ERROR if the RF is off * - * This function will in fact wait for a valid RSSI signal + * This function will in fact wait for a valid CCA state */ static uint8_t get_cca_info(void) { uint32_t cmd_status; - int8_t rssi; rfc_CMD_IEEE_CCA_REQ_t cmd; if(!rf_is_on()) { @@ -373,9 +372,10 @@ get_cca_info(void) return RF_GET_CCA_INFO_ERROR; } - rssi = RF_CMD_CCA_REQ_RSSI_UNKNOWN; + memset(&cmd, 0x00, sizeof(cmd)); + cmd.ccaInfo.ccaState = RF_CMD_CCA_REQ_CCA_STATE_INVALID; - while(rssi == RF_CMD_CCA_REQ_RSSI_UNKNOWN || rssi == 0) { + while(cmd.ccaInfo.ccaState == RF_CMD_CCA_REQ_CCA_STATE_INVALID) { memset(&cmd, 0x00, sizeof(cmd)); cmd.commandNo = CMD_IEEE_CCA_REQ; @@ -384,11 +384,9 @@ get_cca_info(void) return RF_GET_CCA_INFO_ERROR; } - - rssi = cmd.currentRssi; } - /* We have a valid RSSI signal. Return the CCA Info */ + /* We have a valid CCA state. Return the CCA Info */ return *((uint8_t *)&cmd.ccaInfo); } /*---------------------------------------------------------------------------*/
BugID:16959715: fix call aos_kv_set error
@@ -179,7 +179,7 @@ static void write_lora_dev(lora_dev_t *lora_dev) { lora_dev->crc = crc16((uint8_t *)lora_dev, sizeof(lora_dev_t) - 2); #ifdef AOS_KV - aos_kv_set("lora_dev", lora_dev, sizeof(lora_dev_t)); + aos_kv_set("lora_dev", lora_dev, sizeof(lora_dev_t), 1); #else memcpy(&g_lora_dev, lora_dev, sizeof(lora_dev_t)); #endif @@ -834,7 +834,7 @@ bool set_lora_freq_mode(node_freq_mode_t mode) } g_freq_mode = mode; #ifdef AOS_KV - aos_kv_set("lora_uldl_mode", &g_freq_mode, sizeof(g_freq_mode)); + aos_kv_set("lora_uldl_mode", &g_freq_mode, sizeof(g_freq_mode), 1); #endif return true; } @@ -1293,7 +1293,7 @@ bool set_lora_devaddr(uint8_t *devaddr) memcpy(g_lora_abp_id.devaddr, devaddr, 4); g_lora_abp_id.flag = VALID_LORA_CONFIG; #ifdef AOS_KV - aos_kv_set("lora_abp", &g_lora_abp_id, sizeof(g_lora_abp_id)); + aos_kv_set("lora_abp", &g_lora_abp_id, sizeof(g_lora_abp_id), 1); #endif return true; } @@ -1308,7 +1308,7 @@ bool set_lora_appskey(uint8_t *buf) memcpy(g_lora_abp_id.appskey, buf, 16); g_lora_abp_id.flag = VALID_LORA_CONFIG; #ifdef AOS_KV - aos_kv_set("lora_abp", &g_lora_abp_id, sizeof(g_lora_abp_id)); + aos_kv_set("lora_abp", &g_lora_abp_id, sizeof(g_lora_abp_id), 1); #endif return true; } @@ -1323,7 +1323,7 @@ bool set_lora_nwkskey(uint8_t *buf) memcpy(g_lora_abp_id.nwkskey, buf, 16); g_lora_abp_id.flag = VALID_LORA_CONFIG; #ifdef AOS_KV - aos_kv_set("lora_abp", &g_lora_abp_id, sizeof(g_lora_abp_id)); + aos_kv_set("lora_abp", &g_lora_abp_id, sizeof(g_lora_abp_id), 1); #endif return true; }
Fix closing the game without audio
@@ -145,6 +145,7 @@ Sound_samples *create_sound_samples(const char *sample_files[], void destroy_sound_samples(Sound_samples *sound_samples) { // TODO(#1025): Use a seperate callback function for audio handling and pass that into SDL_OpenAudioDevice + if (sound_samples->failed) return; trace_assert(sound_samples); trace_assert(sound_samples->dev); SDL_CloseAudioDevice(sound_samples->dev);
Add std/tga benchmarks Updates
@@ -69,6 +69,23 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the // ---------------- TGA Tests +const char* // +wuffs_tga_decode(uint64_t* n_bytes_out, + wuffs_base__io_buffer* dst, + uint32_t wuffs_initialize_flags, + wuffs_base__pixel_format pixfmt, + uint32_t* quirks_ptr, + size_t quirks_len, + wuffs_base__io_buffer* src) { + wuffs_tga__decoder dec; + CHECK_STATUS("initialize", + wuffs_tga__decoder__initialize(&dec, sizeof dec, WUFFS_VERSION, + wuffs_initialize_flags)); + return do_run__wuffs_base__image_decoder( + wuffs_tga__decoder__upcast_as__wuffs_base__image_decoder(&dec), + n_bytes_out, dst, pixfmt, quirks_ptr, quirks_len, src); +} + const char* // test_wuffs_tga_decode_interface() { CHECK_FOCUS(__func__); @@ -92,7 +109,24 @@ test_wuffs_tga_decode_interface() { // ---------------- TGA Benches -// No TGA benches. +const char* // +bench_wuffs_tga_decode_19k_8bpp() { + CHECK_FOCUS(__func__); + return do_bench_image_decode( + &wuffs_tga_decode, WUFFS_INITIALIZE__LEAVE_INTERNAL_BUFFERS_UNINITIALIZED, + wuffs_base__make_pixel_format( + WUFFS_BASE__PIXEL_FORMAT__INDEXED__BGRA_NONPREMUL), + NULL, 0, "test/data/bricks-nodither.tga", 0, SIZE_MAX, 1000); +} + +const char* // +bench_wuffs_tga_decode_77k_24bpp() { + CHECK_FOCUS(__func__); + return do_bench_image_decode( + &wuffs_tga_decode, WUFFS_INITIALIZE__LEAVE_INTERNAL_BUFFERS_UNINITIALIZED, + wuffs_base__make_pixel_format(WUFFS_BASE__PIXEL_FORMAT__BGRA_NONPREMUL), + NULL, 0, "test/data/bricks-color.tga", 0, SIZE_MAX, 200); +} // ---------------- Mimic Benches @@ -119,7 +153,8 @@ proc g_tests[] = { proc g_benches[] = { -// No TGA benches. + bench_wuffs_tga_decode_19k_8bpp, + bench_wuffs_tga_decode_77k_24bpp, #ifdef WUFFS_MIMIC
Limit the size of export names to 512 bytes and reduce the number exports parsed. If a file exceeds the limit of exports the first ones are parsed up to the limit. This change was introduced because file was consuming 1.5GB of RAM due to unlimited export names.
@@ -90,7 +90,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define MAX_PE_IMPORTS 16384 -#define MAX_PE_EXPORTS 65535 +#define MAX_PE_EXPORTS 8192 +#define MAX_EXPORT_NAME_LENGTH 512 #define IS_RESOURCE_SUBDIRECTORY(entry) \ @@ -971,6 +972,7 @@ EXPORT_FUNCTIONS* pe_parse_exports( EXPORT_FUNCTIONS* exported_functions; uint32_t i; + uint32_t number_of_exports; uint32_t number_of_names; uint16_t ordinal; int64_t offset; @@ -1006,8 +1008,11 @@ EXPORT_FUNCTIONS* pe_parse_exports( if (!struct_fits_in_pe(pe, exports, IMAGE_EXPORT_DIRECTORY)) return NULL; - if (yr_le32toh(exports->NumberOfFunctions) > MAX_PE_EXPORTS || - yr_le32toh(exports->NumberOfFunctions) * sizeof(DWORD) > pe->data_size - offset) + number_of_exports = yr_min( + yr_le32toh(exports->NumberOfFunctions), + MAX_PE_EXPORTS); + + if (number_of_exports * sizeof(DWORD) > pe->data_size - offset) return NULL; if (yr_le32toh(exports->NumberOfNames) > 0) @@ -1035,11 +1040,9 @@ EXPORT_FUNCTIONS* pe_parse_exports( if (exported_functions == NULL) return NULL; - exported_functions->number_of_exports = yr_le32toh( - exports->NumberOfFunctions); - + exported_functions->number_of_exports = number_of_exports; exported_functions->functions = (EXPORT_FUNCTION*) yr_malloc( - exported_functions->number_of_exports * sizeof(EXPORT_FUNCTION)); + number_of_exports * sizeof(EXPORT_FUNCTION)); if (exported_functions->functions == NULL) { @@ -1086,7 +1089,8 @@ EXPORT_FUNCTIONS* pe_parse_exports( if (exported_functions->functions[ordinal].name == NULL) { exported_functions->functions[ordinal].name = yr_strndup( - (char*) (pe->data + offset), remaining); + (char*) (pe->data + offset), + yr_min(remaining, MAX_EXPORT_NAME_LENGTH)); } }
Base64: Update return value of set function
@@ -195,7 +195,9 @@ int PLUGIN_FUNCTION (get) (Plugin * handle ELEKTRA_UNUSED, KeySet * keySet, Key /** * @brief Encode all binary values using the Base64 encoding scheme. - * @retval 1 on success + * + * @retval 1 if any keys were updated + * @retval 0 if `keyset` was not modified * @retval -1 on failure */ int PLUGIN_FUNCTION (set) (Plugin * handle ELEKTRA_UNUSED, KeySet * keySet, Key * parentKey) @@ -203,11 +205,14 @@ int PLUGIN_FUNCTION (set) (Plugin * handle ELEKTRA_UNUSED, KeySet * keySet, Key Key * key; ksRewind (keySet); - while ((key = ksNext (keySet))) + int status = 0; + while (status >= 0 && (key = ksNext (keySet))) { - if ((escape (key, parentKey) == -1) || (encode (key, parentKey) == -1)) return -1; + status |= escape (key, parentKey); + if (status < 0) break; + status |= encode (key, parentKey); } - return 1; + return status; } Plugin * ELEKTRA_PLUGIN_EXPORT (base64)
fix typo in zcl value names precicion > precision Issue:
<datatype id="30" name="8-bit enumeration" shortname="enum8" length="1" inval="ff" ad="D"></datatype> <datatype id="31" name="16-bit enumeration" shortname="enum16" length="2" inval="ffff" ad="D"></datatype> <!-- Floating point --> - <datatype id="38" name="Semi-precicion" shortname="semi" length="2" inval="nan" ad="A"></datatype> - <datatype id="39" name="Single precicion" shortname="float" length="4" inval="nan" ad="A"></datatype> - <datatype id="3a" name="Double precicion" shortname="double" length="8" inval="nan" ad="A"></datatype> + <datatype id="38" name="Semi-precision" shortname="semi" length="2" inval="nan" ad="A"></datatype> + <datatype id="39" name="Single precision" shortname="float" length="4" inval="nan" ad="A"></datatype> + <datatype id="3a" name="Double precision" shortname="double" length="8" inval="nan" ad="A"></datatype> <!-- String --> <!-- oN, defined in first N octets --> <datatype id="41" name="Octed string" shortname="ostring" length="o1" inval="ff" ad="D"></datatype>
Install php7 from a ppa
@@ -56,7 +56,6 @@ matrix: dist: trusty env: - ASAN_OPTIONS=detect_leaks=0 - php: '7.x' before_install: - curl -L http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-add-repository -y 'deb http://llvm.org/apt/trusty llvm-toolchain-trusty-4.0 main' @@ -65,12 +64,17 @@ matrix: - sudo apt-get install -y clang-4.0 - sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test - sudo apt-add-repository --yes ppa:smspillaz/cmake-2.8.12 + - sudo add-apt-repository --yes ppa:ondrej/php - sudo apt-get --yes update - - sudo apt-get install --yes cmake cmake-data g++-4.8 libstdc++-4.8-dev wget php5-cgi + - sudo apt-get install --yes cmake cmake-data g++-4.8 libstdc++-4.8-dev wget php7.0-cgi - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8"; fi - $CXX --version # for speed, pre-install deps installed in `before_script` section as ubuntu packages - sudo apt-get install -qq cpanminus libipc-signal-perl liblist-moreutils-perl libwww-perl libio-socket-ssl-perl zlib1g-dev + # default system php is buggy, make sure we're using the php7 package + - sudo rm /usr/bin/php-cgi + - sudo ln -s /usr/bin/php-cgi7.0 /usr/bin/php-cgi + - sudo rm /home/travis/.phpenv/shims/php-cgi before_script: *bs script: - CC=clang-4.0 CXX=clang++-4.0 cmake -DBUILD_FUZZER=ON -DWITH_MRUBY=ON .
mesh: Remove redundant expression Remove checking of the same argument twice this is port of
@@ -397,7 +397,7 @@ static void gen_prov_ack(struct prov_rx *rx, struct os_mbuf *buf) prov_clear_tx(); } - if (link.tx.cb && link.tx.cb) { + if (link.tx.cb) { link.tx.cb(0, link.tx.cb_data); } }
Remove a CMS key downgrade We were downgrading a key in the CMS code. This is no longer necessary.
@@ -261,26 +261,6 @@ int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms, size_t ceklen; CMS_EncryptedContentInfo *ec; - { - /* - * TODO(3.0) Remove this when we have functionality to deserialize - * parameters in EVP_PKEY form from an X509_ALGOR. - * This is needed to be able to replace the EC_KEY specific decoding - * that happens in ecdh_cms_set_peerkey() (crypto/ec/ec_ameth.c) - * - * THIS IS TEMPORARY - */ - EVP_PKEY_CTX *pctx = CMS_RecipientInfo_get0_pkey_ctx(ri); - EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx); - - EVP_PKEY_get0(pkey); - if (EVP_PKEY_id(pkey) == EVP_PKEY_NONE) { - CMSerr(CMS_F_CMS_RECIPIENTINFO_KARI_DECRYPT, - CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); - goto err; - } - } - enckeylen = rek->encryptedKey->length; enckey = rek->encryptedKey->data; /* Setup all parameters to derive KEK */ @@ -499,32 +479,6 @@ int cms_RecipientInfo_kari_encrypt(const CMS_ContentInfo *cms, STACK_OF(CMS_RecipientEncryptedKey) *reks; int i; - { - /* - * TODO(3.0) Remove this when we have figured out all the details - * need to set up encryption right. With legacy keys, a *lot* is - * happening in the CMS specific EVP_PKEY_ASN1_METHOD functions, - * such as automatically setting a default KDF type, KDF digest, - * all that kind of stuff. - * With EVP_SIGNATURE, setting a default digest is done by getting - * the default MD for the key, and then inject that back into the - * signature implementation... we could do something similar with - * CMS, possibly using CMS specific OSSL_PARAM keys, just like we - * have for certain AlgorithmIdentifier retrievals. - * - * THIS IS TEMPORARY - */ - EVP_PKEY_CTX *pctx = CMS_RecipientInfo_get0_pkey_ctx(ri); - EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx); - - EVP_PKEY_get0(pkey); - if (EVP_PKEY_id(pkey) == EVP_PKEY_NONE) { - CMSerr(CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT, - CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); - return 0; - } - } - if (ri->type != CMS_RECIPINFO_AGREE) { CMSerr(CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT, CMS_R_NOT_KEY_AGREEMENT); return 0;
ixfr-out, fix test for nsd-checkzone pre and post.
@@ -7,8 +7,8 @@ Category: Component: Depends: Help: -Pre: ixfrout_checkzone.pre -Post: ixfrout_checkzone.post +Pre: +Post: Test: ixfrout_checkzone.test AuxFiles: ixfrout_checkzone.conf, ixfrout_checkzone.zone, ixfrout_checkzone.zone.old Passed:
Create expected directory.
@@ -287,6 +287,7 @@ jobs: cd $GITHUB_WORKSPACE/tools/ci mkdir build mv actions/docker/* build + mkdir -p build/macosx64 find actions -name '*win_amd64.whl' -exec cp {} build/windows64 \; find actions/macos_amd64 -name '*.jar' -exec cp {} build/macosx64 \; find actions/macos_amd64 -name '*.nupkg' -exec cp {} build/macosx64 \;
util/uut/l_com_port.c: Format with clang-format BRANCH=none TEST=none Tricium: disable
@@ -177,7 +177,8 @@ bool com_config_uart(int h_dev_drv, struct comport_fields com_port_fields) tty.c_cc[VMIN] = 0; /* read doesn't block */ tty.c_cc[VTIME] = 5; /* 0.5 seconds read timeout */ - tty.c_iflag |= (com_port_fields.flow_control == 0x01) ? (IXON | IXOFF) : + tty.c_iflag |= (com_port_fields.flow_control == 0x01) ? + (IXON | IXOFF) : 0x00; /* xon/xoff ctrl */
Timestamp lines using serialdump -T instead of tools/timestamp
@@ -3,7 +3,7 @@ RLWRAPGOALS = login serialdump serialview .PHONY: $(RLWRAPGOALS) BAUDRATE ?= 115200 -TIMESTAMP = $(CONTIKI)/tools/timestamp + ifeq ($(HOST_OS),Windows) SERIALDUMP = $(SERIAL_DUMP_BIN) else @@ -18,10 +18,10 @@ else endif serialdump: $(SERIAL_DUMP_BIN) - $(SERIALDUMP) -b$(BAUDRATE) $(PORT) | $(TIMESTAMP) | tee serialdump-`date +%Y%m%d-%H%M` + $(SERIALDUMP) -b$(BAUDRATE) -T $(PORT) | tee serialdump-`date +%Y%m%d-%H%M` serialview: $(SERIAL_DUMP_BIN) - $(SERIALDUMP) -b$(BAUDRATE) $(PORT) | $(TIMESTAMP) + $(SERIALDUMP) -b$(BAUDRATE) -T $(PORT) login: $(SERIAL_DUMP_BIN) $(SERIALDUMP) -b$(BAUDRATE) $(PORT)
Adds NULL check to http_admin based on review comments
* specific language governing permissions and limitations * under the License. */ -/** - * service_tree.c - * - * \date Jun 19, 2019 - * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ #include <stdlib.h> #include <stdbool.h> //for `bool` @@ -308,7 +301,9 @@ service_tree_node_t *findServiceNodeInTree(service_tree_t *svc_tree, const char char *uri_token = strtok_r(uri_cpy, "/", &save_ptr); //Check for horizontal matches for the first token while (current != NULL) { - if (uri_token != NULL && strcmp(current->svc_data->sub_uri, uri_token) == 0){ + if (uri_token == NULL) { + current = NULL; + } else if (strcmp(current->svc_data->sub_uri, uri_token) == 0){ //Save current node to comply with OSGI Http Whiteboard Specification if (current->svc_data->service != NULL) { found_node = current;
Cr50: preapare to release version 0.4.13 BRANCH=cr50 TEST=none
"timestamp": 0, "epoch": 0, // FWR diversification contributor, 32 bits. "major": 4, // FW2_HIK_CHAIN counter. - "minor": 12, // Mostly harmless version field. + "minor": 13, // Mostly harmless version field. "applysec": -1, // Mask to and with fuse BROM_APPLYSEC. "config1": 13, // Which BROM_CONFIG1 actions to take before launching. "err_response": 0, // Mask to or with fuse BROM_ERR_RESPONSE.
pcnt/driver: Add module reset before enabling
@@ -58,6 +58,11 @@ esp_err_t pcnt_unit_config(const pcnt_config_t *pcnt_config) PCNT_CHECK((pcnt_config->pos_mode < PCNT_COUNT_MAX) && (pcnt_config->neg_mode < PCNT_COUNT_MAX), PCNT_COUNT_MODE_ERR_STR, ESP_ERR_INVALID_ARG); PCNT_CHECK((pcnt_config->hctrl_mode < PCNT_MODE_MAX) && (pcnt_config->lctrl_mode < PCNT_MODE_MAX), PCNT_CTRL_MODE_ERR_STR, ESP_ERR_INVALID_ARG); /*Enalbe hardware module*/ + static bool pcnt_enable = false; + if (pcnt_enable == false) { + periph_module_reset(PERIPH_PCNT_MODULE); + pcnt_enable = true; + } periph_module_enable(PERIPH_PCNT_MODULE); /*Set counter range*/ pcnt_set_event_value(unit, PCNT_EVT_H_LIM, pcnt_config->counter_h_lim);
[RAFT] modify HasWal() to return true even if last entry index is 0
@@ -314,10 +314,12 @@ var ( // 1. compare identity with config // 2. check if hardstate exists // 3. check if last raft entiry index exists +// last entry index can be 0 if first sync has failed func (cdb *ChainDB) HasWal(identity consensus.RaftIdentity) (bool, error) { var ( id *consensus.RaftIdentity last uint64 + hs *raftpb.HardState err error ) @@ -329,7 +331,7 @@ func (cdb *ChainDB) HasWal(identity consensus.RaftIdentity) (bool, error) { return false, ErrWalNotEqualIdentity } - if _, err = cdb.GetHardState(); err != nil { + if hs, err = cdb.GetHardState(); err != nil { return false, err } @@ -337,11 +339,9 @@ func (cdb *ChainDB) HasWal(identity consensus.RaftIdentity) (bool, error) { return false, err } - if last > 0 { - return true, nil - } + logger.Info().Str("identity", id.ToString()).Str("hardstate", types.RaftHardStateToString(*hs)).Uint64("lastidx", last).Msg("existing wal status") - return false, nil + return true, nil } /*
server_queuereader: docu the 10s timeout is equal to socket send timeout
@@ -400,9 +400,12 @@ server_queuereader(void *d) ; /* ignore */ #ifdef TCP_USER_TIMEOUT - /* break out of connections when no ACK is being received for - * +- 10 seconds instead of retransmitting for +- 15 minutes - * available on linux >= 2.6.37 */ + /* break out of connections when no ACK is being + * received for +- 10 seconds instead of + * retransmitting for +- 15 minutes available on + * linux >= 2.6.37 + * the 10 seconds is in line with the SO_SNDTIMEO + * set on the socket below */ args = 10000 + (rand() % 300); if (setsockopt(self->fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &args, sizeof(args)) != 0)
DB/Ruby: few more NULL/Qnil related fixes.
@@ -47,7 +47,7 @@ CRubyMutexImpl::CRubyMutexImpl(bool bIgnore) : m_nLockCount(0), m_valThread(Qnil void CRubyMutexImpl::create() { - if ( !m_bIgnore && !m_valMutex) + if ( !m_bIgnore && ( m_valMutex==Qnil ) ) { unsigned long curThread = rho_ruby_current_thread(); @@ -68,7 +68,7 @@ void CRubyMutexImpl::close() if ( m_valMutex ) { rho_ruby_destroy_mutex(m_valMutex); - m_valMutex = 0; + m_valMutex = Qnil; } }
Fix identify/test page buttons on server home page (Issue
@@ -898,6 +898,7 @@ _papplPrinterWebIteratorCallback( printer_reasons;// Printer state reasons ipp_pstate_t printer_state; // Printer state int printer_jobs; // Number of queued jobs + char uri[256]; // Form URI static const char * const states[] = // State strings { "Idle", @@ -927,6 +928,8 @@ _papplPrinterWebIteratorCallback( printer_state = papplPrinterGetState(printer); printer_reasons = papplPrinterGetReasons(printer); + snprintf(uri, sizeof(uri), "%s/", printer->uriname); + if (!strcmp(client->uri, "/") && (client->system->options & PAPPL_SOPTIONS_MULTI_QUEUE)) papplClientHTMLPrintf(client, " <h2 class=\"title\"><a href=\"%s/\">%s</a> <a class=\"btn\" href=\"https://%s:%d%s/delete\">Delete</a></h2>\n", printer->uriname, printer->name, client->host_field, client->host_port, printer->uriname); @@ -953,13 +956,13 @@ _papplPrinterWebIteratorCallback( if (printer->driver_data.identify_supported) { - papplClientHTMLStartForm(client, client->uri, false); + papplClientHTMLStartForm(client, uri, false); papplClientHTMLPrintf(client, "<input type=\"hidden\" name=\"action\" value=\"identify-printer\"><input type=\"submit\" value=\"Identify Printer\"></form>"); } if (printer->driver_data.testpage_cb) { - papplClientHTMLStartForm(client, client->uri, false); + papplClientHTMLStartForm(client, uri, false); papplClientHTMLPrintf(client, "<input type=\"hidden\" name=\"action\" value=\"print-test-page\"><input type=\"submit\" value=\"Print Test Page\"></form>"); }
typechecker-prototype: fix typo
@@ -91,7 +91,7 @@ type family TypeFinalizer (a :: BaseType) :: BaseType where TypeFinalizer ('TyLft a b c) = ('TyLft a b (TypeFinalizer c)) TypeFinalizer a = a --- meaing of the rules from top to bottom: +-- meaning of the rules from top to bottom: -- We can't assign anything to out types -- If the second one has no information yet, we ignore it and stick to the current one -- The first type has absolutely no information yet, so it will use the type of the second
Update SceKernelFaultingProcessInfo Document missing field of SceKernelFaultingProcessInfo. Found by reversing a SceDeci4p module, as evidenced by the following code: ```c SceKernelFaultingProcessInfo fpi; ksceKernelGetFaultingProcess(&fpi); SceUID usrthid = sceKernelGetUserThreadId(fpi.unk); ```
@@ -110,7 +110,7 @@ typedef enum SceThreadStatus { typedef struct SceKernelFaultingProcessInfo { SceUID pid; - uint32_t unk; + SceUID faultingThreadId; //!< Kernel UID of the faulting thread } SceKernelFaultingProcessInfo; /** @@ -1084,4 +1084,3 @@ int ksceKernelCancelMsgPipe(SceUID uid, int *psend, int *precv); #endif #endif /* _PSP2_KERNEL_THREADMGR_H_ */ -
Physics shape dimensions must be positive; Or the world will explode. That would be bad.
@@ -926,6 +926,7 @@ void lovrShapeGetAABB(Shape* shape, float aabb[6]) { } SphereShape* lovrSphereShapeCreate(float radius) { + lovrCheck(radius > 0.f, "SphereShape radius must be positive"); SphereShape* sphere = calloc(1, sizeof(SphereShape)); lovrAssert(sphere, "Out of memory"); sphere->ref = 1; @@ -940,6 +941,7 @@ float lovrSphereShapeGetRadius(SphereShape* sphere) { } void lovrSphereShapeSetRadius(SphereShape* sphere, float radius) { + lovrCheck(radius > 0.f, "SphereShape radius must be positive"); dGeomSphereSetRadius(sphere->id, radius); } @@ -962,10 +964,12 @@ void lovrBoxShapeGetDimensions(BoxShape* box, float* x, float* y, float* z) { } void lovrBoxShapeSetDimensions(BoxShape* box, float x, float y, float z) { + lovrCheck(x > 0.f && y > 0.f && z > 0.f, "BoxShape dimensions must be positive"); dGeomBoxSetLengths(box->id, x, y, z); } CapsuleShape* lovrCapsuleShapeCreate(float radius, float length) { + lovrCheck(radius > 0.f && length > 0.f, "CapsuleShape dimensions must be positive"); CapsuleShape* capsule = calloc(1, sizeof(CapsuleShape)); lovrAssert(capsule, "Out of memory"); capsule->ref = 1; @@ -982,6 +986,7 @@ float lovrCapsuleShapeGetRadius(CapsuleShape* capsule) { } void lovrCapsuleShapeSetRadius(CapsuleShape* capsule, float radius) { + lovrCheck(radius > 0.f, "CapsuleShape dimensions must be positive"); dGeomCapsuleSetParams(capsule->id, radius, lovrCapsuleShapeGetLength(capsule)); } @@ -992,10 +997,12 @@ float lovrCapsuleShapeGetLength(CapsuleShape* capsule) { } void lovrCapsuleShapeSetLength(CapsuleShape* capsule, float length) { + lovrCheck(length > 0.f, "CapsuleShape dimensions must be positive"); dGeomCapsuleSetParams(capsule->id, lovrCapsuleShapeGetRadius(capsule), length); } CylinderShape* lovrCylinderShapeCreate(float radius, float length) { + lovrCheck(radius > 0.f && length > 0.f, "CylinderShape dimensions must be positive"); CylinderShape* cylinder = calloc(1, sizeof(CylinderShape)); lovrAssert(cylinder, "Out of memory"); cylinder->ref = 1; @@ -1012,6 +1019,7 @@ float lovrCylinderShapeGetRadius(CylinderShape* cylinder) { } void lovrCylinderShapeSetRadius(CylinderShape* cylinder, float radius) { + lovrCheck(radius > 0.f, "CylinderShape dimensions must be positive"); dGeomCylinderSetParams(cylinder->id, radius, lovrCylinderShapeGetLength(cylinder)); } @@ -1022,6 +1030,7 @@ float lovrCylinderShapeGetLength(CylinderShape* cylinder) { } void lovrCylinderShapeSetLength(CylinderShape* cylinder, float length) { + lovrCheck(length > 0.f, "CylinderShape dimensions must be positive"); dGeomCylinderSetParams(cylinder->id, lovrCylinderShapeGetRadius(cylinder), length); }
tools: Improve the error message for handling NotImplementedError on Windows
@@ -8,7 +8,7 @@ import sys from asyncio.subprocess import Process from io import open from types import FunctionType -from typing import Any, Dict, List, Optional, TextIO, Tuple +from typing import Any, Dict, List, Optional, TextIO, Tuple, Union import click import yaml @@ -143,7 +143,12 @@ class RunTool: env_copy = dict(os.environ) env_copy.update(self.env or {}) + process: Union[Process, subprocess.CompletedProcess[bytes]] + if self.hints: process, stderr_output_file, stdout_output_file = asyncio.run(self.run_command(self.args, env_copy)) + else: + process = subprocess.run(self.args, env=env_copy, cwd=self.cwd) + stderr_output_file, stdout_output_file = None, None if process.returncode == 0: return @@ -161,10 +166,6 @@ class RunTool: async def run_command(self, cmd: List, env_copy: Dict) -> Tuple[Process, Optional[str], Optional[str]]: """ Run the `cmd` command with capturing stderr and stdout from that function and return returncode and of the command, the id of the process, paths to captured output """ - if not self.hints: - p = await asyncio.create_subprocess_exec(*cmd, env=env_copy, cwd=self.cwd) - await p.wait() # added for avoiding None returncode - return p, None, None log_dir_name = 'log' try: os.mkdir(os.path.join(self.build_dir, log_dir_name)) @@ -172,8 +173,12 @@ class RunTool: pass # Note: we explicitly pass in os.environ here, as we may have set IDF_PATH there during startup # limit was added for avoiding error in idf.py confserver + try: p = await asyncio.create_subprocess_exec(*cmd, env=env_copy, limit=1024 * 256, cwd=self.cwd, stdout=asyncio.subprocess.PIPE, - stderr=asyncio.subprocess.PIPE, ) + stderr=asyncio.subprocess.PIPE) + except NotImplementedError: + sys.exit(f'ERROR: {sys.executable} doesn\'t support asyncio. The issue can be worked around by re-running idf.py with the "--no-hints" argument.') + stderr_output_file = os.path.join(self.build_dir, log_dir_name, f'idf_py_stderr_output_{p.pid}') stdout_output_file = os.path.join(self.build_dir, log_dir_name, f'idf_py_stdout_output_{p.pid}') if p.stderr and p.stdout: # it only to avoid None type in p.std
Add a yy arg to writeReadUxxAsUyy
@@ -606,7 +606,7 @@ func (g *gen) writeBuiltinQuestionCall(b *buffer, n *a.Expr, depth uint32) error if method.Ident() >= readMethodsBase { if m := method.Ident() - readMethodsBase; m < t.ID(len(readMethods)) { if p := readMethods[m]; p.n != 0 { - return g.writeReadUXX(b, n, "a_src", p.n, p.endianness) + return g.writeReadUxxAsUyy(b, n, "a_src", p.n, p.size, p.endianness) } } } @@ -628,9 +628,9 @@ func (g *gen) writeBuiltinQuestionCall(b *buffer, n *a.Expr, depth uint32) error return errNoSuchBuiltin } -func (g *gen) writeReadUXX(b *buffer, n *a.Expr, preName string, size uint8, endianness uint8) error { - if (size&7 != 0) || (size < 16) || (size > 64) { - return fmt.Errorf("internal error: bad writeReadUXX size %d", size) +func (g *gen) writeReadUxxAsUyy(b *buffer, n *a.Expr, preName string, xx uint8, yy uint8, endianness uint8) error { + if (xx&7 != 0) || (xx < 16) || (xx > 64) { + return fmt.Errorf("internal error: bad writeReadUXX size %d", xx) } if endianness != 'b' && endianness != 'l' { return fmt.Errorf("internal error: bad writeReadUXX endianness %q", endianness) @@ -652,9 +652,9 @@ func (g *gen) writeReadUXX(b *buffer, n *a.Expr, preName string, size uint8, end scratchName := fmt.Sprintf("self->private_impl.%s%s[0].scratch", cPrefix, g.currFunk.astFunc.FuncName().Str(g.tm)) - b.printf("if (WUFFS_BASE__LIKELY(io1_a_src - iop_a_src >= %d)) {", size/8) - b.printf("%s%d = wuffs_base__load_u%d%ce(iop_a_src);\n", tPrefix, temp, size, endianness) - b.printf("iop_a_src += %d;\n", size/8) + b.printf("if (WUFFS_BASE__LIKELY(io1_a_src - iop_a_src >= %d)) {", xx/8) + b.printf("%s%d = wuffs_base__load_u%d%ce(iop_a_src);\n", tPrefix, temp, xx, endianness) + b.printf("iop_a_src += %d;\n", xx/8) b.printf("} else {") b.printf("%s = 0;\n", scratchName) if err := g.writeCoroSuspPoint(b, false); err != nil { @@ -679,10 +679,10 @@ func (g *gen) writeReadUXX(b *buffer, n *a.Expr, preName string, size uint8, end iopPrefix, preName, temp) } - b.printf("if (num_bits_%d == %d) {", temp, size-8) + b.printf("if (num_bits_%d == %d) {", temp, xx-8) switch endianness { case 'b': - b.printf("%s%d = *scratch >> (64 - %d);", tPrefix, temp, size) + b.printf("%s%d = *scratch >> (64 - %d);", tPrefix, temp, xx) case 'l': b.printf("%s%d = *scratch;", tPrefix, temp) }
Fix test_good_cdata_utf16() to work for builds (ironicly)
@@ -2298,7 +2298,7 @@ START_TEST(test_good_cdata_utf16) " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0""1\0""6\0'" "\0?\0>\0\n" "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0[\0h\0e\0l\0l\0o\0]\0]\0>\0<\0/\0a\0>"; - const char *expected = "hello"; + const XML_Char *expected = XCS("hello"); CharData storage; CharData_Init(&storage);
gftp-gtk.c: avoid widget->allocation.* not compatible with gtk3 use gtk_widget_get_allocation()
@@ -60,20 +60,25 @@ get_column (GtkCListColumn * col) static void _gftp_exit (GtkWidget * widget, gpointer data) { - intptr_t remember_last_directory; + intptr_t remember_last_directory, ret; const char *tempstr; - intptr_t ret; - - ret = GTK_WIDGET (local_frame)->allocation.width; - gftp_set_global_option ("listbox_local_width", GINT_TO_POINTER (ret)); - ret = GTK_WIDGET (remote_frame)->allocation.width; - gftp_set_global_option ("listbox_remote_width", GINT_TO_POINTER (ret)); - ret = GTK_WIDGET (remote_frame)->allocation.height; - gftp_set_global_option ("listbox_file_height", GINT_TO_POINTER (ret)); - ret = GTK_WIDGET (log_scroll)->allocation.height; - gftp_set_global_option ("log_height", GINT_TO_POINTER (ret)); - ret = GTK_WIDGET (transfer_scroll)->allocation.height; - gftp_set_global_option ("transfer_height", GINT_TO_POINTER (ret)); + GtkAllocation allocation; + + gtk_widget_get_allocation (GTK_WIDGET (local_frame), &allocation); + gftp_set_global_option ("listbox_local_width", + GINT_TO_POINTER ((intptr_t) allocation.width)); + gtk_widget_get_allocation (GTK_WIDGET (remote_frame), &allocation); + gftp_set_global_option ("listbox_remote_width", + GINT_TO_POINTER ((intptr_t) allocation.width)); + gtk_widget_get_allocation (GTK_WIDGET (remote_frame), &allocation); + gftp_set_global_option ("listbox_file_height", + GINT_TO_POINTER ((intptr_t) allocation.height)); + gtk_widget_get_allocation (GTK_WIDGET (log_scroll), &allocation); + gftp_set_global_option ("log_height", + GINT_TO_POINTER ((intptr_t) allocation.height)); + gtk_widget_get_allocation (GTK_WIDGET (transfer_scroll), &allocation); + gftp_set_global_option ("transfer_height", + GINT_TO_POINTER ((intptr_t) allocation.height)); listbox_save_column_width (&window1, &window2);
Removed pragma defines that were mistakenly left in
-#if defined(__GNUC__) -#pragma GCC diagnostic warning "-Wall" -#pragma GCC diagnostic warning "-Wextra" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - /* swTimer.c SDK timer suspend API * * SDK software timer API info:
Tools: Add OpenOCD for the ARM architecture
{ "install": "on_request", "platforms": [ - "linux-armel", "linux-i686" ] } "size": 1675213, "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20190708/openocd-esp32-linux64-0.10.0-esp32-20190708.tar.gz" }, + "linux-armel": { + "sha256": "f3f01d2b0ec440127b8951b82ee79dd04b9d2774bab4de741067c5f65cffaa7e", + "size": 1729130, + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20190708/openocd-esp32-armel-0.10.0-esp32-20190708.tar.gz" + }, "macos": { "sha256": "840c94ce6208c5b21d0ba6c3113a06405daf6b27085a287cfbb6c9d21e80bd70", "size": 1760060,
JANITORIAL: (fpe.h) Correct spelling mistake in comments
@@ -193,7 +193,7 @@ typedef struct fpe_state_s { typedef struct fpe_fpe_s { GLuint frag, vert, prog; // shader info - fpe_state_t state; // state relevent to the current fpe program + fpe_state_t state; // state relevant to the current fpe program program_t *glprogram; } fpe_fpe_t;
PAPI: Remove logging calls from pack/unpack This slowed down the decoder. Improved from 16s to 13s for 1000 dump/details messages.
@@ -45,11 +45,9 @@ class BaseTypes(): .format(type, base_types[type])) def pack(self, data, kwargs=None): - logger.debug("Data: {} Format: {}".format(data, self.packer.format)) return self.packer.pack(data) def unpack(self, data, offset, result=None): - logger.debug("@ {} Format: {}".format(offset, self.packer.format)) return self.packer.unpack_from(data, offset)[0] @@ -72,8 +70,6 @@ class FixedList_u8(): def pack(self, list, kwargs): """Packs a fixed length bytestring. Left-pads with zeros if input data is too short.""" - logger.debug("Data: {}".format(list)) - if len(list) > self.num: raise ValueError('Fixed list length error for "{}", got: {}' ' expected: {}' @@ -95,8 +91,6 @@ class FixedList(): self.size = self.packer.size * num def pack(self, list, kwargs): - logger.debug("Data: {}".format(list)) - if len(list) != self.num: raise ValueError('Fixed list length error, got: {} expected: {}' .format(len(list), self.num)) @@ -123,7 +117,6 @@ class VLAList(): self.length_field = len_field_name def pack(self, list, kwargs=None): - logger.debug("Data: {}".format(list)) if len(list) != kwargs[self.length_field]: raise ValueError('Variable length error, got: {} expected: {}' .format(len(list), kwargs[self.length_field])) @@ -138,8 +131,6 @@ class VLAList(): return b def unpack(self, data, offset=0, result=None): - logger.debug("Data: {} @ {} Result: {}" - .format(list, offset, result[self.index])) # Return a list of arguments # u8 array @@ -164,8 +155,6 @@ class VLAList_legacy(): self.size = self.packer.size def pack(self, list, kwargs=None): - logger.debug("Data: {}".format(list)) - if self.packer.size == 1: return bytes(list) @@ -180,8 +169,6 @@ class VLAList_legacy(): raise ValueError('Legacy Variable Length Array length mismatch.') elements = int((len(data) - offset) / self.packer.size) r = [] - logger.debug("Legacy VLA: {} elements of size {}" - .format(elements, self.packer.size)) for e in range(elements): x = self.packer.unpack(data, offset) r.append(x) @@ -208,7 +195,6 @@ class VPPEnumType(): return self.enum[name] def pack(self, data, kwargs=None): - logger.debug("Data: {}".format(data)) return types['u32'].pack(data, kwargs) def unpack(self, data, offset=0, result=None): @@ -243,7 +229,6 @@ class VPPUnionType(): logger.debug('Adding union {}'.format(name)) def pack(self, data, kwargs=None): - logger.debug("Data: {}".format(data)) for k, v in data.items(): logger.debug("Key: {} Value: {}".format(k, v)) b = self.packers[k].pack(v, kwargs) @@ -312,12 +297,9 @@ class VPPType(): def pack(self, data, kwargs=None): if not kwargs: kwargs = data - logger.debug("Data: {}".format(data)) b = bytes() for i, a in enumerate(self.fields): if a not in data: - logger.debug("Argument {} not given, defaulting to 0" - .format(a)) b += b'\x00' * self.packers[i].size continue
Defensive checking the file parse state of external scan It triggered a SEGV on 6X by eager-free before, we are safe now, just defensive check it here.
@@ -318,6 +318,11 @@ external_rescan(FileScanDesc scan) /* The first call to external_getnext will re-open the scan */ + if (!scan->fs_pstate) + ereport(ERROR, + (errcode(ERRCODE_INTERNAL_ERROR), + errmsg("The file parse state of external scan is invalid"))); + /* reset some parse state variables */ scan->fs_pstate->reached_eof = false; scan->fs_pstate->cur_lineno = 0;
confirm defaults for optionsal protocol values Also added some comments to explain the test.
@@ -1912,16 +1912,17 @@ cfgReadProtocol(void **state) // protocol config in yaml format const char *yamlText = "protocol:\n" + // the 1st should load with non-default binary and len values " - name: test1\n" " binary: 'true'\n" " regex: 'sup?'\n" " len: 111\n" "\n" + // the 2rd should load with defaults for non-required values " - name: test2\n" - " binary: 'false'\n" " regex: 'sup up?'\n" - " len: 222\n" "\n" + // the 3rd should load with all values specified " - name: test3\n" " binary: false\n" " regex: 'sup er?'\n" @@ -1944,7 +1945,7 @@ cfgReadProtocol(void **state) char *name[3] = {"test1", "test2", "test3"}; char *regex[3] = {"sup?", "sup up?", "sup er?"}; int binary[3] = {1, 0, 0}; - int len[3] = {111, 222, 333}; + int len[3] = {111, 0, 333}; int detect[3] = {1, 1, 0}; int payload[3] = {0, 0, 1};
subproc: _exit -> exit to make sure logs are written
@@ -250,7 +250,7 @@ static bool subproc_New(honggfuzz_t * hfuzz, fuzzer_t * fuzzer) if (!arch_launchChild(hfuzz, fuzzer->fileName)) { LOG_E("Error launching child process"); kill(hfuzz->mainPid, SIGTERM); - _exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } abort(); }
more fixes to routing and sending
:: TODO: don't coerce the old state :: ++ scry scry:adult-core - ++ stay ~& %alef-larva-stay [queued-events ames-state.adult-gate] + ++ stay ~& %alef-larva-stay [%larva queued-events ames-state.adult-gate] ++ load - |= old=* - ^+ larval-gate + |= old-raw=* ~& %alef-larva-load - => .(old ;;(_[queued-events ames-state.adult-gate] old)) :: - =. queued-events -.old - =. adult-gate (load:adult-core +.old) + =/ old + ;; $% [%larva events=_queued-events state=_ames-state.adult-gate] + [%adult state=_ames-state.adult-gate] + == + old-raw + :: + ?- -.old + %adult + (load:adult-core state.old) + :: + %larva + =. queued-events events.old + =. adult-gate (load:adult-core state.old) larval-gate + == -- :: adult ames, after metamorphosis from larva :: =/ =task ?. ?=(%soft -.wrapped-task) wrapped-task + ~| %alef-bad-task^p.wrapped-task ;;(task p.wrapped-task) :: =/ event-core (per-event [our now eny scry-gate] duct ames-state) [moves ames-gate] :: +stay: extract state before reload :: -++ stay ames-state +++ stay [%adult ames-state] :: +load: load in old state after reload :: ++ load - |= old=^ames-state - ames-gate(ames-state old) + |= old-state=_ames-state + ames-gate(ames-state old-state) :: +scry: dereference namespace :: ++ scry =. life.peer-state life =. public-key.peer-state public-key =. symmetric-key.peer-state symmetric-key + :: automatically set galaxy route, since unix handles lookup + :: + =? route.peer-state ?=(%czar (clan:title ship)) + `[direct=%.y lane=[%& ship]] :: =. peers.ames-state (~(put by peers.ames-state) ship %known peer-state) :: valid. :: =? route.peer-state - &(?=(^ route.peer-state) direct.u.route.peer-state) + ?& ?=(^ route.peer-state) + direct.u.route.peer-state + !=(%czar (clan:title her.channel)) + == route.peer-state(direct.u %.n) :: (run-message-pump bone %wake ~)
Correction to allocations.
@@ -25132,7 +25132,7 @@ void check_damage_recursive(s_entity *ent, s_entity *other, s_collision_attack * ent->recursive_damage_count++; // Add an element to array. - ent->recursive_damage = (s_damage_recursive *)realloc(ent->recursive_damage, sizeof(*ent->recursive_damage) * ent->recursive_damage_count); + ent->recursive_damage = (ent->recursive_damage **)realloc(ent->recursive_damage, sizeof(ent->recursive_damage *) * ent->recursive_damage_count); // Allocate memory for the element data. ent->recursive_damage[ent->recursive_damage_count - 1] = (ent->recursive_damage *)malloc(sizeof(ent->recursive_damage));
refine readme sentences
@@ -24,9 +24,9 @@ For convenience, you can alternatively run the `make.sh` script. - CMake for generating the build files - Python 3 for the [code generator](https://github.com/toru/h2olog/blob/v2/misc/gen-quic-bpf.py) - [BCC](https://iovisor.github.io/bcc/) (>= 0.11.0) [installed](https://github.com/iovisor/bcc/blob/master/INSTALL.md) on your system -- systemtap for Linux to enable DTrace for H2O +- [SystemTap](https://sourceware.org/systemtap/) for DTrace shim to build H2O with DTrace support -If you use Ubuntu 20.04 or later, you can install dependencies with `apt`: +For Ubuntu 20.04 or later, you can install dependencies with: ```sh sudo apt install clang cmake python3 systemtap-sdt-dev libbpfcc-dev linux-headers-$(uname -r)
esp32/modules: On initial setup mount internal flash at root. Like it's done on normal boot up. Fixes issue
@@ -29,8 +29,7 @@ def setup(): print("Performing initial setup") uos.VfsFat.mkfs(bdev) vfs = uos.VfsFat(bdev) - uos.mount(vfs, '/flash') - uos.chdir('/flash') + uos.mount(vfs, '/') with open("boot.py", "w") as f: f.write("""\ # This file is executed on every boot (including wake-boot from deepsleep)
Disable EXPRECISION for the combination of DYNAMIC_CORE and GENERIC target
@@ -84,6 +84,10 @@ if (X86) set(NO_EXPRECISION 1) endif () +if ((DYNAMIC_ARCH) AND (${TARGET} STREQUAL "GENERIC)) + set(NO_EXPRECISION 1) +endif () + if (UTEST_CHECK) set(CCOMMON_OPT "${CCOMMON_OPT} -DUTEST_CHECK") set(SANITY_CHECK 1)
Prevent occurence of UndefinedBehaviorSanitizer in stb_image
@@ -1495,7 +1495,7 @@ static int stbi__get16le(stbi__context *s) static stbi__uint32 stbi__get32le(stbi__context *s) { stbi__uint32 z = stbi__get16le(s); - return z + (stbi__get16le(s) << 16); + return z + ((stbi__uint32)stbi__get16le(s) << 16); } #endif
fix verbose ctest on mac pipeline
@@ -130,8 +130,7 @@ jobs: # displayName: CTest - script: | cd $(BuildType) - export MIMALLOC_VERBOSE=1 - ctest --verbose --timeout 120 + MIMALLOC_VERBOSE=1 ctest --verbose --timeout 120 displayName: CTest # - upload: $(Build.SourcesDirectory)/$(BuildType) # artifact: mimalloc-macos-$(BuildType)
changed README to use mirror process. We are going to use git and abandon the patch process. The current branch trunk_17.0-0 already contains the initial three patches
@@ -9,7 +9,9 @@ Then log in again. mkdir -p $TRUNK_REPOS cd $TRUNK_REPOS git clone https://github.com/ROCm-Developer-Tools/aomp -git clone https://github.com/llvm/llvm-project +git clone https://github.com/ROCm-Developer-Tools/llvm-project +cd llvm-project +git checkout trunk_17.0-0 $TRUNK_REPOS/aomp/trunk/build_trunk.sh The script build_trunk.sh will install trunk into $HOME/rocm/trunk_17.0-0 @@ -20,15 +22,15 @@ At various development check points we will qualify releases of trunk17 and increment the development version in trunk_common_vars. For example, after the release of trunk_17.0-0, development will move to trunk_17.0-1. and the scripts will install into $HOME/rocm/trunk_17.0-0 and the -symbolic link from $HOME/rocm/trunk will changes. +symbolic link from $HOME/rocm/trunk will changes. At that time, +a new development branch will also be created to track the next +qualified release. In the future, there will be a new clone_trunk.sh script that will clone or pull updates on all the repos in $TRUNK_REPOS except aomp. This will be similar to the clone_aomp.sh script used for aomp. For now, other than the build scripts in the aomp repo, there is only a single repo (llvm-project) needed to build_trunk.sh. -To save time, instead of cloning a new trunk repo, you can move or -copy your current trunk repo to $TRUNK_REPOS/llvm-project. To use the various AOMP testing infrastructure in $TRUNK_REPOS/aomp/test export AOMP=$HOME/rocm/trunk
revise changelog updates per MK review
@@ -12,8 +12,9 @@ This pre-release addresses the following issues: - **Improvement**: [#267](https://github.com/criblio/appscope/issues/267),[#256](https://github.com/criblio/appscope/issues/256) Add support for attaching AppScope to a running process - **Improvement**: [#292](https://github.com/criblio/appscope/issues/292) Add support for attaching AppScope to a running process from the CLI +- **Improvement**: [#143](https://github.com/criblio/appscope/issues/143) Add support for the Alpine Linux distribution, including support for musl libc (the compact glibc alternative on which Alpine and some other Linux distributions are based) - **Improvement**: [#286](https://github.com/criblio/appscope/issues/286) Add support for TLS over TCP connections, with new TLS-related environment variables shown by the command `ldscope --help configuration | grep TLS` -- **Improvement**: [#286](https://github.com/criblio/appscope/issues/286) Drop support for CentOS 6, because TLS support requires GLIBC_2.17 or newer, and CentOS 6 is stalled at GLIBC_2.12 +- **Deprecation**: [#286](https://github.com/criblio/appscope/issues/286) Dropped support for CentOS 6 (because TLS support requires glibc 2.17 or newer) - **Improvement**: [#132](https://github.com/criblio/appscope/issues/132) Add new `scope logs` command to view logs from the CLI - **Improvement**: Add new `--interval` option to `scope watch` command to run AppScope at intervals, from the CLI - **Improvement**: Make developer docs available at https://github.com/criblio/appscope/tree/master/docs
Add continue to docs
@@ -72,6 +72,20 @@ for (var i = 0; i < 10; ++i) { } ``` +## Continue statement + +Continue allows execution of a loop to restart prematurely. + +```js +// For loop +for (var i = 0; i < 10; ++i) { + if (i % 2 == 0) + continue; // Skip all even numbers + + print(i); // Only odd numbers will be printed +} +``` + ## Functions ```python
zephyr: Add dummies for a few more task functions These need to be implemented properly, or another way found. For now, add stubs. BRANCH=none TEST=with other CLs, build asurada for Zephyr
@@ -293,3 +293,18 @@ int task_start_called(void) { return tasks_started; } + +void task_disable_task(task_id_t tskid) +{ + /* TODO(b/190203712): Implement this */ +} + +void task_clear_pending_irq(int irq) +{ + /* TODO(b/190203712): Implement this */ +} + +void task_enable_irq(int irq) +{ + /* TODO(b/190203712): Implement this */ +}
Test handling of CDATA in an external entity parser
@@ -2635,6 +2635,52 @@ START_TEST(test_ext_entity_trailing_rsqb) } END_TEST +/* Test CDATA handling in an external entity */ +static int XMLCALL +external_entity_good_cdata_ascii(XML_Parser parser, + const XML_Char *context, + const XML_Char *UNUSED_P(base), + const XML_Char *UNUSED_P(systemId), + const XML_Char *UNUSED_P(publicId)) +{ + const char *text = + "<a><![CDATA[<greeting>Hello, world!</greeting>]]></a>"; + const char *expected = "<greeting>Hello, world!</greeting>"; + CharData storage; + XML_Parser ext_parser; + + CharData_Init(&storage); + ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL); + if (ext_parser == NULL) + fail("Could not create external entity parser"); + XML_SetUserData(ext_parser, &storage); + XML_SetCharacterDataHandler(ext_parser, accumulate_characters); + + if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text), + XML_TRUE) == XML_STATUS_ERROR) + xml_failure(ext_parser); + CharData_CheckXMLChars(&storage, expected); + + return XML_STATUS_OK; +} + +START_TEST(test_ext_entity_good_cdata) +{ + const char *text = + "<!DOCTYPE doc [\n" + " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n" + "]>\n" + "<doc>&en;</doc>"; + + XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS); + XML_SetExternalEntityRefHandler(parser, + external_entity_good_cdata_ascii); + if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), + XML_TRUE) != XML_STATUS_OK) + xml_failure(parser); +} +END_TEST + /* Test user parameter settings */ /* Variable holding the expected handler userData */ static void *handler_data = NULL; @@ -5089,6 +5135,7 @@ make_suite(void) tcase_add_test(tc_basic, test_ext_entity_trailing_cr); tcase_add_test(tc_basic, test_trailing_rsqb); tcase_add_test(tc_basic, test_ext_entity_trailing_rsqb); + tcase_add_test(tc_basic, test_ext_entity_good_cdata); tcase_add_test(tc_basic, test_user_parameters); tcase_add_test(tc_basic, test_ext_entity_ref_parameter); tcase_add_test(tc_basic, test_empty_parse);
doc: add menu option for 0.5 docs Add option in side-bar menu for 0.5 doc version
@@ -189,6 +189,7 @@ else: html_context = { 'current_version': current_version, 'versions': ( ("latest", "/latest/"), + ("0.5", "/0.5/"), ("0.4", "/0.4/"), ("0.3", "/0.3/"), ("0.2", "/0.2/"),
Improve output of GCC size
@@ -95,7 +95,7 @@ function(NF_PRINT_SIZE_OF_TARGETS TARGET) else() set(FILENAME "${TARGET}") endif() - add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_SIZE} ${FILENAME}) + add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_SIZE} -A -x ${FILENAME}) endfunction()
Directory Value: Improve performance slightly
@@ -215,8 +215,8 @@ KeySetPair splitArrayParentsOther (CppKeySet const & keys) for (previous = keys.next (); keys.next (); previous = keys.current ()) { bool const previousIsArray = - previous.hasMeta ("array") || - (keys.current ().isBelow (previous) && keys.current ().getBaseName ()[0] == '#' && isArrayParent (previous, keys)); + previous.hasMeta ("array") || (keys.current ().isDirectBelow (previous) && + keys.current ().getBaseName ()[0] == '#' && isArrayParent (previous, keys)); (previousIsArray ? arrayParents : others).append (previous); }
Add a TODO around validating the ticket age
@@ -711,6 +711,8 @@ int tls_parse_ctos_psk(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) return 0; } + /* TODO(TLS1.3): Should we validate the ticket age? */ + ret = tls_decrypt_ticket(s, PACKET_data(&identity), PACKET_remaining(&identity), NULL, 0, &sess); if (ret == TICKET_FATAL_ERR_MALLOC || ret == TICKET_FATAL_ERR_OTHER) {
Add trayicon overlapped activation (fix by soho)
@@ -2009,6 +2009,36 @@ BOOLEAN PhMwpExecuteComputerCommand( return FALSE; } +BOOL PhMwpIsWindowOverlapped( + _In_ HWND WindowHandle + ) +{ + RECT rectThisWindow = { 0 }; + RECT rectOtherWindow = { 0 }; + RECT rectIntersection = { 0 }; + HWND windowHandle = WindowHandle; + + if (!GetWindowRect(WindowHandle, &rectThisWindow)) + return FALSE; + + while ((windowHandle = GetWindow(windowHandle, GW_HWNDPREV)) && windowHandle != WindowHandle) + { + if (!(PhGetWindowStyle(windowHandle) & WS_VISIBLE)) + continue; + + if (!GetWindowRect(windowHandle, &rectOtherWindow)) + continue; + + if (!(PhGetWindowStyleEx(windowHandle) & WS_EX_TOPMOST) && + IntersectRect(&rectIntersection, &rectThisWindow, &rectOtherWindow)) + { + return TRUE; + } + } + + return FALSE; +} + VOID PhMwpActivateWindow( _In_ HWND WindowHandle, _In_ BOOLEAN Toggle @@ -2021,7 +2051,7 @@ VOID PhMwpActivateWindow( } else if (IsWindowVisible(WindowHandle)) { - if (Toggle) + if (Toggle && !PhMwpIsWindowOverlapped(WindowHandle)) ShowWindow(WindowHandle, SW_HIDE); else SetForegroundWindow(WindowHandle);
[dpos] fix lib status rollback + prevent panic
@@ -241,13 +241,14 @@ func (pls *pLibStatus) rebuildConfirms(decCounts map[uint64]uint16) { c := cInfo(e) if dec, exist := decCounts[c.BlockNo]; exist { if c.confirmsLeft < dec { - errMsg := "the restored confirm info is inconsistent" - logger.Debug(). - Uint16("confirm left", c.confirmsLeft).Uint16("", dec). - Msg(errMsg) - panic(errMsg) - } + logger.Debug().Uint64("block no", c.BlockNo). + Uint16("confirm left", c.confirmsLeft).Uint16("dec count", dec). + Msg("dec count higher than confirm left") + c.confirmsLeft = 0 + } else { c.confirmsLeft = c.confirmsLeft - dec + } + if c.confirmsLeft == 0 { lastUndoElem = e } @@ -258,7 +259,7 @@ func (pls *pLibStatus) rebuildConfirms(decCounts map[uint64]uint16) { if lastUndoElem != nil { forEachUntil(pls.confirms, lastUndoElem, func(e *list.Element) { - pls.moveToUndo(e) + pls.moveToUndoBack(e) }, ) } @@ -298,6 +299,15 @@ func (pls *pLibStatus) rollbackPreLIB(c *confirmInfo) { } } +func (pls *pLibStatus) moveToUndoBack(e *list.Element) { + moveElemBack(e, pls.confirms, pls.undo) +} + +func moveElemBack(e *list.Element, src *list.List, dst *list.List) { + src.Remove(e) + dst.PushBack(e.Value) +} + func (pls *pLibStatus) moveToUndo(e *list.Element) { moveElem(e, pls.confirms, pls.undo) }
Cleanup +find-or-create-ship-state
::+| :: ++ this . +:: +find-or-create-ship-state: find or create a ford-state for a @p +:: +:: Accesses and modifies :state-by-ship. :: ++ find-or-create-ship-state |= our=@p ^- [ford-state _state-by-ship] + :: =/ existing (~(get by state-by-ship) our) - ?^ existing [u.existing state-by-ship] - =? state-by-ship - !(~(has by state-by-ship) our) - (~(put by state-by-ship) our *ford-state) - [(~(got by state-by-ship) our) state-by-ship] + ?^ existing + [u.existing state-by-ship] + :: + =| new-state=ford-state + [new-state (~(put by state-by-ship) our new-state)] --
common:test: Add comparators to test_util.h Add <, <=, >, >= tests to test_util.h BRANCH=None TEST=buildall
#define TEST_EQ(a, b, fmt) TEST_OPERATOR(a, b, ==, fmt) #define TEST_NE(a, b, fmt) TEST_OPERATOR(a, b, !=, fmt) +#define TEST_LT(a, b, fmt) TEST_OPERATOR(a, b, <, fmt) +#define TEST_LE(a, b, fmt) TEST_OPERATOR(a, b, <=, fmt) +#define TEST_GT(a, b, fmt) TEST_OPERATOR(a, b, >, fmt) +#define TEST_GE(a, b, fmt) TEST_OPERATOR(a, b, >=, fmt) #define TEST_BITS_SET(a, bits) TEST_OPERATOR(a & (int)bits, (int)bits, ==, "%u") #define TEST_BITS_CLEARED(a, bits) TEST_OPERATOR(a & (int)bits, 0, ==, "%u")
Remove an out of date TODO
@@ -393,11 +393,6 @@ static int add_old_custom_ext(SSL_CTX *ctx, ENDPOINT role, parse_cb_wrap->parse_arg = parse_arg; parse_cb_wrap->parse_cb = parse_cb; - /* - * TODO(TLS1.3): Is it possible with the old API to add custom exts for both - * client and server for the same type in the same SSL_CTX? We don't handle - * that yet. - */ ret = add_custom_ext_intern(ctx, role, ext_type, context, custom_ext_add_old_cb_wrap,
fix(switch): fix knob overflow on right edge
@@ -191,7 +191,7 @@ static void draw_main(lv_event_t * e) lv_area_t knob_area; knob_area.x1 = obj->coords.x1 + anim_value_x; - knob_area.x2 = knob_area.x1 + knob_size; + knob_area.x2 = knob_area.x1 + (knob_size > 0 ? knob_size - 1 : 0); knob_area.y1 = obj->coords.y1; knob_area.y2 = obj->coords.y2;
esp32s3: BROWNOUT reset reason is set directly without using the brownout ISR
@@ -30,6 +30,7 @@ void brownout_hal_config(const brownout_hal_config_t *cfg) .rst_wait = 0x3ff, .rst_ena = cfg->reset_enabled, .ena = cfg->enabled, + .rst_sel = 1, }; RTCCNTL.brown_out = brown_out_reg; }
doc: release notes for 0.3 Update release notes and version selector for 0.3 release
@@ -188,6 +188,7 @@ else: html_context = { 'current_version': current_version, 'versions': ( ("latest", "/latest/"), + ("0.3", "/0.3/"), ("0.2", "/0.2/"), ("0.1", "/0.1/"), )
Fix: ... and calling wlc_xdg_positioner_protocol_set_constraint_adjustment sets anchor too
@@ -103,12 +103,12 @@ wlc_xdg_positioner_protocol_set_constraint_adjustment(struct wl_client *client, return; positioner->constraint_adjustment = WLC_BIT_CONSTRAINT_ADJUSTMENT_NONE; - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X) positioner->anchor |= WLC_BIT_CONSTRAINT_ADJUSTMENT_SLIDE_X; - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y) positioner->anchor |= WLC_BIT_CONSTRAINT_ADJUSTMENT_SLIDE_Y; - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X) positioner->anchor |= WLC_BIT_CONSTRAINT_ADJUSTMENT_FLIP_X; - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y) positioner->anchor |= WLC_BIT_CONSTRAINT_ADJUSTMENT_FLIP_Y; - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X) positioner->anchor |= WLC_BIT_CONSTRAINT_ADJUSTMENT_RESIZE_X; - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y) positioner->anchor |= WLC_BIT_CONSTRAINT_ADJUSTMENT_RESIZE_Y; + if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X) positioner->constraint_adjustment |= WLC_BIT_CONSTRAINT_ADJUSTMENT_SLIDE_X; + if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y) positioner->constraint_adjustment |= WLC_BIT_CONSTRAINT_ADJUSTMENT_SLIDE_Y; + if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X) positioner->constraint_adjustment |= WLC_BIT_CONSTRAINT_ADJUSTMENT_FLIP_X; + if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y) positioner->constraint_adjustment |= WLC_BIT_CONSTRAINT_ADJUSTMENT_FLIP_Y; + if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X) positioner->constraint_adjustment |= WLC_BIT_CONSTRAINT_ADJUSTMENT_RESIZE_X; + if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y) positioner->constraint_adjustment |= WLC_BIT_CONSTRAINT_ADJUSTMENT_RESIZE_Y; } static void
Check Swig version when building the C# interface.
@@ -1151,6 +1151,9 @@ if(${TINYSPLINE_BINDING_REQUESTED}) # C# if(${TINYSPLINE_ENABLE_CSHARP}) + if(${SWIG_VERSION} VERSION_LESS 4.0.1) + message(FATAL_ERROR "C# requires Swig 4.0.1 or later") + endif() tinyspline_add_swig_library( TARGET ${TINYSPLINE_CSHARP_CMAKE_TARGET} LANG csharp
space-rates the lord/serf protocol
} u3_serf; static u3_serf u3V; - /* serf-lord protocol: - ** - ** ++ plea :: from serf to lord - ** $% $: $play :: send events - ** $= p :: - ** %- unit :: ~ if no snapshot - ** $: p=@ :: first number expected - ** q=@ :: mug of state - ** r=[our=@p fak=?] :: [identity fake?] - ** == == :: - ** $: $done :: event executed unchanged - ** p/@ :: number of this event - ** q/@ :: mug of state (or 0) - ** r/(list ovum) :: actions - ** == :: - ** $: $work :: replace and retry - ** p/@ :: event number - ** q/@ :: mug of state (or 0) - ** r/(pair date ovum) :: event - ** == == :: - ** - ** ++ writ :: from lord to serf - ** $% $: $exit :: snapshot, then exit - ** p/@ :: exit code - ** == :: - ** $: $save :: save snapshot to disk - ** p/@ :: number of old snaps to save - ** == :: - ** $: $work :: execute event - ** p/@ :: event number - ** q/@ :: mug of state (or 0) - ** r/(pair date ovum) :: event - ** == == :: +/* +:: serf-lord protocol: +:: +|% +:: +plea: from serf to lord +:: ++$ plea + $% :: status on startup + :: + $: %play + $= p + :: ~ if no snapshot + :: + %- unit + :: p: event number expected + :: q: mug of kernel + :: r: identity, fake flag + :: + [p=@ q=@ r=[our=@p fak=?]] + == + :: event executed unchanged (in response to %work) + :: + $: %done + :: p: event number + :: q: mug of state (or 0) + :: r: effects + :: + [p=@ q=@ r=(list ovum)] + == + :: replace event and retry (in response to %work) + :: + $: %work + :: p: event number + :: q: mug of state (or 0) + :: r: replacement event (at date) + :: + [p=@ q=@ r=(pair date ovum)] + == == +:: +writ: from lord to serf +:: ++$ writ + $% :: exit immediately + :: + :: p: exit code + :: + [%exit p=@] + :: save snapshot to disk + :: + :: p: number of old snaps to save (XX not respected) + :: + [%save p=@] + :: execute event + :: + $: %work + :: p: event number + :: q: mug of state (or 0) + :: r: event (at date) + :: + [p=@ q=@ r=(pair date ovum)] + == == +-- */ /* _serf_space(): print n spaces.
show information about expected channel and detected channel on chnnel set error - this error occur if another tool try to change channel while hcxdumptool is running
@@ -5139,7 +5139,7 @@ if(aktchannel != pwrq.u.freq.m) { errorcount++; strftime(timestring, 16, "%H:%M:%S", localtime(&tv.tv_sec)); - snprintf(servermsg, SERVERMSG_MAX, "%s ERROR: %d [INTERFACE IS NOT ON EXPECTED CHANNEL - UNABLE TO SET CHANNEL]\n", timestring, errorcount); + snprintf(servermsg, SERVERMSG_MAX, "%s ERROR: %d [INTERFACE IS NOT ON EXPECTED CHANNEL, EXPECTED: %d, DETECTED: %d]\n", timestring, errorcount, aktchannel, pwrq.u.freq.m); if(((statusout &STATUS_SERVER) == STATUS_SERVER) && (fd_socket_mcsrv > 0)) sendto(fd_socket_mcsrv, servermsg, strlen(servermsg), 0, (struct sockaddr*)&mcsrvaddress, sizeof(mcsrvaddress)); else printf("%s", servermsg); } @@ -6380,7 +6380,7 @@ if((iwr_old.u.mode & IW_MODE_MONITOR) != IW_MODE_MONITOR) } else { - fprintf(stderr, "interface is already in monitor mode\n"); + fprintf(stderr, "interface is already in monitor mode, skipping ioctl(SIOCSIWMODE) and ioctl(SIOCSIFFLAGS) system calls\n"); memset(&ifr, 0, sizeof(ifr)); strncpy( ifr.ifr_name, interfacename, IFNAMSIZ -1); if(ioctl(fd_socket, SIOCGIFFLAGS, &ifr) < 0)
dm:gvt:enable gvt bar registration Need to enable gvt bar registration, so remove the previous workaround patch. Acked-by: Yu Wang
@@ -602,20 +602,6 @@ modify_bar_registration(struct pci_vdev *dev, int idx, int registration) struct inout_port iop; struct mem_range mr; - if (is_pci_gvt(dev)) { - /* GVT device is the only one who traps the pci bar access and - * intercepts the corresponding contents in kernel. It needs - * register pci resource only, but no need to register the - * region. - * - * FIXME: This is a short term solution. This patch will be - * obsoleted with the migration of using OVMF to do bar - * addressing and generate ACPI PCI resource from using - * acrn-dm. - */ - pr_notice("modify_bar_registration: bypass for pci-gvt\n"); - return 0; - } switch (dev->bar[idx].type) { case PCIBAR_IO: bzero(&iop, sizeof(struct inout_port));
Improve CMake for ChibiOS build from local source Copying from source folder to build folder is now only performed if the folder doesn't exist (improvement in build time) ChibiOS project is now added as an external project
@@ -584,14 +584,36 @@ if(RTOS_CHIBIOS_CHECK) if(EXISTS "${CHIBIOS_SOURCE}/") message(STATUS "RTOS is: ChibiOS (source from: ${CHIBIOS_SOURCE})") + # check if we already have the sources, no need to copy again + if(NOT EXISTS "${CMAKE_BINARY_DIR}/mbedTLS_Source") file(COPY "${CHIBIOS_SOURCE}/" DESTINATION "${CMAKE_BINARY_DIR}/ChibiOS_Source") + else() + message(STATUS "Using local cache of ChibiOS source from ${CHIBIOS_SOURCE}") + endif() + set(CHIBIOS_INCLUDE_DIR ${CMAKE_BINARY_DIR}/ChibiOS_Source/include) - # dummy target required for targets that have a declared dependency from ChibiOS - add_custom_target(ChibiOS) else() message(FATAL_ERROR "Couldn't find ChibiOS source at ${CHIBIOS_SOURCE}/") endif() + # add ChibiOS as external project + ExternalProject_Add( + ChibiOS + PREFIX ChibiOS + SOURCE_DIR ${CMAKE_BINARY_DIR}/ChibiOS_Source + + # install command has to perform TWO extracts + # in order to set multiple commands with INSTALL_COMMAND they have to be concatenated by a COMMAND keyword + INSTALL_COMMAND ${CMAKE_COMMAND} -E tar xvf ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip-2.0.3-patched.7z WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/ COMMAND ${CMAKE_COMMAND} -E tar xvf ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/wolfssl-3.12.2-patched.7z WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/ + + # Disable all other steps + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + ) + + # get source dir for ChibiOS CMake project + ExternalProject_Get_Property(ChibiOS SOURCE_DIR) + endif() # Define base path for the class libraries
fix: discord::init() should work as expected
@@ -18,6 +18,10 @@ init(dati *ua, const char token[], const char config_file[]) ua_config_init(&ua->common, BASE_API_URL, "DISCORD HTTP", config_file); token = orka_config_get_field(&ua->common.config, "discord.token"); } + else { + ua_init(&ua->common, BASE_API_URL); + orka_config_init(&ua->common.config, "DISCORD HTTP", NULL); + } if (!token) ERR("Missing bot token"); char auth[128];
imgtool: update help message for slot-size In case slot sizes are different, use the secondary slot (to use for calculations, padding, etc).
@@ -260,7 +260,8 @@ class BasedIntParamType(click.ParamType): @click.option('--pad', default=False, is_flag=True, help='Pad image to --slot-size bytes, adding trailer magic') @click.option('-S', '--slot-size', type=BasedIntParamType(), required=True, - help='Size of the slot where the image will be written') + help='Size of the slot. If the slots have different sizes, use ' + 'the size of the secondary slot.') @click.option('--pad-header', default=False, is_flag=True, help='Add --header-size zeroed bytes at the beginning of the ' 'image')
update CN translation based on reviewers' comments
@@ -459,8 +459,6 @@ In this example, graphics_lib.o and logo.h will be generated in the current dire Cosmetic Improvements ^^^^^^^^^^^^^^^^^^^^^ -Because logo.h is a generated file, it needs to be cleaned when make clean is called which why it is added to the COMPONENT_EXTRA_CLEAN variable. - Adding logo.h to the ``graphics_lib.o`` dependencies causes it to be generated before ``graphics_lib.c`` is compiled. If a a source file in another component included ``logo.h``, then this component's name would have to be added to the other component's ``COMPONENT_DEPENDS`` list to ensure that the components were built in-order.
fix error handling (call `on_finish`)
@@ -1032,7 +1032,7 @@ intptr_t http_connect(const char *address, fprintf(stderr, "ERROR: http_connect requires either an on_response " " or an on_upgrade callback.\n"); errno = EINVAL; - return -1; + goto on_error; } http_lib_init(); size_t len; @@ -1043,8 +1043,9 @@ intptr_t http_connect(const char *address, if (!address || (len = strlen(address)) <= 5) { fprintf(stderr, "ERROR: http_connect requires a valid address.\n"); errno = EINVAL; - return -1; + goto on_error; } + // TODO: use http_url_parse if (!strncasecmp(address, "ws", 2)) { is_websocket = 1; address += 2; @@ -1055,7 +1056,7 @@ intptr_t http_connect(const char *address, } else { fprintf(stderr, "ERROR: http_connect requires a valid address.\n"); errno = EINVAL; - return -1; + goto on_error; } /* parse address */ if (address[0] == 's') { @@ -1064,11 +1065,11 @@ intptr_t http_connect(const char *address, fprintf(stderr, "ERROR: http_connect doesn't support TLS/SSL " "just yet.\n"); errno = EINVAL; - return -1; + goto on_error; } else if (len <= 3 || strncmp(address, "://", 3)) { fprintf(stderr, "ERROR: http_connect requires a valid address.\n"); errno = EINVAL; - return -1; + goto on_error; } else { len -= 3; address += 3; @@ -1138,6 +1139,10 @@ intptr_t http_connect(const char *address, } fio_free(a); return ret; +on_error: + if (arg_settings.on_finish) + arg_settings.on_finish(&arg_settings); + return -1; } #define http_connect(address, ...) \ http_connect((address), (struct http_settings_s){__VA_ARGS__})
Add some more detail on how to use AppScope in AWS Lambda
@@ -54,18 +54,38 @@ For a full list of library environment variables, execute: `./libscope.so all` For the default settings in the sample `scope.yml` configuration file, see [Config Files](/docs/config-files), or inspect the most-recent file on [GitHub](https://github.com/criblio/appscope/blob/master/conf/scope.yml). -### <span id="lambda">Deploying the Library in a Lambda Function</span> +### <span id="lambda">Deploying the Library in an AWS Lambda Function</span> -You can pull the libscope.so library into an AWS Lambda function as a [Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), using these steps: +You can interpose the libscope.so library into an AWS Lambda function as a [Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), using these steps. By default, Lambda functions use `lib` as their `LD_LIBRARY_PATH` which makes loading AppScope very easy. -1. Run `scope extract`, e.g.: +Run `scope extract`, e.g.: ``` - scope extract /opt/<your-layer>/ +mkdir lib +scope extract ./lib +``` +or grab the bits directly from the website +``` +mkdir lib +curl -Ls https://cdn.cribl.io/dl/scope/$(curl -Ls https://cdn.cribl.io/dl/scope/latest)/linux/scope.tgz | tar zxf - -C lib --strip-components=1 ``` -1. Set these three environment variables: +Modify the `scope.yml` configuration file as appropriate, then compress everything into a `.zip` file. ``` - LD_PRELOAD=/opt/<your-layer>/libscope.so - SCOPE_EXEC_PATH=/opt/<your-layer>/ldscope - SCOPE_CONF_PATH=/opt/<your-layer>/scope.yml +tar pvczf lambda_layer.zip lib/ ``` + +Create a [Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-create) and associate the runtimes you want to be able to use AppScope with in your Lambda functions. Upload the `lambda_layer.zip` file created in the previous step. + +Add the custom layer to your Lambda function by selecting the previously created layer and version. + +#### Environment Variables + +At a minimum, you must set the `LD_PRELOAD` environment variable in your Lambda configuration: +``` +LD_PRELOAD=libscope.so +``` + +You must also tell AppScope where to deliver events. This can be accomplished by setting one of the following in the environment variables: +1. `SCOPE_CONF_PATH=lib/scope.yml` +or +1. `SCOPE_EVENT_DEST=tcp://localhost:9999`
tools/makemanifest.py: Support freezing with empty list of mpy files. Fixes issue
@@ -276,10 +276,22 @@ def main(): sys.exit(1) # Freeze .mpy files + if mpy_files: res, output_mpy = system([sys.executable, MPY_TOOL, '-f', '-q', args.build_dir + '/genhdr/qstrdefs.preprocessed.h'] + mpy_files) if res != 0: - print('error freezing mpy {}: {}'.format(mpy_files, output_mpy)) + print('error freezing mpy {}:'.format(mpy_files)) + print(str(output_mpy, 'utf8')) sys.exit(1) + else: + output_mpy = ( + b'#include "py/emitglue.h"\n' + b'extern const qstr_pool_t mp_qstr_const_pool;\n' + b'const qstr_pool_t mp_qstr_frozen_const_pool = {\n' + b' (qstr_pool_t*)&mp_qstr_const_pool, MP_QSTRnumber_of, 0, 0\n' + b'};\n' + b'const char mp_frozen_mpy_names[1] = {"\\0"};\n' + b'const mp_raw_code_t *const mp_frozen_mpy_content[0] = {};\n' + ) # Generate output print('GEN', args.output)
extmod/moducryptolib: Shorten exception messages to reduce code size.
@@ -173,7 +173,7 @@ STATIC mp_obj_t ucryptolib_aes_make_new(const mp_obj_type_t *type, size_t n_args mp_buffer_info_t keyinfo; mp_get_buffer_raise(args[0], &keyinfo, MP_BUFFER_READ); if (32 != keyinfo.len && 16 != keyinfo.len) { - mp_raise_ValueError("bad key length"); + mp_raise_ValueError("key"); } mp_buffer_info_t ivinfo; @@ -182,10 +182,10 @@ STATIC mp_obj_t ucryptolib_aes_make_new(const mp_obj_type_t *type, size_t n_args mp_get_buffer_raise(args[2], &ivinfo, MP_BUFFER_READ); if (16 != ivinfo.len) { - mp_raise_ValueError("bad iv length"); + mp_raise_ValueError("IV"); } } else if (o->block_mode == UCRYPTOLIB_MODE_CBC) { - mp_raise_ValueError("iv required for MODE_CBC"); + mp_raise_ValueError("IV"); } aes_initial_set_key_impl(&o->ctx, keyinfo.buf, keyinfo.len, ivinfo.buf); @@ -216,7 +216,7 @@ STATIC mp_obj_t aes_process(size_t n_args, const mp_obj_t *args, bool encrypt) { if (out_buf != MP_OBJ_NULL) { mp_get_buffer_raise(out_buf, &out_bufinfo, MP_BUFFER_WRITE); if (out_bufinfo.len < in_bufinfo.len) { - mp_raise_ValueError("output buffer too small"); + mp_raise_ValueError("output too small"); } out_buf_ptr = out_bufinfo.buf; } else { @@ -231,7 +231,7 @@ STATIC mp_obj_t aes_process(size_t n_args, const mp_obj_t *args, bool encrypt) { if ((encrypt && self->key_type == AES_KEYTYPE_DEC) || (!encrypt && self->key_type == AES_KEYTYPE_ENC)) { - mp_raise_ValueError("can't use same aes object for encrypt & decrypt"); + mp_raise_ValueError("can't encrypt & decrypt"); } }
[viostor] refresh disk geometry on adapter restart
@@ -387,7 +387,8 @@ VirtIoFindAdapter( return res; } - adaptExt->features = virtio_get_features(&adaptExt->vdev); + RhelGetDiskGeometry(DeviceExtension); + ConfigInfo->CachesData = CHECKBIT(adaptExt->features, VIRTIO_BLK_F_FLUSH) ? TRUE : FALSE; RhelDbgPrint(TRACE_LEVEL_INFORMATION, ("VIRTIO_BLK_F_WCACHE = %d\n", ConfigInfo->CachesData)); RhelDbgPrint(TRACE_LEVEL_INFORMATION, ("VIRTIO_BLK_F_MQ = %d\n", CHECKBIT(adaptExt->features, VIRTIO_BLK_F_MQ))); @@ -428,7 +429,6 @@ VirtIoFindAdapter( #endif adaptExt->num_queues = 1; - RhelGetDiskGeometry(DeviceExtension); if (CHECKBIT(adaptExt->features, VIRTIO_BLK_F_MQ)) { virtio_get_config(&adaptExt->vdev, FIELD_OFFSET(blk_config, num_queues), &adaptExt->num_queues, sizeof(adaptExt->num_queues)); @@ -990,6 +990,7 @@ VirtIoHwReinitialize( if (InitVirtIODevice(DeviceExtension) != SP_RETURN_FOUND) { return FALSE; } + RhelGetDiskGeometry(DeviceExtension); return VirtIoHwInitialize(DeviceExtension); }
BugID:16179547:modified gatewayapp for web server
@@ -391,6 +391,9 @@ int application_start(int argc, char **argv) #ifdef CONFIG_NET_LWIP lwip_tcpip_init(); + + /* Initialize webserver */ + http_server_netconn_init(); #endif aos_task_new("netmgr", start_netmgr, NULL, 4096);
graph-store: standardise archive format
|= [r=resource:store m=marked-graph:store] ^- card =/ pax /(rap 3 'archive-' (scot %p entity.r) '-' name.r ~)/noun - =/ =cage drum-put+!>([pax (jam m)]) + =/ =cage drum-put+!>([pax (jam r m)]) [%pass /archive %agent [our.bowl %hood] %poke cage] == ==
Ignore %status and %config diffs that wouldn't actually change anything.
:: == ^+ +> ?- -.rum - $new ?: =(src so-cir) - (so-config-full ~ cof.rum) - $(rum [%config src %full cof.rum]) $bear (so-bear bur.rum) $peer (so-delta-our rum) $gram (so-open src nev.rum) - $config :: full changes to us need to get split up. - ?: &(=(cir.rum so-cir) ?=($full -.dif.rum)) - (so-config-full `shape cof.dif.rum) + $remove (so-delta-our %config src %remove ~) + :: + $new + ?: =(src so-cir) + (so-config-full ~ cof.rum) + $(rum [%config src %full cof.rum]) + :: + $config :: we only subscribe to remotes' configs. - ?: =(src cir.rum) - (so-delta-our rum) + ?. =(src cir.rum) ~! %unexpected-remote-config-from-remote !! - $status :: we only subscribe to remotes' locals. - ?: |(=(src cir.rum) =(src so-cir)) + =/ old/(unit config) + ?: =(cir.rum so-cir) `shape + (~(get by mirrors) cir.rum) + :: ignore if it won't result in change. + ?. ?| &(?=($remove -.dif.rum) ?=(^ old)) + ?=($~ old) + !=(u.old (change-config u.old dif.rum)) + == + +>.$ + :: full changes to us need to get split up. + ?: &(=(cir.rum so-cir) ?=($full -.dif.rum)) + (so-config-full `shape cof.dif.rum) (so-delta-our rum) + :: + $status + :: we only subscribe to remotes' locals. + ?. |(=(src cir.rum) =(src so-cir)) ~! %unexpected-remote-status-from-remote !! - $remove (so-delta-our %config src %remove ~) + =/ old/(unit status) + ?: =(cir.rum so-cir) (~(get by locals) who.rum) + =- (~(get by -) who.rum) + (fall (~(get by remotes) cir.rum) *group) + :: ignore if it won't result in change. + ?. ?| &(?=($remove -.dif.rum) ?=(^ old)) + ?=($~ old) + !=(u.old (change-status u.old dif.rum)) + == + +>.$ + (so-delta-our rum) == :: ++ so-bear ::< accept burden
context: add test cases ignoring context hierarchy levels
@@ -721,12 +721,21 @@ TEST (test_contextual_basic, evaluate) ASSERT_EQ (c["country"], "germany"); ASSERT_EQ (c["dialect"], ""); ASSERT_EQ (c.evaluate ("/%language%/%country%/%dialect%/test"), "/german/germany/%/test"); + ASSERT_EQ (c.evaluate ("/%language%/%language%/%dialect%/test"), "/german/german/%/test"); + + ASSERT_EQ (c.evaluate ("/%language%%country%%dialect%/test"), "/germangermany%/test"); + ASSERT_EQ (c.evaluate ("/%language%%language%%dialect%/test"), "/germangerman%/test"); }); ASSERT_EQ (c["language"], ""); ASSERT_EQ (c["country"], ""); ASSERT_EQ (c["dialect"], ""); ASSERT_EQ (c.evaluate ("/%language%/%country%/%dialect%/test"), "/%/%/%/test"); + ASSERT_EQ (c["language"], ""); + ASSERT_EQ (c["country"], ""); + ASSERT_EQ (c["dialect"], ""); + ASSERT_EQ (c.evaluate ("/%language%%country%%dialect%/test"), "/%%%/test"); + KeySet ks; Integer i (ks, c, Key ("/%application%/%version%/%profile%/%thread%/%module%/%manufacturer%/%type%/%family%/%model%/serial_number", KEY_CASCADING_NAME, KEY_META, "default", s_value, KEY_END));
ci(micropython) switch to newer GCC action
@@ -52,7 +52,7 @@ jobs: # STM32 & RPi Pico port - name: arm-none-eabi-gcc if: matrix.port == 'stm32' || matrix.port == 'rp2' - uses: fiam/arm-none-eabi-gcc@v1 + uses: carlosperate/[email protected] with: release: '9-2019-q4' # The arm-none-eabi-gcc release to use. - name: Build STM32 port
fix ye olde typo
@@ -654,7 +654,7 @@ static int serve_with_generator(struct st_h2o_sendfile_generator_t *generator, h } } - /* only allow GET or POST for static files */ + /* only allow GET or HEAD for static files */ if (method_type == METHOD_IS_OTHER) { do_close(&generator->super, req); send_method_not_allowed(req);
I2C: Fix the reset counter
@@ -1472,7 +1472,7 @@ static bool is_cmd_link_buffer_internal(const i2c_cmd_link_t *link) } #endif -static uint8_t clear_bus_cnt[2] = { 0, 0 }; +static uint8_t clear_bus_cnt[I2C_NUM_MAX] = { 0 }; esp_err_t i2c_master_cmd_begin(i2c_port_t i2c_num, i2c_cmd_handle_t cmd_handle, TickType_t ticks_to_wait) { @@ -1557,6 +1557,7 @@ esp_err_t i2c_master_cmd_begin(i2c_port_t i2c_num, i2c_cmd_handle_t cmd_handle, clear_bus_cnt[i2c_num]++; if (clear_bus_cnt[i2c_num] >= I2C_ACKERR_CNT_MAX) { clear_bus_cnt[i2c_num] = 0; + i2c_hw_fsm_reset(i2c_num); } ret = ESP_FAIL; } else {