message
stringlengths
6
474
diff
stringlengths
8
5.22k
util/add-depends.pl: Rebuild the build file after reconfiguration Reconfiguration is assumed if any dependency (.d) file is older than configdata.pm. Fixes
@@ -23,6 +23,7 @@ ${^WIN32_SLOPPY_STAT} = 1; my $debug = $ENV{ADD_DEPENDS_DEBUG}; my $buildfile = $config{build_file}; my $build_mtime = (stat($buildfile))[9]; +my $configdata_mtime = (stat('configdata.pm'))[9]; my $rebuild = 0; my $depext = $target{dep_extension} || ".d"; my @depfiles = @@ -30,9 +31,11 @@ my @depfiles = grep { # This grep has side effects. Not only does if check the existence # of the dependency file given in $_, but it also checks if it's - # newer than the build file, and if it is, sets $rebuild. + # newer than the build file or older than configdata.pm, and if it + # is, sets $rebuild. my @st = stat($_); - $rebuild = 1 if @st && $st[9] > $build_mtime; + $rebuild = 1 + if @st && ($st[9] > $build_mtime || $st[9] < $configdata_mtime); scalar @st > 0; # Determines the grep result } map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
Add note about required prepare-machine invocation to TEST.md
## Running the Tests -To run the all the tests, (after [building](./BUILD.md)) simply run: +First [build](./BUILD.md). Then prepare the machine: + +```PowerShell +.\scripts\prepare-machine.ps1 -Configuration Test -TestCertificates +``` + +If not testing on Windows, omit `-TestCertificates`: + +```PowerShell +.\scripts\prepare-machine.ps1 -Configuration Test +``` + +Then all the tests can be run with: ```PowerShell ./scripts/test.ps1 @@ -14,7 +26,7 @@ To run the all the tests, (after [building](./BUILD.md)) simply run: ./scripts/test.ps1 -Tls openssl ``` -By default this will run all tests in series, with no log to collection. To include log collection for failed tests, run: +By default this will run all tests in series, with no log collection. To include log collection for failed tests, run: ```PowerShell ./scripts/test.ps1 -LogProfile Full.Light @@ -22,7 +34,7 @@ By default this will run all tests in series, with no log to collection. To incl > **Note** - On Windows, you will need to run Powershell as **Administrator** to get the logs. -If there are any failed tests, this will generate a directory for each failed test that incldues the console output from running the test and any logs collected. +If there are any failed tests, this will generate a directory for each failed test that includes the console output from running the test and any logs collected. **Example Output** (Windows) ```PowerShell
bugfix:remove duplicate files in src list before DefineGroup
@@ -626,6 +626,8 @@ def DefineGroup(name, src, depend, **parameters): group['name'] = name group['path'] = group_path if type(src) == type([]): + # remove duplicate elements from list + src = list(set(src)) group['src'] = File(src) else: group['src'] = src
swaps -K (now kernel stage) and -k (now key-file)
@@ -141,15 +141,15 @@ _main_getopt(c3_i argc, c3_c** argv) break; } case 'K': { - u3_Host.ops_u.key_c = strdup(optarg); - break; - } - case 'k': { if ( c3n == _main_readw(optarg, 256, &u3_Host.ops_u.kno_w) ) { return c3n; } break; } + case 'k': { + u3_Host.ops_u.key_c = strdup(optarg); + break; + } case 'l': { if ( c3n == _main_readw(optarg, 65536, &arg_w) ) { return c3n; @@ -248,7 +248,7 @@ _main_getopt(c3_i argc, c3_c** argv) } if ( u3_Host.ops_u.nuu != c3y && u3_Host.ops_u.key_c != 0) { - fprintf(stderr, "-K only makes sense when bootstrapping a new instance\n"); + fprintf(stderr, "-k only makes sense when bootstrapping a new instance\n"); return c3n; } @@ -343,8 +343,8 @@ u3_ve_usage(c3_i argc, c3_c** argv) "-F ship Fake keys; also disables networking\n", "-f Fuzz testing\n", "-g Set GC flag\n", - "-K keys Private key file\n", - "-k stage Start at Hoon kernel version stage\n", + "-K stage Start at Hoon kernel version stage\n", + "-k keys Private key file\n", "-l port Initial peer port\n", "-M Memory madness\n", "-n host Set unix hostname\n",
WIP Fix keyboard navigation when list if focused but no item is selected
@@ -83,14 +83,10 @@ export const FlatList = <T extends FlatListItem>({ } if (e.key === "ArrowDown") { e.preventDefault(); - if (selectedId) { - throttledNext.current(items, selectedId); - } + throttledNext.current(items, selectedId || ""); } else if (e.key === "ArrowUp") { e.preventDefault(); - if (selectedId) { - throttledPrev.current(items, selectedId); - } + throttledPrev.current(items, selectedId || ""); } else if (e.key === "Home") { const nextItem = items[0]; setSelectedId?.(nextItem.id, nextItem);
chunk-trace: callo flb_errno when unable to allocate memory.
@@ -169,11 +169,13 @@ struct flb_chunk_trace_context *flb_chunk_trace_context_new(void *trace_input, ctx = flb_calloc(1, sizeof(struct flb_chunk_trace_context)); if (ctx == NULL) { pthread_mutex_unlock(&in->chunk_trace_lock); + flb_errno(); return NULL; } ctx->flb = flb_create(); if (ctx->flb == NULL) { + flb_errno(); goto error_ctxt; } @@ -264,6 +266,7 @@ struct flb_chunk_trace *flb_chunk_trace_new(struct flb_input_chunk *chunk) trace = flb_calloc(1, sizeof(struct flb_chunk_trace)); if (trace == NULL) { pthread_mutex_unlock(&f_ins->chunk_trace_lock); + flb_errno(); return NULL; }
Check in heap changes
@@ -151,10 +151,13 @@ void* liballoc_alloc(size_t page_count) { */ int liballoc_free(void* ptr,size_t page_count) { printf("liballoc_free 0x%08x %d\n", ptr, page_count); + /* vmm_page_directory_t* vmm = boot_info_get()->vmm_kernel; for (uint32_t i = (uint32_t)ptr; i < ((uint32_t)ptr + (page_count * 0x1000)); i += 0x1000) { _vmm_unmap_page(vmm, i); } + */ + vmm_free_global_kernel_memory(ptr, page_count * 0x1000); return 0; }
py/emitnative: Fix typo, REG_PARENT_ARG_RET should be REG_PARENT_RET.
@@ -2696,7 +2696,7 @@ STATIC void emit_native_return_value(emit_t *emit) { } if (return_vtype != VTYPE_PYOBJ) { emit_call_with_imm_arg(emit, MP_F_CONVERT_NATIVE_TO_OBJ, return_vtype, REG_ARG_2); - #if REG_RET != REG_PARENT_ARG_RET + #if REG_RET != REG_PARENT_RET ASM_MOV_REG_REG(emit->as, REG_PARENT_RET, REG_RET); #endif }
dispatcher: fix broken gzip compressed stream reading inflateInit2() was missing, causing inflate() always fail with Z_STREAM_ERROR.
@@ -276,7 +276,6 @@ gzipreadbuf(z_strm *strm, void *buf, size_t sze, int rval, int err) zstrm->next_out = (Bytef *)buf; zstrm->avail_out = (uInt)sze; - zstrm->total_out = 0; iret = inflate(zstrm, strm->hdl.gz.inflatemode); switch (iret) { @@ -837,6 +836,22 @@ dispatch_addconnection(int sock, listener *lsnr) C_SETUP, C_FREE); return -1; } + memset(&zstrm->hdl.gz.z, 0, sizeof(zstrm->hdl.gz.z)); + zstrm->hdl.gz.z.next_in = (Bytef *)zstrm->ibuf; + zstrm->hdl.gz.z.avail_in = 0; + zstrm->hdl.gz.z.zalloc = Z_NULL; + zstrm->hdl.gz.z.zfree = Z_NULL; + zstrm->hdl.gz.z.opaque = Z_NULL; + if (inflateInit2(&zstrm->hdl.gz.z, 15 + 16) != Z_OK) + { + logerr("cannot init gzip connection\n"); + free(ibuf); + free(connections[c].strm); + free(zstrm); + __sync_bool_compare_and_swap(&(connections[c].takenby), + C_SETUP, C_FREE); + return -1; + } zstrm->ipos = 0; zstrm->ibuf = ibuf; zstrm->isize = METRIC_BUFSIZ; @@ -844,11 +859,6 @@ dispatch_addconnection(int sock, listener *lsnr) zstrm->strmreadbuf = &gzipreadbuf; zstrm->strmclose = &gzipclose; zstrm->hdl.gz.inflatemode = Z_SYNC_FLUSH; - zstrm->hdl.gz.z.next_in = (Bytef *)zstrm->ibuf; - zstrm->hdl.gz.z.avail_in = 0; - zstrm->hdl.gz.z.zalloc = Z_NULL; - zstrm->hdl.gz.z.zfree = Z_NULL; - zstrm->hdl.gz.z.opaque = Z_NULL; zstrm->nextstrm = connections[c].strm; connections[c].strm = zstrm; }
linux/perf: use files_readFromFd() instead of read()
@@ -348,7 +348,8 @@ void arch_perfAnalyze(honggfuzz_t * hfuzz, fuzzer_t * fuzzer) uint64_t instrCount = 0; if (hfuzz->dynFileMethod & _HF_DYNFILE_INSTR_COUNT) { ioctl(fuzzer->linux.cpuInstrFd, PERF_EVENT_IOC_DISABLE, 0); - if (read(fuzzer->linux.cpuInstrFd, &instrCount, sizeof(instrCount)) != sizeof(instrCount)) { + if (files_readFromFd(fuzzer->linux.cpuInstrFd, (uint8_t *) & instrCount, sizeof(instrCount)) + != sizeof(instrCount)) { PLOG_E("read(perfFd='%d') failed", fuzzer->linux.cpuInstrFd); } ioctl(fuzzer->linux.cpuInstrFd, PERF_EVENT_IOC_RESET, 0); @@ -357,8 +358,9 @@ void arch_perfAnalyze(honggfuzz_t * hfuzz, fuzzer_t * fuzzer) uint64_t branchCount = 0; if (hfuzz->dynFileMethod & _HF_DYNFILE_BRANCH_COUNT) { ioctl(fuzzer->linux.cpuBranchFd, PERF_EVENT_IOC_DISABLE, 0); - if (read(fuzzer->linux.cpuBranchFd, &branchCount, sizeof(branchCount)) != - sizeof(branchCount)) { + if (files_readFromFd + (fuzzer->linux.cpuBranchFd, (uint8_t *) & branchCount, + sizeof(branchCount)) != sizeof(branchCount)) { PLOG_E("read(perfFd='%d') failed", fuzzer->linux.cpuBranchFd); } ioctl(fuzzer->linux.cpuBranchFd, PERF_EVENT_IOC_RESET, 0); @@ -368,12 +370,10 @@ void arch_perfAnalyze(honggfuzz_t * hfuzz, fuzzer_t * fuzzer) ioctl(fuzzer->linux.cpuIptBtsFd, PERF_EVENT_IOC_DISABLE, 0); arch_perfMmapParse(hfuzz, fuzzer); } - if (hfuzz->dynFileMethod & _HF_DYNFILE_BTS_EDGE) { ioctl(fuzzer->linux.cpuIptBtsFd, PERF_EVENT_IOC_DISABLE, 0); arch_perfMmapParse(hfuzz, fuzzer); } - if (hfuzz->dynFileMethod & _HF_DYNFILE_IPT_BLOCK) { ioctl(fuzzer->linux.cpuIptBtsFd, PERF_EVENT_IOC_DISABLE, 0); arch_perfMmapParse(hfuzz, fuzzer);
Better context check for EIP712 sign It was possible to define empty structs without any fields and right after, trigger the EIP712 sign UI flow for blank domain & message hashes. Added checks if there is actually anything relevant to sign.
#include "schema_hash.h" #include "filtering.h" #include "common_712.h" +#include "ethUtils.h" // allzeroes /** * Send the response to the previous APDU command @@ -185,6 +186,14 @@ bool handle_eip712_sign(const uint8_t *const apdu_buf) { if (eip712_context == NULL) { apdu_response_code = APDU_RESPONSE_CONDITION_NOT_SATISFIED; + } + // if the final hashes are still zero or if there are some unimplemented fields + else if (allzeroes(tmpCtx.messageSigningContext712.domainHash, + sizeof(tmpCtx.messageSigningContext712.domainHash)) || + allzeroes(tmpCtx.messageSigningContext712.messageHash, + sizeof(tmpCtx.messageSigningContext712.messageHash)) || + (path_get_field() != NULL)) { + apdu_response_code = APDU_RESPONSE_CONDITION_NOT_SATISFIED; } else if ((ui_712_get_filtering_mode() == EIP712_FILTERING_FULL) && (ui_712_remaining_filters() != 0)) { PRINTF("%d EIP712 filters are missing\n", ui_712_remaining_filters());
Fix timer init in platformer
@@ -249,7 +249,7 @@ void animation_timer_callback(timer &timer) { slime1.update(); } -timer *t; +timer t; @@ -263,7 +263,8 @@ void init() { bat1.pos = vec2(200, 22); slime1.pos = vec2(50, 112); - t = new timer(animation_timer_callback, 50, -1); + t.init(animation_timer_callback, 50, -1); + t.start(); screen_size.w = 160; screen_size.h = 120;
Fixup that it does not set prefetch_ttl twice, but sets the new serve_expired_ttl member of the reply ttls.
@@ -341,7 +341,7 @@ ipsecmod_handle_query(struct module_qstate* qstate, qstate->env->cfg->ipsecmod_max_ttl; qstate->return_msg->rep->prefetch_ttl = PREFETCH_TTL_CALC( qstate->return_msg->rep->ttl); - qstate->return_msg->rep->prefetch_ttl = qstate->return_msg->rep->ttl + + qstate->return_msg->rep->serve_expired_ttl = qstate->return_msg->rep->ttl + qstate->env->cfg->serve_expired_ttl; } }
also zero pad DHE public key in ClientKeyExchange message for interop
@@ -3069,9 +3069,9 @@ static int tls_construct_cke_dhe(SSL *s, WPACKET *pkt) { #ifndef OPENSSL_NO_DH DH *dh_clnt = NULL; - const BIGNUM *pub_key; EVP_PKEY *ckey = NULL, *skey = NULL; unsigned char *keybytes = NULL; + int prime_len; skey = s->s3.peer_tmp; if (skey == NULL) { @@ -3101,15 +3101,19 @@ static int tls_construct_cke_dhe(SSL *s, WPACKET *pkt) } /* send off the data */ - DH_get0_key(dh_clnt, &pub_key, NULL); - if (!WPACKET_sub_allocate_bytes_u16(pkt, BN_num_bytes(pub_key), - &keybytes)) { + prime_len = BN_num_bytes(DH_get0_p(dh_clnt)); + /* + * For interoperability with some versions of the Microsoft TLS + * stack, we need to zero pad the DHE pub key to the same length + * as the prime, so use the length of the prime here. + */ + if (!WPACKET_sub_allocate_bytes_u16(pkt, prime_len, &keybytes) + || BN_bn2binpad(DH_get0_pub_key(dh_clnt), keybytes, prime_len) < 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_DHE, ERR_R_INTERNAL_ERROR); goto err; } - BN_bn2bin(pub_key, keybytes); EVP_PKEY_free(ckey); return 1;
Update link in libyara
@@ -5,7 +5,7 @@ libdir=@libdir@ Name: yara Description: YARA library -URL: http://plusvic.github.io/yara/ +URL: https://virustotal.github.io/yara/ Version: @PACKAGE_VERSION@ Cflags: -I${includedir} Libs: -L${libdir} -lyara
don't build app/twit, gen/twit
:: :- /app/gh "hangs for some reason" :- /mar/gh "hangs for some reason" + :- /app/twit "slow and/or crash" + :- /gen/twit "slow and/or crash" :- /mar/twit "slow and/or crash" == ::
BugID: modify tasks.json, monitor will take an new terminal
"helloworld@developerkit" ], "presentation": { - "focus": "true" + "focus": true } }, { "helloworld@developerkit" ], "presentation": { - "focus": "true" + "focus": true } }, { "" ], "presentation": { - "focus": "true" + "focus": true, + "panel": "dedicated" } }, { "clean" ], "presentation": { - "focus": "true" + "focus": true } }, {
esp32/mpconfigport.h: Enable maximum speed software SPI.
#include <stdint.h> #include <alloca.h> +#include "rom/ets_sys.h" // object representation and NLR handling #define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_A) #define MICROPY_PY_MACHINE_PULSE (1) #define MICROPY_PY_MACHINE_I2C (1) #define MICROPY_PY_MACHINE_SPI (1) +#define MICROPY_PY_MACHINE_SPI_MIN_DELAY (0) +#define MICROPY_PY_MACHINE_SPI_MAX_BAUDRATE (ets_get_cpu_frequency() * 1000000 / 200) // roughly #define MICROPY_PY_USSL (1) #define MICROPY_SSL_MBEDTLS (1) #define MICROPY_PY_WEBSOCKET (0)
plugin types BUGFIX ignore value if value_len is 0
@@ -1350,7 +1350,7 @@ ly_type_store_empty(const struct ly_ctx *ctx, const struct lysc_type *type, cons if (options & LY_TYPE_STORE_DYNAMIC) { LY_CHECK_RET(lydict_insert_zc(ctx, (char *)value, &storage->canonical)); } else { - LY_CHECK_RET(lydict_insert(ctx, value, value_len, &storage->canonical)); + LY_CHECK_RET(lydict_insert(ctx, "", value_len, &storage->canonical)); } storage->ptr = NULL; storage->realtype = type;
consolidate windows 10 and windows 2019 configs
@@ -382,7 +382,6 @@ function Install-7Zip { function Install-PSW { - $OS_VERSION = "WinServer2019" $tempInstallDir = "$PACKAGES_DIRECTORY\Intel_SGX_PSW" if(Test-Path $tempInstallDir) { Remove-Item -Recurse -Force $tempInstallDir @@ -499,28 +498,18 @@ function Install-DCAP-Dependencies { Install-Tool -InstallerPath $PACKAGES["dcap"]["local_file"] ` -ArgumentList @('/auto', "$PACKAGES_DIRECTORY\Intel_SGX_DCAP") - $OS_VERSION = "WinServer2019" if (($LaunchConfiguration -eq "SGX1FLC") -or ($DCAPClientType -eq "Azure")) { $drivers = @{ - 'WinServer2019' = @{ 'sgx_base' = @{ 'path' = "$PACKAGES_DIRECTORY\Intel_SGX_PSW\Intel*SGX*PSW*\base\WindowsServer2019_Windows10" 'location' = 'root\SgxLCDevice' 'description' = 'Intel(R) Software Guard Extensions Launch Configuration Service' } } - 'Win10' = @{ - 'sgx_base' = @{ - 'path' = "$PACKAGES_DIRECTORY\Intel_SGX_PSW\Intel*SGX*PSW*\base\WindowsServer2019_Windows10" - 'location' = 'root\SgxLCDevice' - 'description' = 'Intel(R) Software Guard Extensions Launch Configuration Service' - } - } - } $devConBinaryPath = Get-DevconBinary - foreach($driver in $drivers[${OS_VERSION}].Keys) { - $path = $drivers[${OS_VERSION}][$driver]['path'] + foreach($driver in $drivers.Keys) { + $path = $drivers[$driver]['path'] $inf = Get-Item "$path\$driver.inf" if(!$inf) { Throw "Cannot find $driver.inf file" @@ -531,19 +520,6 @@ function Install-DCAP-Dependencies { } if($LaunchConfiguration -eq "SGX1FLC") { - # Check if the driver is already installed and delete it - $output = & $devConBinaryPath find "$($drivers[${OS_VERSION}][$driver]['location'])" - if($LASTEXITCODE) { - Throw "Failed searching for $driver driver" - } - $output | ForEach-Object { - if($_.Contains($drivers[${OS_VERSION}][$driver]['description'])) { - Write-Output "Removing driver $($drivers[${OS_VERSION}][$driver]['location'])" - Remove-DCAPDriver -Name $drivers[${OS_VERSION}][$driver]['location'] - } - } - Write-Output "Installing driver $($drivers[${OS_VERSION}][$driver]['location'])" - $install = & pnputil /add-driver "$($inf.FullName)" /install Write-Output $install } @@ -595,7 +571,7 @@ function Install-DCAP-Dependencies { Throw "Failed to install nuget EnclaveCommonAPI" } - if (($LaunchConfiguration -eq "SGX1FLC") -or (${OS_VERSION} -eq "WinServer2019")) + if ($LaunchConfiguration -eq "SGX1FLC") { # Please refer to Intel's Windows DCAP documentation for this registry setting: https://download.01.org/intel-sgx/dcap-1.2/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\sgx_lc_msr\Parameters" -Name "SGX_Launch_Config_Optin" -Value 1 -PropertyType DWORD -Force
Added optrace tool to ya.conf.json
"lkvm": { "description": "kvmtool is a userland tool for creating and controlling KVM guests" }, + "optrace": { + "description": "optrace records output files written by each process", + "visible": false + }, "yoimports": { "description": "Go imports formatting tool" }, } ] }, + "optrace": { + "tools": { + "optrace": { + "bottle": "optrace", + "executable": "optrace" + } + }, + "platforms": [ + { + "host": { + "os": "LINUX" + }, + "default": true + } + ] + }, "gpt": { "tools": { "gpt_perf": { ] } }, + "optrace": { + "formula": { + "sandbox_id": [ + 604902095 + ], + "match": "optrace" + }, + "executable": { + "optrace": [ + "optrace" + ] + } + }, "rsync": { "formula": { "sandbox_id": [
Tools: shim-to-sig.tool better outfile name when quoted CN
@@ -100,7 +100,7 @@ if [ $? -ne 0 ]; then fi # outfile name from cert CN -certname=$(openssl x509 -noout -subject -inform der -in "$certfile" | sed 's/^subject=.*CN *= *//' | sed 's/[,\/].*//' | sed 's/ *//g') || { rm "$certfile"; exit 1; } +certname=$(openssl x509 -noout -subject -inform der -in "$certfile" | sed 's/^subject=.*CN *=[ \"]*//' | sed 's/[,\/].*//' | sed 's/ *//g') || { rm "$certfile"; exit 1; } outfile="${certname}.pem" openssl x509 -inform der -in "$certfile" -out "$outfile" || { rm "$certfile"; exit 1; }
Dockerfile: add gradle
@@ -8,7 +8,11 @@ USER root # Tools RUN apt-get -qq update && \ apt-get -qq -y --no-install-recommends install \ - ca-certificates > /dev/null && \ + ca-certificates \ + gnupg \ + software-properties-common > /dev/null && \ + add-apt-repository -y -n ppa:cwchien/gradle && \ + apt-get update && \ apt-get -qq -y --no-install-recommends install \ build-essential \ gdb \ @@ -56,6 +60,7 @@ RUN apt-get -qq update && \ > /dev/null && \ apt-get -qq -y --no-install-recommends install \ ant \ + gradle \ > /dev/null && \ rm graalvm-ce-java11_amd64_22.2.0-0.deb && \ apt-get -qq clean
mdns: Fixed the ip header TTL to be correctly set to 255 Defined in All Multicast DNS responses (including responses sent via unicast) SHOULD be sent with IP TTL set to 255
@@ -38,7 +38,7 @@ static esp_err_t _udp_pcb_main_init(void) _pcb_main = NULL; return ESP_ERR_INVALID_STATE; } - _pcb_main->mcast_ttl = 1; + _pcb_main->mcast_ttl = 255; _pcb_main->remote_port = MDNS_SERVICE_PORT; ip_addr_copy(_pcb_main->remote_ip, *(IP_ANY_TYPE)); udp_recv(_pcb_main, &_udp_recv, _mdns_server);
util: correct unpack_ftb unpack_ftb is used as a build tool to convert ST toucpad .ftb file to .bin TEST=verify that unpack_ftb is present and executable Commit-Ready: Bob Moragues Tested-by: Bob Moragues
@@ -81,8 +81,8 @@ setup( package_dir={"" : "util"}, py_modules=["unpack_ftb"], entry_points = { - "build_scripts": ["unpack_ftb=unpack_ftb:main"], + "console_scripts": ["unpack_ftb=unpack_ftb:main"], }, - description="Tool to convert .ftb files to .bin", + description="Tool to convert ST touchpad .ftb file to .bin", )
stm32/powerctrl: Enable EIWUP to ensure RTC wakes device from standby.
@@ -390,6 +390,12 @@ void powerctrl_enter_standby_mode(void) { // enable previously-enabled RTC interrupts RTC->CR |= save_irq_bits; + #if defined(STM32F7) + // Enable the internal (eg RTC) wakeup sources + // See Errata 2.2.2 "Wakeup from Standby mode when the back-up SRAM regulator is enabled" + PWR->CSR1 |= PWR_CSR1_EIWUP; + #endif + // enter standby mode HAL_PWR_EnterSTANDBYMode(); // we never return; MCU is reset on exit from standby
Fix no-cms
@@ -51,7 +51,7 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=MAIN recordlentest drbgtest drbg_cavs_test sslbuffertest \ time_offset_test pemtest ssl_cert_table_internal_test ciphername_test \ servername_test ocspapitest rsa_mp_test fatalerrtest tls13ccstest \ - sysdefaulttest cmsapitest + sysdefaulttest SOURCE[versions]=versions.c INCLUDE[versions]=../include @@ -373,9 +373,12 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=MAIN INCLUDE[servername_test]=../include DEPEND[servername_test]=../libcrypto ../libssl libtestutil.a + IF[{- !$disabled{cms} -}] + PROGRAMS_NO_INST=cmsapitest SOURCE[cmsapitest]=cmsapitest.c INCLUDE[cmsapitest]=../include DEPEND[cmsapitest]=../libcrypto libtestutil.a + ENDIF IF[{- !$disabled{psk} -}] PROGRAMS_NO_INST=dtls_mtu_test
[arch][riscv] add timer hack back For one of the riscv embedded targets, the clock ticks at such a slow rate that the compiler will warn of a div by zero. Add a compile time hack for this.
@@ -48,7 +48,11 @@ status_t platform_set_oneshot_timer (platform_timer_callback callback, void *arg lk_bigtime_t current_time_hires(void) { +#if ARCH_RISCV_MTIME_RATE < 10000000 + return current_time() * 1000llu; // hack to deal with slow clocks +#else return riscv_get_time() / (ARCH_RISCV_MTIME_RATE / 1000000u); +#endif } lk_time_t current_time(void) {
galtic: Update EC thermal table Update EC thermal table for throttle and shutdown point. BRANCH=firmware-dedede-13606.B TEST=make BOARD=galtic 1. Verified pass by thermal team.
@@ -594,6 +594,40 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); +const static struct ec_thermal_config thermal_charger = { + .temp_host = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(85), + [EC_TEMP_THRESH_HALT] = C_TO_K(98), + }, + .temp_host_release = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + }, +}; +const static struct ec_thermal_config thermal_vcore = { + .temp_host = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + [EC_TEMP_THRESH_HALT] = C_TO_K(80), + }, + .temp_host_release = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(50), + }, +}; +const static struct ec_thermal_config thermal_ambient = { + .temp_host = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + [EC_TEMP_THRESH_HALT] = C_TO_K(80), + }, + .temp_host_release = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(50), + }, +}; +struct ec_thermal_config thermal_params[] = { + [TEMP_SENSOR_1] = thermal_charger, + [TEMP_SENSOR_2] = thermal_vcore, + [TEMP_SENSOR_3] = thermal_ambient, +}; +BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); + #ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ void lid_angle_peripheral_enable(int enable)
Fix IAR error on memcpy and warnings.
#include "osal/osal.h" #include "tusb_fifo.h" +// Supress IAR warning +// Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement +#if defined(__ICCARM__) +#pragma diag_suppress = Pa082 +#endif + // implement mutex lock and unlock #if CFG_FIFO_MUTEX @@ -106,7 +112,7 @@ static void _ff_push_n(tu_fifo_t* f, void const * data, uint16_t n, uint16_t wRe memcpy(f->buffer + (wRel * f->item_size), data, nLin*f->item_size); // Write data wrapped around - memcpy(f->buffer, data + nLin*f->item_size, (n - nLin) * f->item_size); + memcpy(f->buffer, ((uint8_t const*) data) + nLin*f->item_size, (n - nLin) * f->item_size); } } @@ -131,7 +137,7 @@ static void _ff_pull_n(tu_fifo_t* f, void * p_buffer, uint16_t n, uint16_t rRel) memcpy(p_buffer, f->buffer + (rRel * f->item_size), nLin*f->item_size); // Read data wrapped part - memcpy(p_buffer + nLin*f->item_size, f->buffer, (n - nLin) * f->item_size); + memcpy((uint8_t*)p_buffer + nLin*f->item_size, f->buffer, (n - nLin) * f->item_size); } }
dbug fe: coax searchable list key into string includes() only works on strings, but we might pass in other types as keys.
@@ -33,7 +33,7 @@ export class SearchableList extends Component { let items = props.items.filter(item => { return state.query.split(' ').reduce((match, query) => { - return match && item.key.includes(query); + return match && ('' + item.key).includes(query); }, true); }) items = items.map(item =>
removed redundant notifications on deletions
$(items t.items) :: %both - =. ta-this - (ta-hall-json parent 'deleted collection' (collection-notify pax meta.col.old)) - =. ta-this - (ta-hall-json parent 'deleted item' (item-notify pax raw.old)) +:: =. ta-this +:: (ta-hall-json parent 'deleted collection' (collection-notify pax meta.col.old)) +:: =. ta-this +:: (ta-hall-json parent 'deleted item' (item-notify pax raw.old)) =. ta-this (ta-flush-permissions pax) =. ta-this (ta-flush-permissions (weld pax /collections-config)) =/ items=(list [nom=@ta =item]) ~(tap by data.col.old)
Remove blocking SSL_read while closing the TLS session
@@ -293,29 +293,11 @@ shutdownTlsSession(transport_t *trans) // protocol error occurred int ssl_err = SSL_get_error(trans->net.tls.ssl, ret); scopeLogInfo("Client SSL_shutdown failed: ssl_err=%d\n", ssl_err); - } else if (ret == 0) { - // shutdown not complete, call again - char buf[4096]; - while(1) { - ret = SCOPE_SSL_read(trans->net.tls.ssl, buf, sizeof(buf)); - if (ret <= 0) { - break; - } - } - - ret = SSL_shutdown(trans->net.tls.ssl); - if (ret != 1) { - // second shutdown not successful - int ssl_err = SSL_get_error(trans->net.tls.ssl, ret); - scopeLogInfo("Waiting for server shutdown using SSL_shutdown failed: ssl_err=%d\n", ssl_err); } - } - } - - if (trans->net.tls.ssl) { SSL_free(trans->net.tls.ssl); trans->net.tls.ssl = NULL; } + if (trans->net.tls.ctx) { SSL_CTX_free(trans->net.tls.ctx); trans->net.tls.ctx = NULL;
sway/input: fix bad position of wlr_drag
@@ -380,8 +380,8 @@ void drag_icon_update_position(struct sway_drag_icon *icon) { case WLR_DRAG_GRAB_KEYBOARD: return; case WLR_DRAG_GRAB_KEYBOARD_POINTER: - icon->x = cursor->x; - icon->y = cursor->y; + icon->x = cursor->x + wlr_icon->surface->sx; + icon->y = cursor->y + wlr_icon->surface->sy; break; case WLR_DRAG_GRAB_KEYBOARD_TOUCH:; struct wlr_touch_point *point = @@ -389,8 +389,8 @@ void drag_icon_update_position(struct sway_drag_icon *icon) { if (point == NULL) { return; } - icon->x = seat->touch_x; - icon->y = seat->touch_y; + icon->x = seat->touch_x + wlr_icon->surface->sx; + icon->y = seat->touch_y + wlr_icon->surface->sy; } drag_icon_damage_whole(icon);
build: fix cmake set() parameters order
@@ -340,7 +340,7 @@ endif() # MK Core macro(MK_SET_OPTION option value) - set(${option} ${value} CACHE "" INTERNAL FORCE) + set(${option} ${value} CACHE INTERNAL "" FORCE) endmacro() MK_SET_OPTION(MK_SYSTEM_MALLOC ON) MK_SET_OPTION(MK_DEBUG ON)
doc: fix duplicate entry warning
@@ -374,7 +374,7 @@ Functions documentation | *[in]* **q** quaternion | *[in]* **pivot** pivot -.. c:function:: void glm_quat_rotate(mat4 m, versor q, mat4 dest) +.. c:function:: void glm_quat_rotate_atm(mat4 m, versor q, vec3 pivot) | rotate NEW transform matrix using quaternion at pivot point | this creates rotation matrix, it assumes you don't have a matrix
Pass:cone supports 2-endpoint variant;
@@ -645,7 +645,7 @@ static int l_lovrPassSphere(lua_State* L) { return 0; } -static bool luax_checkendpoints(lua_State* L, int index, float transform[16]) { +static bool luax_checkendpoints(lua_State* L, int index, float transform[16], bool center) { float *v, *u; VectorType t1, t2; if ((v = luax_tovector(L, index + 0, &t1)) == NULL || t1 != V_VEC3) return false; @@ -659,7 +659,11 @@ static bool luax_checkendpoints(lua_State* L, int index, float transform[16]) { vec3_normalize(direction); quat_between(orientation, forward, direction); mat4_identity(transform); + if (center) { mat4_translate(transform, (v[0] + u[0]) / 2.f, (v[1] + u[1]) / 2.f, (v[2] + u[2]) / 2.f); + } else { + mat4_translate(transform, v[0], v[1], v[2]); + } mat4_rotateQuat(transform, orientation); mat4_scale(transform, radius, radius, length); return true; @@ -668,7 +672,7 @@ static bool luax_checkendpoints(lua_State* L, int index, float transform[16]) { static int l_lovrPassCylinder(lua_State* L) { Pass* pass = luax_checktype(L, 1, Pass); float transform[16]; - int index = luax_checkendpoints(L, 2, transform) ? 5 : luax_readmat4(L, 2, transform, -2); + int index = luax_checkendpoints(L, 2, transform, true) ? 5 : luax_readmat4(L, 2, transform, -2); bool capped = lua_isnoneornil(L, index) ? true : lua_toboolean(L, index++); float angle1 = luax_optfloat(L, index++, 0.f); float angle2 = luax_optfloat(L, index++, 2.f * (float) M_PI); @@ -680,7 +684,7 @@ static int l_lovrPassCylinder(lua_State* L) { static int l_lovrPassCone(lua_State* L) { Pass* pass = luax_checktype(L, 1, Pass); float transform[16]; - int index = luax_readmat4(L, 2, transform, -2); + int index = luax_checkendpoints(L, 2, transform, false) ? 5 : luax_readmat4(L, 2, transform, -2); uint32_t segments = luax_optu32(L, index, 64); lovrPassCone(pass, transform, segments); return 0; @@ -689,7 +693,7 @@ static int l_lovrPassCone(lua_State* L) { static int l_lovrPassCapsule(lua_State* L) { Pass* pass = luax_checktype(L, 1, Pass); float transform[16]; - int index = luax_checkendpoints(L, 2, transform) ? 5 : luax_readmat4(L, 2, transform, -2); + int index = luax_checkendpoints(L, 2, transform, true) ? 5 : luax_readmat4(L, 2, transform, -2); uint32_t segments = luax_optu32(L, index, 32); lovrPassCapsule(pass, transform, segments); return 0;
ci: Use ${{ github.ref_name }} instead of ${GITHUB_REF_NAME}. The former can be used in YAML too while the latter can only be used in bash.
@@ -705,9 +705,9 @@ jobs: export IMAGE="${{ env.REGISTRY }}/${{ env.CONTAINER_REPO }}:${IMAGE_TAG}" # Use echo of cat to avoid printing a new line between files. - echo "$(cat pkg/resources/manifests/deploy.yaml) $(cat pkg/resources/crd/bases/gadget.kinvolk.io_traces.yaml)" > inspektor-gadget-${GITHUB_REF_NAME}.yaml + echo "$(cat pkg/resources/manifests/deploy.yaml) $(cat pkg/resources/crd/bases/gadget.kinvolk.io_traces.yaml)" > inspektor-gadget-${{ github.ref_name }}.yaml - perl -pi -e 's@(image:) ".+\"@$1 "$ENV{IMAGE}"@; s@"latest"@"$ENV{IMAGE_TAG}"@;' inspektor-gadget-${GITHUB_REF_NAME}.yaml + perl -pi -e 's@(image:) ".+\"@$1 "$ENV{IMAGE}"@; s@"latest"@"$ENV{IMAGE_TAG}"@;' inspektor-gadget-${{ github.ref_name }}.yaml - name: Create Release id: create_release uses: softprops/action-gh-release@v1 @@ -716,11 +716,11 @@ jobs: name: Release ${{ github.ref }} - name: Get all artifacts. uses: actions/download-artifact@v3 - - name: Rename all artifacts to *-${{ env.GITHUB_REF_NAME }}.tar.gz + - name: Rename all artifacts to *-${{ github.ref_name }}.tar.gz shell: bash run: | for i in *-gadget-*-*-tar-gz/*-gadget-*-*.tar.gz; do - mv $i $(dirname $i)/$(basename $i .tar.gz)-${GITHUB_REF_NAME}.tar.gz + mv $i $(dirname $i)/$(basename $i .tar.gz)-${{ github.ref_name }}.tar.gz done - name: Upload Gadget Release *.tar.gz uses: csexton/release-asset-action@v2 @@ -731,7 +731,7 @@ jobs: - name: Upload YAML uses: csexton/release-asset-action@v2 with: - file: inspektor-gadget-${GITHUB_REF_NAME}.yaml + file: inspektor-gadget-${{ github.ref_name }}.yaml github-token: ${{ secrets.GITHUB_TOKEN }} release-url: ${{ steps.create_release.outputs.upload_url }} - name: Update new version in krew-index
netutils/ftpc: Fix warning about free() being implicitly defined
#include "ftpc_config.h" +#include <stdlib.h> + #include "netutils/ftpc.h" #include "ftpc_internal.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/
Introduce PY_PROTO_PLUGIN macro and use it
@@ -360,6 +360,29 @@ macro _ADD_PY_PROTO_OUT(Suf) { SET(PY_PROTO_SUFFIXES $PY_PROTO_SUFFIXES $Suf) } +### @usage: PY_PROTO_PLUGIN(Name Ext Tool DEPS <Dependencies>) +### +### Define protoc plugin for python with given Name that emits extra output with provided Extension +### using Tool. Extra dependencies are passed via DEPS +macro PY_PROTO_PLUGIN(NAME, EXT, TOOL, DEPS[]) { + SET_APPEND(PY_PROTO_OPTS $_PROTO_PLUGIN_ARGS_BASE($NAME $TOOL)) + _ADD_PY_PROTO_OUT($EXT) + # XXX fix variable expansion in plugins + SET(PY_PROTO_DEPS $PY_PROTO_DEPS $DEPS) +} + +### @usage: PY_PROTO_PLUGIN2(Name Ext1 Ext2 Tool DEPS <Dependencies>) +### +### Define protoc plugin for python with given Name that emits 2 extra outputs with provided Extensions +### using Tool. Extra dependencies are passed via DEPS +macro PY_PROTO_PLUGIN2(NAME, EXT1, EXT2, TOOL, DEPS[]) { + PY_PROTO_PLUGIN($NAME $EXT1 $TOOL DEPS $DEPS) + _ADD_PY_PROTO_OUT($EXT2) +} + +### @usage: QUASAR_PROTO() # deprecated +### +### This macro is quasar-specific and should never be used macro QUASAR_PROTO() { SET(QUASAR yes) @@ -546,10 +569,7 @@ macro GRPC() { SET(CPP_PROTO_SUFFIXES $CPP_PROTO_SUFFIXES .grpc.pb.h .grpc.pb.cc) # Python - SET_APPEND(PY_PROTO_OPTS $_PROTO_PLUGIN_ARGS_BASE(grpc_py contrib/tools/protoc/plugins/grpc_python)) - _ADD_PY_PROTO_OUT(_pb2_grpc.py) - # XXX fix variable expansion in plugins - SET(PY_PROTO_DEPS $PY_PROTO_DEPS contrib/libs/grpc/python contrib/libs/grpc) + PY_PROTO_PLUGIN(grpc_py _pb2_grpc.py contrib/tools/protoc/plugins/grpc_python DEPS contrib/libs/grpc/python contrib/libs/grpc) # Java SET_APPEND(JAVA_PROTO_ARGS --plugin=protoc-gen-grpc_java=\${tool:"contrib/tools/protoc/plugins/grpc_java"} --grpc_java_out=$ARCADIA_BUILD_ROOT/java_out) @@ -4656,11 +4676,7 @@ macro TASKLET() { SET(CPP_PROTO_SUFFIXES $CPP_PROTO_SUFFIXES .tasklet.h) # Python - SET_APPEND(PY_PROTO_OPTS $_PROTO_PLUGIN_ARGS_BASE(tasklet_py tasklet/gen/python)) - _ADD_PY_PROTO_OUT(_tasklet.py) - _ADD_PY_PROTO_OUT(_sbtask.py) - # XXX fix variable expansion in plugins - SET(PY_PROTO_DEPS $PY_PROTO_DEPS tasklet/domain/sandbox tasklet/runtime sandbox/sdk2) + PY_PROTO_PLUGIN2(tasklet_py _tasklet.py _sbtask.py tasklet/gen/python DEPS tasklet/domain/sandbox tasklet/runtime sandbox/sdk2) } TASKLET_REG_INCLUDES= \
esp_event: extend register/unregister test case to cover overwriting existing handler works as expected
@@ -130,6 +130,9 @@ static esp_event_loop_args_t test_event_get_default_loop_args() static void test_event_simple_handler(void* event_handler_arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { + if (!event_handler_arg) { + return; + } simple_arg_t* arg = (simple_arg_t*) event_handler_arg; xSemaphoreTake(arg->mutex, portMAX_DELAY); @@ -391,7 +394,13 @@ TEST_CASE("can register/unregister handlers for all events/all events for a spec loop_args.task_name = NULL; TEST_ASSERT_EQUAL(ESP_OK, esp_event_loop_create(&loop_args, &loop)); + /* Register the handler twice to the same base and id but with a different argument (expects to return ESP_OK and log a warning) + * This aims to verify: 1) Handler's argument to be updated + * 2) Registration not to leak memory + */ + TEST_ASSERT_EQUAL(ESP_OK, esp_event_handler_register_with(loop, ESP_EVENT_ANY_BASE, ESP_EVENT_ANY_ID, test_event_simple_handler, NULL)); TEST_ASSERT_EQUAL(ESP_OK, esp_event_handler_register_with(loop, ESP_EVENT_ANY_BASE, ESP_EVENT_ANY_ID, test_event_simple_handler, &arg)); + TEST_ASSERT_EQUAL(ESP_OK, esp_event_handler_register_with(loop, s_test_base1, ESP_EVENT_ANY_ID, test_event_simple_handler, &arg)); TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_event_handler_register_with(loop, ESP_EVENT_ANY_BASE, TEST_EVENT_BASE1_EV1, test_event_simple_handler, &arg)); TEST_ASSERT_EQUAL(ESP_OK, esp_event_handler_register_with(loop, s_test_base1, TEST_EVENT_BASE1_EV1, test_event_simple_handler, &arg));
npu2: Add a function to detect POWER9 DD1 Provide a convenience we'll use quite a bit to preserve backwards compatibility with DD1. Acked-by: Alistair Popple Cc: Frederic Barrat
#define VENDOR_CAP_PCI_DEV_OFFSET 0x0d +static bool is_p9dd1(void) +{ + struct proc_chip *chip = next_chip(NULL); + + return chip && + (chip->type == PROC_CHIP_P9_NIMBUS || + chip->type == PROC_CHIP_P9_CUMULUS) && + (chip->ec_level & 0xf0) == 0x10; +} + /* * We use the indirect method because it uses the same addresses as * the MMIO offsets (NPU RING)
Libraries should link on the SO
@@ -2,12 +2,12 @@ all : lib data_recorder test calibrate calibrate_client simple_pose_test CC?=gcc -CFLAGS:=-Iinclude/libsurvive -fPIC -g -O3 -Iredist -flto -DUSE_DOUBLE -std=gnu99 -rdynamic -llapacke -lcblas -lm #-fsanitize=address -fsanitize=undefined -Wall -Wno-unused-variable -Wno-switch -Wno-unused-but-set-variable -Wno-pointer-sign -Wno-parentheses +CFLAGS:=-Iinclude/libsurvive -fPIC -g -O3 -Iredist -flto -DUSE_DOUBLE -std=gnu99 -rdynamic #-fsanitize=address -fsanitize=undefined -Wall -Wno-unused-variable -Wno-switch -Wno-unused-but-set-variable -Wno-pointer-sign -Wno-parentheses CFLAGS_RELEASE:=-Iinclude/libsurvive -fPIC -msse2 -ftree-vectorize -O3 -Iredist -flto -DUSE_DOUBLE -std=gnu99 -rdynamic -llapacke -lcblas -lm #LDFLAGS:=-L/usr/local/lib -lpthread -lusb-1.0 -lz -lm -flto -g -LDFLAGS:=-L/usr/local/lib -lpthread -lz -lm -flto -g +LDFLAGS:=-L/usr/local/lib -lpthread -lz -lm -flto -g -llapacke -lcblas -lm #---------- # Platform specific changes to CFLAGS/LDFLAGS
fixed embedded cart loading on Windows
@@ -2943,7 +2943,11 @@ void initConsole(Console* console, tic_mem* tic, FileSystem* fs, Config* config, char appPath[TICNAME_MAX]; #if defined(__TIC_WINDOWS__) - GetModuleFileNameA(NULL, appPath, sizeof appPath); + { + wchar_t wideAppPath[TICNAME_MAX]; + GetModuleFileNameW(NULL, wideAppPath, sizeof wideAppPath); + WideCharToMultiByte(CP_UTF8, 0, wideAppPath, COUNT_OF(wideAppPath), appPath, COUNT_OF(appPath), 0, 0); + } #elif defined(__TIC_LINUX__) s32 size = readlink("/proc/self/exe", appPath, sizeof appPath); appPath[size] = '\0';
OcAppleBootCompatLib: Fix Status overwrite with GetExecArea call
@@ -358,6 +358,7 @@ OcGetMemoryMap ( ) { EFI_STATUS Status; + EFI_STATUS Status2; BOOT_COMPAT_CONTEXT *BootCompat; EFI_PHYSICAL_ADDRESS Address; UINTN Pages; @@ -377,9 +378,9 @@ OcGetMemoryMap ( } if (BootCompat->Settings.SyncRuntimePermissions && BootCompat->ServiceState.FwRuntime != NULL) { - Status = BootCompat->ServiceState.FwRuntime->GetExecArea (&Address, &Pages); + Status2 = BootCompat->ServiceState.FwRuntime->GetExecArea (&Address, &Pages); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR (Status2)) { OcUpdateDescriptors ( *MemoryMapSize, MemoryMap,
esp_adc: defined an example macro for attenuation
@@ -37,6 +37,8 @@ const static char *TAG = "EXAMPLE"; #endif #endif +#define EXAMPLE_ADC_ATTEN ADC_ATTEN_DB_11 + static int adc_raw[2][10]; static int voltage[2][10]; static bool example_adc_calibration_init(adc_unit_t unit, adc_atten_t atten, adc_cali_handle_t *out_handle); @@ -55,14 +57,14 @@ void app_main(void) //-------------ADC1 Config---------------// adc_oneshot_chan_cfg_t config = { .bitwidth = ADC_BITWIDTH_DEFAULT, - .atten = ADC_ATTEN_DB_11, + .atten = EXAMPLE_ADC_ATTEN, }; ESP_ERROR_CHECK(adc_oneshot_config_channel(adc1_handle, EXAMPLE_ADC1_CHAN0, &config)); ESP_ERROR_CHECK(adc_oneshot_config_channel(adc1_handle, EXAMPLE_ADC1_CHAN1, &config)); //-------------ADC1 Calibration Init---------------// adc_cali_handle_t adc1_cali_handle = NULL; - bool do_calibration1 = example_adc_calibration_init(ADC_UNIT_1, ADC_ATTEN_DB_11, &adc1_cali_handle); + bool do_calibration1 = example_adc_calibration_init(ADC_UNIT_1, EXAMPLE_ADC_ATTEN, &adc1_cali_handle); #if (SOC_ADC_PERIPH_NUM >= 2) @@ -76,7 +78,7 @@ void app_main(void) //-------------ADC2 Calibration Init---------------// adc_cali_handle_t adc2_cali_handle = NULL; - bool do_calibration2 = example_adc_calibration_init(ADC_UNIT_2, ADC_ATTEN_DB_11, &adc2_cali_handle); + bool do_calibration2 = example_adc_calibration_init(ADC_UNIT_2, EXAMPLE_ADC_ATTEN, &adc2_cali_handle); //-------------ADC2 Config---------------// ESP_ERROR_CHECK(adc_oneshot_config_channel(adc2_handle, EXAMPLE_ADC2_CHAN0, &config));
decisions: improve ensure API
@@ -42,24 +42,36 @@ Integrate `kdbEnsure` in `kdbOpen(Key *errorKey, KeySet *contract)` but only all ## Implications -`elektraNotificationOpen` needs to be removed and instead we need a new API: +`elektraNotificationOpen` will only return a contract KeySet: ```c KeySet * contract = ksNew (0, KS_END); -elektraNotificationGetContract (contract); -KDB * kdb = kdbOpen (key, contract); // contract contains notification config -elektraIoSetBinding (kdb, binding); +elektraNotificationContract (contract, iobinding); ``` -Similar contract getters need to be introduced for other functionality, like gopts: +The same for gopts: + +```c +elektraGOptsContract (contract, argc, argv, environ)); +``` + +Finally, we create `KDB` with the contracts we got before: ```c -KeySet * contract = ksNew (0, KS_END); -elektraGOptsGetContract (contract, argc, argv, environ); KDB * kdb = kdbOpen (key, contract); ``` -The high-level API can make this more pretty, though. +Opening `KDB` will fail if any of the contracts cannot be ensured. + +The cleanup happens within: + +```c +kdbClose (kdb, errorKey); +ksDel (contract); +``` + +It is save to use the contract `KeySet` also for `kdbGet` and `kdbSet` +invocations. ## Related Decisions
ETH:optimized double is_tagged check a double version of is_tagged, uses "free lanes" in _mm_cmpeq_epi16 to check a second tag this code was not yet tested for performance
@@ -285,6 +285,29 @@ determine_next_node (ethernet_main_t * em, } } +static_always_inline int +ethernet_frame_is_any_tagged (u16 type0, u16 type1) +{ +#if __SSE4_2__ + const __m128i ethertype_mask = _mm_set_epi16 (ETHERNET_TYPE_VLAN, + ETHERNET_TYPE_DOT1AD, + ETHERNET_TYPE_VLAN_9100, + ETHERNET_TYPE_VLAN_9200, + /* duplicate for type1 */ + ETHERNET_TYPE_VLAN, + ETHERNET_TYPE_DOT1AD, + ETHERNET_TYPE_VLAN_9100, + ETHERNET_TYPE_VLAN_9200); + + __m128i r = + _mm_set_epi16 (type0, type0, type0, type0, type1, type1, type1, type1); + r = _mm_cmpeq_epi16 (ethertype_mask, r); + return !_mm_test_all_zeros (r, r); +#else + return ethernet_frame_is_tagged (type0) || ethernet_frame_istagged (type1); +#endif +} + static_always_inline uword ethernet_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, @@ -377,8 +400,7 @@ ethernet_input_inline (vlib_main_t * vm, /* Speed-path for the untagged case */ if (PREDICT_TRUE (variant == ETHERNET_INPUT_VARIANT_ETHERNET - && !ethernet_frame_is_tagged (type0) - && !ethernet_frame_is_tagged (type1))) + && !ethernet_frame_is_any_tagged (type0, type1))) { main_intf_t *intf0; subint_config_t *subint0;
Construct non-fast array in ecma_op_array_species_create Fixes JerryScript-DCO-1.0-Signed-off-by: Peter Marki
@@ -704,7 +704,11 @@ ecma_op_array_species_create (ecma_object_t *original_array_p, /**< The object f if (ecma_is_value_undefined (constructor)) { - return ecma_make_object_value (ecma_op_new_fast_array_object (length)); + ecma_value_t length_val = ecma_make_uint32_value (length); + ecma_value_t new_array = ecma_op_create_array_object (&length_val, 1, true); + ecma_free_value (length_val); + + return new_array; } if (!ecma_is_constructor (constructor))
crota: remove the bring-up feature Disable the debug command powerindebug. BRANCH=none TEST=make -j BOARD=crota
#define PD_MAX_CURRENT_MA 3000 #define PD_MAX_VOLTAGE_MV 20000 +#undef CONFIG_CMD_POWERINDEBUG + /* * Macros for GPIO signals used in common code that don't match the * schematic names. Signal names in gpio.inc match the schematic and are
fix: Delete unnecessary header references issue
@@ -15,9 +15,9 @@ BOAT_COPY := cp EXTERNAL_INC := -I'$(CURDIR)/../inc/os' -I'$(CURDIR)/../inc/apb' -I'$(CURDIR)/../inc/lwip' \ -I'$(CURDIR)/../inc' -I'$(CURDIR)/../inc/cm' \ - -I'$(CURDIR)/../inc/mbedtls' -I'$(CURDIR)/../inc/os/include' -I'$(CURDIR)/../inc/cJSON' -I'$(CURDIR)/../inc/bluetooth' \ + -I'$(CURDIR)/../inc/os/include' -I'$(CURDIR)/../inc/cJSON' \ -I'$(CURDIR)/../prebuilt/ML302/LTE/components/newlib/include' \ - -I'$(CURDIR)/../prebuilt/ML302/LTE/components/newlib/include/sys' \ + -I'$(CURDIR)/../prebuilt/ML302/LTE/components/newlib/include/sys'
Teak interop
@@ -22,7 +22,7 @@ LOG=/logs/log.txt if [ "$ROLE" == "client" ]; then # Wait for the simulator to start up. /wait-for-it.sh sim:57832 -s -t 30 - CLIENT_ARGS="server 443 --download /downloads -s --no-quic-dump --no-http-dump" + CLIENT_ARGS="server 443 --download /downloads -s --no-quic-dump --no-http-dump --timeout=5s" if [ "$TESTCASE" == "versionnegotiation" ]; then CLIENT_ARGS="$CLIENT_ARGS -v 0xaaaaaaaa" fi @@ -30,9 +30,9 @@ if [ "$ROLE" == "client" ]; then CLIENT_ARGS="$CLIENT_ARGS --session-file session.txt --tp-file tp.txt" REQS=($REQUESTS) REQUESTS=${REQS[0]} - /usr/local/bin/client $CLIENT_ARGS $REQUESTS $CLIENT_PARAMS &> $LOG + /usr/local/bin/client $CLIENT_ARGS --exit-on-first-stream-close $REQUESTS $CLIENT_PARAMS &> $LOG REQUESTS=${REQS[@]:1} - /usr/local/bin/client $CLIENT_ARGS $REQUESTS $CLIENT_PARAMS &> $LOG + /usr/local/bin/client $CLIENT_ARGS --disable-early-data $REQUESTS $CLIENT_PARAMS &> $LOG else /usr/local/bin/client $CLIENT_ARGS $REQUESTS $CLIENT_PARAMS &> $LOG fi
Change var name to test AppVeyor build failure notification
@@ -32,7 +32,7 @@ namespace NF.TestApplication_NEW //////////////////////////////////////////////////////////////////////////////////// // ToString() test int thisIsAnInteger = 64; - var testString = thisIsAnInteger.ToString(); + var testString = thisIsAnInteger_WRONG_NAME.ToString(); ////////////////////////////////////////////////////////////////////////////////////
Keep deb file on Dockerfile
@@ -46,7 +46,7 @@ RUN apt-get update && apt-get install -y \ procps \ && rm -rf /var/lib/apt/lists/* COPY --from=BUILD /tmp/datafari/debian7/installer/dist/datafari.deb . -RUN DEBIAN_FRONTEND=noninteractive dpkg -i datafari.deb && rm -rf datafari.deb +RUN DEBIAN_FRONTEND=noninteractive dpkg -i datafari.deb EXPOSE 8080 8983 5601 9200 RUN useradd -m demo && echo "demo:demo" | chpasswd && adduser demo sudo RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
Fix openssl 3 cmake build issues
@@ -18,9 +18,11 @@ option(QUIC_USE_SYSTEM_LIBCRYPTO "Use system libcrypto if openssl TLS" OFF) # the openssl version cloned if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/openssl/CHANGES") message(STATUS "Configuring for OpenSSL 1.1") + set(EXPECTED_OPENSSL_VERSION 1.1.1) else() set(QUIC_USE_OPENSSL3 ON) message(STATUS "Configuring for OpenSSL 3.0") + set(EXPECTED_OPENSSL_VERSION 3.0) endif() set(OPENSSL_CONFIG_FLAGS @@ -34,7 +36,7 @@ set(OPENSSL_CONFIG_FLAGS no-weak-ssl-ciphers no-shared no-tests) if (QUIC_USE_OPENSSL3) - list(APPEND OPENSSL_CONFIG_FLAGS no-uplink no-cmp no-fips no-padlockeng no-siv) + list(APPEND OPENSSL_CONFIG_FLAGS no-uplink no-cmp no-fips no-padlockeng no-siv --libdir=lib) endif() if (WIN32) @@ -293,10 +295,10 @@ else() if (QUIC_USE_SYSTEM_LIBCRYPTO) include(FindOpenSSL) if (OPENSSL_FOUND) - if (OPENSSL_VERSION VERSION_EQUAL 1.1.1) + if (OPENSSL_VERSION VERSION_EQUAL EXPECTED_OPENSSL_VERSION) target_link_libraries(OpenSSLQuic INTERFACE OpenSSL::Crypto) else() - message(FATAL_ERROR "OpenSSL 1.1.1 not found, found ${OPENSSL_VERSION}") + message(FATAL_ERROR "OpenSSL ${EXPECTED_OPENSSL_VERSION} not found, found ${OPENSSL_VERSION}") endif() else() message(FATAL_ERROR "System OpenSSL not found when requested")
MARS: Amend type 'sfo'
70 or Ocean reanalysis 71 fx Flux forcing 72 fu Fill-up -73 sfo Simulation forced with observations +73 sfo Simulations with forcing 80 fcmean Forecast mean 81 fcmax Forecast maximum 82 fcmin Forecast minimum
Ikea Styrbar improve top/side buttons detection If a long press a side button is aborted too early, this could have locked up top/bottom buttons ON/OFF commands until pressing a second time. The PR checks the timestamp to verify that previous command id 0x09 is part of a long press sequence.
@@ -5038,6 +5038,11 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A if (zclFrame.payload().at(0) == 0x00 && zclFrame.payload().at(1) == 0x00) { sensor->previousCommandId = 0x09; + ResourceItem *item = sensor->item(RStateButtonEvent); + if (item) + { + item->setLastZclReport(deCONZ::steadyTimeRef()); + } } else { @@ -5048,14 +5053,23 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A ok = true; } } + } } else if (ind.clusterId() == ONOFF_CLUSTER_ID && sensor->previousCommandId == 0x09 && sensor->modelId() == QLatin1String("Remote Control N2")) { // for left and right buttons long press, the Ikea Styrbar sends: // 0x09 -> ON -> 0x07 -> 0x08 -> 0x09 - // disable to not trigger 1002 and 2002 button events - ok = false; + // disable to not trigger 1002 and 2002 button events, if last 0x09 was received within 2 seconds + // check that ON is received within 2 seconds is needed, since user can abort long press after 0x09 command + + ResourceItem *item = sensor->item(RStateButtonEvent); + + if (item && deCONZ::steadyTimeRef() - item->lastZclReport() < deCONZ::TimeMs{2000}) + { + ok = false; // part of long press + } + sensor->previousCommandId = 0xFF; } else if (ind.clusterId() == LEVEL_CLUSTER_ID && zclFrame.commandId() == 0x04 && // move to level (with on/off)
fix copypasted message
@@ -392,7 +392,7 @@ void TFullModel::Calc(TConstArrayRef<TConstArrayRef<float>> floatFeatures, } const size_t docCount = Max(catFeatures.size(), floatFeatures.size()); CB_ENSURE(ObliviousTrees.GetNumFloatFeatures() == 0 || !floatFeatures.Empty(), "Model has float features but no float features provided"); - CB_ENSURE(ObliviousTrees.GetNumCatFeatures() == 0 || !catFeatures.Empty(), "Model has float features but no float features provided"); + CB_ENSURE(ObliviousTrees.GetNumCatFeatures() == 0 || !catFeatures.Empty(), "Model has categorical features but no categorical features provided"); for (const auto& floatFeaturesVec : floatFeatures) { CB_ENSURE(floatFeaturesVec.size() >= ObliviousTrees.GetNumFloatFeatures(), "insufficient float features vector size: " << floatFeaturesVec.size() @@ -425,7 +425,7 @@ void TFullModel::Calc(TConstArrayRef<TConstArrayRef<float>> floatFeatures, CB_ENSURE(catFeatures.size() == floatFeatures.size()); } CB_ENSURE(ObliviousTrees.GetNumFloatFeatures() == 0 || !floatFeatures.Empty(), "Model has float features but no float features provided"); - CB_ENSURE(ObliviousTrees.GetNumCatFeatures() == 0 || !catFeatures.Empty(), "Model has float features but no float features provided"); + CB_ENSURE(ObliviousTrees.GetNumCatFeatures() == 0 || !catFeatures.Empty(), "Model has categorical features but no categorical features provided"); const size_t docCount = Max(catFeatures.size(), floatFeatures.size()); for (const auto& floatFeaturesVec : floatFeatures) { CB_ENSURE(floatFeaturesVec.size() >= ObliviousTrees.GetNumFloatFeatures(), @@ -461,7 +461,7 @@ TVector<TVector<double>> TFullModel::CalcTreeIntervals( } const size_t docCount = Max(catFeatures.size(), floatFeatures.size()); CB_ENSURE(ObliviousTrees.GetNumFloatFeatures() == 0 || !floatFeatures.Empty(), "Model has float features but no float features provided"); - CB_ENSURE(ObliviousTrees.GetNumCatFeatures() == 0 || !catFeatures.Empty(), "Model has float features but no float features provided"); + CB_ENSURE(ObliviousTrees.GetNumCatFeatures() == 0 || !catFeatures.Empty(), "Model has categorical features but no categorial features provided"); for (const auto& floatFeaturesVec : floatFeatures) { CB_ENSURE(floatFeaturesVec.size() >= ObliviousTrees.GetNumFloatFeatures(), "insufficient float features vector size: " << floatFeaturesVec.size()
Added error checking for OBJ_create fixes segmentation fault in case of not enough memory for object creation CLA: trivial
@@ -691,6 +691,8 @@ int OBJ_create(const char *oid, const char *sn, const char *ln) /* Convert numerical OID string to an ASN1_OBJECT structure */ tmpoid = OBJ_txt2obj(oid, 1); + if (tmpoid == NULL) + return 0; /* If NID is not NID_undef then object already exists */ if (OBJ_obj2nid(tmpoid) != NID_undef) {
PG command timeout
@@ -505,7 +505,7 @@ namespace MiningCore logger.ThrowLogPoolStartupException("Postgres configuration: invalid or missing 'user'"); // build connection string - var connectionString = $"Server={pgConfig.Host};Port={pgConfig.Port};Database={pgConfig.Database};User Id={pgConfig.User};Password={pgConfig.Password};CommandTimeout=90;"; + var connectionString = $"Server={pgConfig.Host};Port={pgConfig.Port};Database={pgConfig.Database};User Id={pgConfig.User};Password={pgConfig.Password};CommandTimeout=300;"; // register connection factory builder.RegisterInstance(new ConnectionFactory(connectionString))
router: fix Coverity time of check time of use CID 149530
/* - * Copyright 2013-2021 Fabian Groffen + * Copyright 2013-2022 Fabian Groffen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1155,6 +1155,7 @@ router_readconfig(router *orig, { FILE *cnf; char *buf; + int fd; size_t len = 0; struct stat st; router *ret = NULL; @@ -1211,15 +1212,23 @@ router_readconfig(router *orig, return ret; } /* else: include path is a regular file path */ + fd = open(path, O_RDONLY); + if (fd == -1) { + logerr("unable to open file '%s': %s\n", path, strerror(errno)); + return NULL; + } + /* if there is no config, don't try anything */ - if (stat(path, &st) == -1) { + if (fstat(fd, &st) == -1) { logerr("unable to stat file '%s': %s\n", path, strerror(errno)); + close(fd); return NULL; } /* if we're not dealing with a file, say so */ if (!S_ISREG(st.st_mode)) { logerr("cannot open non-regular file '%s'\n", path); + close(fd); return NULL; } @@ -1230,11 +1239,13 @@ router_readconfig(router *orig, /* get a return structure (and allocator) in place */ if ((ret = malloc(sizeof(router))) == NULL) { logerr("malloc failed for router return struct\n"); + close(fd); return NULL; } ret->a = ra_new(); if (ret->a == NULL) { logerr("malloc failed for allocator\n"); + close(fd); free(ret); return NULL; } @@ -1247,6 +1258,7 @@ router_readconfig(router *orig, if (err != NULL) { logerr("setcollectorvals: %s\n", err); router_free(ret); + close(fd); return NULL; } ret->collector.stub = NULL; @@ -1265,12 +1277,14 @@ router_readconfig(router *orig, if (cl == NULL) { logerr("malloc failed for blackhole cluster\n"); router_free(ret); + close(fd); return NULL; } cl->name = ra_strdup(ret->a, "blackhole"); if (cl->name == NULL) { logerr("malloc failed for blackhole cluster name\n"); router_free(ret); + close(fd); return NULL; } cl->type = BLACKHOLE; @@ -1286,6 +1300,7 @@ router_readconfig(router *orig, if (palloc == NULL) { logerr("malloc failed for parse allocator\n"); router_free(ret); + close(fd); return NULL; } @@ -1293,13 +1308,15 @@ router_readconfig(router *orig, logerr("malloc failed for config file buffer\n"); ra_free(palloc); router_free(ret); + close(fd); return NULL; } - if ((cnf = fopen(path, "r")) == NULL) { + if ((cnf = fdopen(fd, "r")) == NULL) { logerr("failed to open config file '%s': %s\n", path, strerror(errno)); ra_free(palloc); router_free(ret); + close(fd); return NULL; }
Fix iOS compilation flags
@@ -36,10 +36,10 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /WINMD /NODEFAULTLIB endif(WIN32) if(IOS) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_RELEASE} -fvisibility=hidden") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -ftemplate-depth=1024 -fexceptions -frtti -fvisibility=hidden -fvisibility-inlines-hidden") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -Os -flto=full") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -Os -flto=full") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -ftemplate-depth=1024 -fexceptions -frtti -fvisibility=hidden -fvisibility-inlines-hidden") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os -flto=full") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -flto=full") set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH YES) set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_MODULES YES)
sync comments with schema
@@ -15,9 +15,8 @@ enum EBitsPerDocumentFeature : ubyte { BPDF_32 = 32 } -// Represents chunk of feature values. Depending on whether feature is numeric or categorical one -// of `Quants` or `HashIndices` will not be null. Chunk itself doesn't store information on feature -// index or range of documents, it's expected that user will store this information somewhere. +// Represents chunk of feature values. Chunk itself doesn't store information on feature +// index, type or range of documents, it's expected that user will store this information somewhere. // // One of possible usages will be to organize quantized pool in a following manner: // @@ -31,8 +30,7 @@ enum EBitsPerDocumentFeature : ubyte { // - `chunk` -- blob than can be read with `GetRoot<TQuantizedFeatureChunk>(chunk.data())` // // It also may be useful to apply some compression algorithm to `chunk` (if you are going to store -// it in a distributed storage). Also, don't forget that to categorical features will take 4 times -// more space than numeric feature. +// it in a distributed storage). // table TQuantizedFeatureChunk { // Number of bits used to store per-document quantized feature value.
libhfcommon/util: correct declaration of util_getProgAddr for macos
@@ -824,7 +824,7 @@ lhfc_addr_t util_getProgAddr(const void* addr) { return (lhfc_addr_t)dl_iterate_phdr(addrStatic_cb, (void*)addr); } #else /* !defined(_HF_ARCH_DARWIN) */ -bool util_getProgAddr(const void* addr HF_ADDR_UNUSED) { +lhfc_addr_t util_getProgAddr(const void* addr) { return LHFC_ADDR_NOTFOUND; } #endif /* !defined(_HF_ARCH_DARWIN) */
doc: fix formatting of up2 doc Update doc to remove trailing spaces on lines, wrap long lines, add formatting missed during regular review.
@@ -21,7 +21,8 @@ Prerequisites In this tutorial two Linux privileged VMs are started by the ACRN hypervisor. To set up the Linux root filesystems for each VM, follow the Clear Linux OS -`bare metal installation guide <https://clearlinux.org/documentation/clear-linux/get-started/bare-metal-install#bare-metal-install>`_ +`bare metal installation guide +<https://clearlinux.org/documentation/clear-linux/get-started/bare-metal-install#bare-metal-install>`_ to install Clear Linux OS on a **SATA disk** and a **USB flash disk** prior the setup, as the two privileged VMs will mount the root filesystems via the SATA controller and the USB controller respectively. @@ -56,8 +57,8 @@ Build kernel and modules for partition mode UOS #. Current ACRN partition mode implementation requires a multi-boot capable bootloader to boot both ACRN hypervisor and the bootable kernel image built from the previous step. You could install Ubuntu OS to the UP2 board - by following - `this Ubuntu tutorial <https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-desktop>`_. + by following `this Ubuntu tutorial + <https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-desktop>`_. The Ubuntu installer creates 3 disk partitions on the on-board eMMC memory. By default, the GRUB bootloader is installed on the ESP (EFI System Partition) partition, which will be used to bootstrap the partition mode ACRN hypervisor. @@ -297,7 +298,8 @@ Enable partition mode in ACRN hypervisor .. note:: - The root device for VM1 is also /dev/sda3 since the USB controller is the only one seen in that VM. + The root device for VM1 is also ``/dev/sda3`` since the USB + controller is the only one seen in that VM. #. Build the ACRN hypervisor and copy the artifact ``acrn.32.out`` to the ``/boot`` directory:
profile snapshot saving
@@ -228,6 +228,12 @@ static void Train( profile.StartNextIteration(); + if (timer.Passed() > ctx->OutputOptions.GetSnapshotSaveInterval()) { + profile.AddOperation("Save snapshot"); + ctx->SaveProgress(); + timer.Reset(); + } + trainOneIterationFunc(learnData, testDataPtrs, ctx); bool calcAllMetrics = DivisibleOrLastIteration( @@ -272,11 +278,6 @@ static void Train( &logger ); - if (timer.Passed() > ctx->OutputOptions.GetSnapshotSaveInterval()) { - ctx->SaveProgress(); - timer.Reset(); - } - if (HasInvalidValues(ctx->LearnProgress.LeafValues)) { ctx->LearnProgress.LeafValues.pop_back(); ctx->LearnProgress.TreeStruct.pop_back();
remove duplicated Detection reinit and manage reinit message transmitted by detector module
@@ -373,9 +373,8 @@ unsigned char RouteTB_ResetNetworkDetection(vm_t *vm) return 1; if (Robus_SendMsg(vm, &msg)) return 1; - - // reinit detection - Detec_InitDetection(); + // run luos_loop() to manage the 2 previous broadcast msgs. + Luos_Loop(); return 0; }
Tidy config file
-# Welcome to Jekyll! -# -# This config file is meant for settings that affect your whole blog, values -# which you are expected to set up once and rarely edit after that. If you find -# yourself editing this file very often, consider using Jekyll's data files -# feature for the data you need to update frequently. -# -# For technical reasons, this file is *NOT* reloaded automatically when you use -# 'bundle exec jekyll serve'. If you change this file, please restart the server process. - -# Site settings -# These are used to personalize your new site. If you look in the HTML files, -# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. -# You can create any custom variable you would like, and they will be accessible -# in the templates via {{ site.myvariable }}. -# Enable or disable the site search +title: Dictu +description: >- + Dictu is a very simple dynamically typed programming language built upon the craftinginterpreters tutorial. + +color_scheme: "dictu" # Custom theme +logo: "/assets/images/dictu-logo/dictu-wordmark.svg" + +version: "0.10.0" +github_username: dictu-lang search_enabled: true + url: "https://dictu-lang.com" +# theme: "just-the-docs" +footer_content: "This site uses Just The Docs, with modifications." ga_tracking: "UA-109828853-2" -# Aux links for the upper right navigation aux_links: - "View Dictu on GitHub": - - "//github.com/Jason2605/dictu" + "Contribute on GitHub": + - "//github.com/dictu-lang/Dictu" -# Color scheme currently only supports "dark" or nil (default) -color_scheme: nil +# Don't touch anything beyond this point permalink: pretty exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"] -title: Dictu -description: >- # this means to ignore newlines until "baseurl:" - Dictu is a very simple dynamically typed programming language built upon the craftinginterpreters tutorial. -github_username: Jason2605 - # Build settings markdown: kramdown remote_theme: pmarsceill/just-the-docs @@ -42,8 +31,6 @@ plugins: - jekyll-feed - jekyll-sitemap -version: "0.10.0" - # Exclude from processing. # The following items will not be processed, by default. Create a custom list # to override the default setting.
log: add a null check and fix indentation
@@ -171,6 +171,9 @@ int log_get_level(const char *module) { int i = 0; + if(module == NULL) { + return -1; + } while(all_modules[i].name != NULL) { if(!strcmp(module, all_modules[i].name)) { return *all_modules[i].curr_log_level;
Scripts: fix the Code Table unit parentheses
@@ -69,11 +69,13 @@ sub WriteFile { print MYFILE "# $title\n"; } my $unit_text = ($unit eq "" ? "" : "($unit)"); + $unit_text =~ s/\(\(Code /(Code /; + $unit_text =~ s/\)\)/)/; if ($codeFlag =~ /\-/) { print MYFILE "# $codeFlag $meaning $unit_text\n"; } else { - my $codeFlag1 = $codeFlag; - my $codeFlag2 = $codeFlag; + my $codeFlag1 = $codeFlag; # A number + my $codeFlag2 = $codeFlag; # A number or string abbreviation if ($filename eq "1.4.table") { # Special case. Do not just put 2nd code, translate it to shortName for 'mars type' $codeFlag2 = TranslateCodes_Table_1_4($codeFlag);
Align code styles of indent and so on
@@ -915,6 +915,8 @@ static int ssl_tls13_parse_finished_message( mbedtls_ssl_context *ssl, return( 0 ); } + +#if defined(MBEDTLS_SSL_CLI_C) static int ssl_tls13_postprocess_server_finished_message( mbedtls_ssl_context *ssl ) { int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; @@ -971,14 +973,19 @@ cleanup: } return( ret ); } +#endif /* MBEDTLS_SSL_CLI_C */ static int ssl_tls13_postprocess_finished_message( mbedtls_ssl_context* ssl ) { +#if defined(MBEDTLS_SSL_CLI_C) if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT ) { return( ssl_tls13_postprocess_server_finished_message( ssl ) ); } +#else + ((void) ssl); +#endif /* MBEDTLS_SSL_CLI_C */ return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); }
Replace Ninja with Make as default build instruction on Linux
@@ -98,7 +98,14 @@ With this one function call: On Windows it is recommended to use [CMake UI](https://cmake.org/runningcmake/). Alternatively you can generate a Visual Studio project map using CMake in command line: `cmake -B./build/ -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 16 2019" -A x64 ./` -On Linux, use CMake with [Ninja](https://ninja-build.org/) and run `cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Debug` +On Linux: + +``` +mkdir build +cd build +cmake .. +make +``` The following CMake options are available
Make sure that all template calls to log controller features are done via GetLogController
@@ -287,7 +287,7 @@ namespace ARIASDK_NS_BEGIN static status_t SetTransmitProfile(TransmitProfile profile) { if (isHost()) - LM_SAFE_CALL(SetTransmitProfile, profile); + LM_SAFE_CALL(GetLogController()->SetTransmitProfile, profile); return STATUS_EPERM; // Permission denied } @@ -301,7 +301,7 @@ namespace ARIASDK_NS_BEGIN static status_t SetTransmitProfile(const std::string& profile) { if (isHost()) - LM_SAFE_CALL(SetTransmitProfile, profile); + LM_SAFE_CALL(GetLogController()->SetTransmitProfile, profile); return STATUS_EPERM; // Permission denied } @@ -313,7 +313,7 @@ namespace ARIASDK_NS_BEGIN static status_t LoadTransmitProfiles(const std::string& profiles_json) { if (isHost()) - LM_SAFE_CALL(LoadTransmitProfiles, profiles_json); + LM_SAFE_CALL(GetLogController()->LoadTransmitProfiles, profiles_json); return STATUS_EPERM; // Permission denied } @@ -323,7 +323,7 @@ namespace ARIASDK_NS_BEGIN static status_t ResetTransmitProfiles() { if (isHost()) - LM_SAFE_CALL(ResetTransmitProfiles); + LM_SAFE_CALL(GetLogController()->ResetTransmitProfiles); return STATUS_EPERM; // Permission denied }
feat: can specify subreddits for searching; ex: Type in a Discord Channel reddit.search#c_programming+cs_50 Segmentation Fault ; to search Segmentation Fault keyword at c_programming and cs_50 subreddits
+#define _GNU_SOURCE /* asprintf() */ #include <stdio.h> #include <stdlib.h> +#include <string.h> /* strchr() */ +#include <ctype.h> /* isalpha() */ #include <assert.h> #include "reddit.h" @@ -36,15 +39,46 @@ void on_search( const struct discord_user *bot, const struct discord_message *msg) { + char *subreddits = NULL; + char *msg_content = msg->content; + if ('#' == *msg_content) { + ++msg_content; // eat up '#' + + const char *end_srs = strchr(msg_content, ' '); + if (!end_srs) { + struct discord_create_message_params params = { .content = "Invalid syntax: Missing keywords" }; + discord_create_message(BOT.discord.client, msg->channel_id, &params, NULL); + return; + } + const size_t size = end_srs - msg_content; + for (size_t i=0; i < size; ++i) { + if (!(isalnum(msg_content[i]) || '_' == msg_content[i]) && msg_content[i] != '+') { + ERR("%s", msg_content+i); + struct discord_create_message_params params = { + .content = "Invalid syntax: Subreddits must be separated with a '+'" + }; + discord_create_message(BOT.discord.client, msg->channel_id, &params, NULL); + return; + } + } + asprintf(&subreddits, "%.*s", (int)size, msg_content); + msg_content += size+1; + } + struct sized_buffer json={0}; - { - struct reddit_search_params params = { .q = msg->content }; + { // anonymous block + struct reddit_search_params params = { .q = msg_content }; + if (subreddits) { + params.restrict_sr = true; + reddit_search(BOT.reddit.client, &params, subreddits, &json); + } + else { reddit_search(BOT.reddit.client, &params, "all", &json); } + } json_item_t *root = json_parse(json.start, json.size); - - json_item_t *children=0; + json_item_t *children = NULL; for (json_item_t *ji = root; ji != NULL; ji = json_iter_next(ji)) { if (0 == json_keycmp(ji, "children")) { children = ji; @@ -88,10 +122,10 @@ void on_search( } json_cleanup(root); + if (subreddits) free(subreddits); } -void on_ready(struct discord *client, const struct discord_user *bot) -{ +void on_ready(struct discord *client, const struct discord_user *bot) { fprintf(stderr, "\n\nReddit-Search-Bot succesfully connected to Discord as %s#%s!\n\n", bot->username, bot->discriminator); }
Add schwaaa's plugins to the readme
@@ -103,3 +103,4 @@ and use to get a basic plugin experience: - [MIP2](https://github.com/skei/MIP2), host and plugins - [clap-sys](https://github.com/glowcoil/clap-sys), rust binding +- [schwaaa's plugins](https://github.com/schwaaa/clap-plugin), basic framework for prototyping CLAP audio plugins using Dear ImGui as the user interface \ No newline at end of file
Shrink facil CPU core limit to 7 cores (8 processes) Testing provided generously by Michael from TechEmpower show that after 6 workers or so, performance starts to degrade rather than improve (perhaps a system wide memory allocation lock contention?).
@@ -15,19 +15,25 @@ Feel free to copy, use and enjoy according to the license provided. #ifndef FACIL_PRINT_STATE /** -When FACIL_PRINT_STATE is set to 1, facil.io will print out common messages -regarding the server state (start / finish / listen messages). + * When FACIL_PRINT_STATE is set to 1, facil.io will print out common messages + * regarding the server state (start / finish / listen messages). */ #define FACIL_PRINT_STATE 1 #endif #ifndef FACIL_CPU_CORES_LIMIT /** -If facil.io detects more CPU cores than the number of cores stated in the -FACIL_CPU_CORES_LIMIT, it will assume an error and cap the number of cores -detected to the assigned limit. + * If facil.io detects more CPU cores than the number of cores stated in the + * FACIL_CPU_CORES_LIMIT, it will assume an error and cap the number of cores + * detected to the assigned limit. + * + * The default autot-detection cap is at 7 cores, for the simple reason that + * system wide memory allocation locks start to exhibit negative effects + * somewhere around this point. + * + * The does NOT effect manually set worker values. */ -#define FACIL_CPU_CORES_LIMIT 120 +#define FACIL_CPU_CORES_LIMIT 7 #endif /* ***************************************************************************** Required facil libraries
[httpclient] implement --initial-udp-payload-size
@@ -469,11 +469,14 @@ static void usage(const char *progname) " -x <host:port>\n" " specifies the destination of the CONNECT request; implies\n" " `-m CONNECT`\n" + " --initial-udp-payload-size <bytes>\n" + " specifies the udp payload size of the initial message (default: %" PRIu16 ")\n" " --max-udp-payload-size <bytes>\n" - " specifies the max_udp_payload_size transport parameter to send\n" - " -h prints this help\n" + " specifies the max_udp_payload_size transport parameter to send (default: %" PRIu64 ")\n" + " -h, --help prints this help\n" "\n", - progname); + progname, quicly_spec_context.initial_egress_max_udp_payload_size, + quicly_spec_context.transport_params.max_udp_payload_size); } static void on_sigfatal(int signo) @@ -555,8 +558,12 @@ int main(int argc, char **argv) } #endif + int is_opt_initial_udp_payload_size = 0; int is_opt_max_udp_payload_size = 0; - struct option longopts[] = {{"max-udp-payload-size", required_argument, &is_opt_max_udp_payload_size, 1}, {NULL}}; + struct option longopts[] = {{"initial-udp-payload-size", required_argument, &is_opt_initial_udp_payload_size, 1}, + {"max-udp-payload-size", required_argument, &is_opt_max_udp_payload_size, 1}, + {"help", no_argument, NULL, 'h'}, + {NULL}}; const char *optstring = "t:m:o:b:x:C:c:d:H:i:k2:W:h3:" #ifdef __GNUC__ ":" /* for backward compatibility, optarg of -3 is optional when using glibc */ @@ -676,9 +683,18 @@ int main(int argc, char **argv) exit(0); break; case 0: - if (is_opt_max_udp_payload_size == 1) { - h3ctx.quic.initial_egress_max_udp_payload_size = (uint16_t)strtoul(optarg, NULL, 10); - h3ctx.quic.transport_params.max_udp_payload_size = (uint64_t)strtoull(optarg, NULL, 10); + if (is_opt_initial_udp_payload_size == 1) { + if (sscanf(optarg, "%" SCNu16, &h3ctx.quic.initial_egress_max_udp_payload_size) != 1) { + fprintf(stderr, "failed to parse --initial-udp-payload-size\n"); + exit(EXIT_FAILURE); + } + is_opt_initial_udp_payload_size = 0; + } else if (is_opt_max_udp_payload_size == 1) { + if (sscanf(optarg, "%" SCNu64, &h3ctx.quic.transport_params.max_udp_payload_size) != 1) { + fprintf(stderr, "failed to parse --max-udp-payload-size\n"); + exit(EXIT_FAILURE); + } + is_opt_max_udp_payload_size = 0; } break; default:
HSL Sponge: Fix polling results
@@ -413,10 +413,6 @@ static int dnut_poll_results(struct dnut_card *card) uint32_t action_addr; uint32_t job_data[112/sizeof(uint32_t)]; - if (!poll_trace_enabled()) - return 1; - - poll_trace("POLLING Result Registers\n"); for (i = 0, action_addr = ACTION_JOB_OUT; i < ARRAY_SIZE(job_data); i++, action_addr += sizeof(uint32_t)) { @@ -511,8 +507,13 @@ int dnut_kernel_sync_execute_job(struct dnut_kernel *kernel, /* Every second do ... */ if (poll_trace_enabled()) { + unsigned long t_diff; + t_now = tget_ms(); - if ((t_now - t_start) % 1000 == 0) + t_diff = t_now - t_start; + + poll_trace("POLLING Result Registers %zd msec\n", t_diff); + if ((t_diff % 1000) == 0) dnut_poll_results(card); }
util/stm32mon: Fix resource leak Found-by: Coverity Scan Commit-Ready: Patrick Georgi Tested-by: Patrick Georgi
@@ -871,6 +871,7 @@ int write_flash(int fd, struct stm32_def *chip, const char *filename, if (res <= 0) { fprintf(stderr, "Cannot read %s\n", filename); free(buffer); + fclose(hnd); return -EIO; } fclose(hnd);
doc: add link to Elektra's package in Alpine Linux
@@ -13,6 +13,7 @@ For the following Linux distributions and package managers 0.8 packages are avai - [Gentoo](http://packages.gentoo.org/package/app-admin/elektra) - [Linux Mint](https://community.linuxmint.com/software/view/elektra-bin) - [LinuxBrew](https://github.com/Linuxbrew/homebrew-core/blob/master/Formula/elektra.rb) + - [Alpine Linux](https://pkgs.alpinelinux.org/package/edge/testing/x86_64/elektra) Available, but not up-to-date:
clap_output_events now has try_push() instead
@@ -227,10 +227,11 @@ typedef struct clap_event_midi2 { typedef struct clap_input_events { void *ctx; // reserved pointer for the list - uint32_t (*size)(const struct clap_input_events *list); + CLAP_NODISCARD uint32_t (*size)(const struct clap_input_events *list); // Don't free the return event, it belongs to the list - const clap_event_header_t *(*get)(const struct clap_input_events *list, uint32_t index); + CLAP_NODISCARD const clap_event_header_t *(*get)(const struct clap_input_events *list, + uint32_t index); } clap_input_events_t; // Output event list, events must be sorted by time. @@ -238,7 +239,9 @@ typedef struct clap_output_events { void *ctx; // reserved pointer for the list // Pushes a copy of the event - void (*push_back)(const struct clap_output_events *list, const clap_event_header_t *event); + // returns false if the event could not be pushed to the queue (out of memory?) + CLAP_NODISCARD bool (*try_push)(const struct clap_output_events *list, + const clap_event_header_t *event); } clap_output_events_t; #ifdef __cplusplus
Fix counting logical processors
@@ -1078,7 +1078,7 @@ VOID PhSipUpdateCpuPanel( { case RelationProcessorCore: processorCoreCount++; - processorLogicalCount += PhCountBits((ULONG)processorInfo->ProcessorMask); // RtlNumberOfSetBitsUlongPtr + processorLogicalCount += PhCountBitsUlongPtr(processorInfo->ProcessorMask); // RtlNumberOfSetBitsUlongPtr break; case RelationNumaNode: processorNumaCount++;
build: removing obsolete m4 macro AC_CONFIG_HEADER
@@ -41,7 +41,7 @@ AH_TEMPLATE([LIQUID_FFTOVERRIDE], [Force internal FFT even if libfftw is availa AH_TEMPLATE([LIQUID_SIMDOVERRIDE], [Force overriding of SIMD (use portable C code)]) AH_TEMPLATE([LIQUID_STRICT_EXIT], [Enable strict program exit on error]) -AC_CONFIG_HEADER(config.h) +AC_CONFIG_HEADERS([config.h]) AH_TOP([ #ifndef __LIQUID_CONFIG_H__ #define __LIQUID_CONFIG_H__
Improve Output Format of Merged WAN Perf Data
@@ -122,6 +122,7 @@ $PSDefaultParameterValues['*:ErrorAction'] = 'Stop' class FormattedResult { [double]$Usage; + [double]$DiffPrev; [int]$NetMbps; [int]$RttMs; [int]$QueuePkts; @@ -145,8 +146,7 @@ class FormattedResult { [int]$DurationMs, [bool]$Pacing, [int]$RateKbps, - [int]$RemoteKbps, - [double]$BottleneckPercentage + [int]$RemoteKbps ) { $this.Tcp = $Tcp; $this.RttMs = $RttMs; @@ -159,7 +159,9 @@ class FormattedResult { #$this.Pacing = $Pacing; $this.RateKbps = $RateKbps; $this.PrevKbps = $RemoteKbps; - $this.Usage = $BottleneckPercentage; + + $this.Usage = ($RateKbps / $BottleneckMbps) / 10; + $this.DiffPrev = (($RateKbps - $RemoteKbps) / $BottleneckMbps) / 10; } } @@ -380,8 +382,7 @@ if ($MergeDataFiles) { } } - $BottleneckPercentage = ($_.RateKbps / $_.BottleneckMbps) / 10 - $Run = [FormattedResult]::new($_.RttMs, $_.BottleneckMbps, $_.BottleneckBufferPackets, $_.RandomLossDenominator, $_.RandomReorderDenominator, $_.ReorderDelayDeltaMs, $_.Tcp, $_.DurationMs, $_.Pacing, $_.RateKbps, $RemoteRate, $BottleneckPercentage); + $Run = [FormattedResult]::new($_.RttMs, $_.BottleneckMbps, $_.BottleneckBufferPackets, $_.RandomLossDenominator, $_.RandomReorderDenominator, $_.ReorderDelayDeltaMs, $_.Tcp, $_.DurationMs, $_.Pacing, $_.RateKbps, $RemoteRate); $FormatResults.Add($Run) } } @@ -419,10 +420,18 @@ if ($MergeDataFiles) { git checkout $BranchName } - # First sort by usage to show bad cases. - $FormatResults | Sort-Object -Property Usage | Format-Table -AutoSize - # Then sort by rate for easy comparison to previous. - $FormatResults | Sort-Object -Property NetMbps | Format-Table -AutoSize + # Show the worst absolute tests. + Write-Host "`nWorst tests, relative to bottleneck rate (Usage):" + $FormatResults | Sort-Object -Property Usage | Select-Object -First 50 | Format-Table -AutoSize + + # Show the worst tests, relative to the previous run. + Write-Host "Worst tests, relative to the previous run (DiffPrev):" + $FormatResults | Sort-Object -Property DiffPrev | Select-Object -First 50 | Format-Table -AutoSize + + # Dump all data. + Write-Host "All tests:" + $FormatResults | Sort-Object -Property NetMbps,RttMs,QueuePkts,Loss,Reorder,DelayMs | Format-Table -AutoSize + return }
Legacy: Fix double ready-to-boot signaling
@@ -197,11 +197,6 @@ BdsBootDeviceSelect ( EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_HANDLE ImageHandle; - // - // Signal the EVT_SIGNAL_READY_TO_BOOT event - // - EfiSignalEventReadyToBoot (); - // // If there is simple file protocol which does not consume block Io protocol, create a boot option for it here. // @@ -463,6 +458,11 @@ BdsEntry ( // PlatformBdsPolicyBehavior (); + // + // Signal the EVT_SIGNAL_READY_TO_BOOT event + // + EfiSignalEventReadyToBoot (); + // // BDS select the boot device to load OS //
readme: update the example quic trace
@@ -39,9 +39,9 @@ $ sudo h2olog quic -p $(pgrep -o h2o) Here's an example trace. ``` -{"type": "accept", "at": 1580154303455, "master_conn_id": 1, "dcid": "4070a82916f79d71"} -{"type": "packet_prepare", "at": 1580154303457, "master_conn_id": 1, "first_octet": 192, "dcid": "9e4605bc54ec8b9d"} -{"type": "packet_commit", "at": 1580154303457, "master_conn_id": 1, "packet_num": 0, "packet_len": 176, "ack_only": 0} +{"at": 1580154303455, "type": "accept", "master_conn_id": 1, "dcid": "4070a82916f79d71"} +{"at": 1580154303457, "type": "packet_prepare", "master_conn_id": 1, "first_octet": 192, "dcid": "9e4605bc54ec8b9d"} +{"at": 1580154303457, "type": "packet_commit", "master_conn_id": 1, "packet_num": 0, "packet_len": 176, "ack_only": 0} ... and more ... ```
fix for doxygen error on oc_stop_multicast
@@ -1983,9 +1983,6 @@ bool oc_do_site_local_ipv6_multicast(const char *uri, const char *query, * stop the multicast update (e.g. do not handle the responses) * * @param[in] response the response that should not be handled. - * - * @return True if the client successfully dispatched the multicast discovery - * request */ void oc_stop_multicast(oc_client_response_t *response);
in_tcp: on invalid JSON message, reset buffer length
@@ -92,7 +92,7 @@ int tcp_conn_event(void *data) size = conn->buf_size + ctx->chunk_size; tmp = flb_realloc(conn->buf_data, size); if (!tmp) { - perror("realloc"); + flb_errno(); return -1; } flb_trace("[in_tcp] fd=%i buffer realloc %i -> %i", @@ -136,11 +136,11 @@ int tcp_conn_event(void *data) return 0; } else if (ret == FLB_ERR_JSON_INVAL) { - flb_debug("[in_tcp] invalid JSON message, skipping"); + flb_warn("[in_tcp] invalid JSON message, skipping"); flb_pack_state_reset(&conn->pack_state); flb_pack_state_init(&conn->pack_state); + conn->buf_len = 0; conn->pack_state.multiple = FLB_TRUE; - return -1; } @@ -179,6 +179,7 @@ struct tcp_conn *tcp_conn_add(int fd, struct flb_in_tcp_config *ctx) conn = flb_malloc(sizeof(struct tcp_conn)); if (!conn) { + flb_errno(); return NULL; } @@ -198,7 +199,7 @@ struct tcp_conn *tcp_conn_add(int fd, struct flb_in_tcp_config *ctx) conn->buf_data = flb_malloc(ctx->chunk_size); if (!conn->buf_data) { - perror("malloc"); + flb_errno(); close(fd); flb_error("[in_tcp] could not allocate new connection"); flb_free(conn);
[scripts] cert-staple.sh enhancements support validation from list of multiple signers attempt to handle older (end-of-life) versions of OpenSSL (thx avij)
@@ -21,9 +21,17 @@ function errexit { OCSP_URI=$(openssl x509 -in "$CERT_PEM" -ocsp_uri -noout) [[ $? = 0 ]] && [[ -n "$OCSP_URI" ]] || exit 1 +# exception for (unsupported, end-of-life) older versions of OpenSSL +OCSP_HOST= +OPENSSL_VERSION=$(openssl version) +if [[ "${OPENSSL_VERSION}" != "${OPENSSL_VERSION#OpenSSL 1.0.}" ]]; then + # get authority from URI + OCSP_HOST=$(echo "$OCSP_URI" | cut -d/ -f3) +fi + # get OCSP response from OCSP responder OCSP_TMP="$OCSP_DER.$$" -OCSP_RESP=$(openssl ocsp -issuer "$CHAIN_PEM" -cert "$CERT_PEM" -respout "$OCSP_TMP" -noverify -no_nonce -url "$OCSP_URI") +OCSP_RESP=$(openssl ocsp -issuer "$CHAIN_PEM" -cert "$CERT_PEM" -respout "$OCSP_TMP" -noverify -no_nonce -url "$OCSP_URI" ${OCSP_HOST:+-header Host "$OCSP_HOST"}) [[ $? = 0 ]] || errexit # parse OCSP response from OCSP responder @@ -41,7 +49,7 @@ next_date="$(printf %s "$next_update" | sed 's/.*Next Update: //')" ocsp_expire=$(date -d "$next_date" +%s) # validate OCSP response -ocsp_verify=$(openssl ocsp -issuer "$CHAIN_PEM" -cert "$CERT_PEM" -respin "$OCSP_TMP" -no_nonce -out /dev/null 2>&1) +ocsp_verify=$(openssl ocsp -issuer "$CHAIN_PEM" -verify_other "$CHAIN_PEM" -cert "$CERT_PEM" -respin "$OCSP_TMP" -no_nonce -out /dev/null 2>&1) [[ "$ocsp_verify" = "Response verify OK" ]] || errexit # rename and update symlink to install OCSP response to be used in OCSP stapling
[mod_webdav] surround Lock-Token with "<...>" (thx yangfl) github: x-ref:
@@ -5040,20 +5040,21 @@ mod_webdav_lock (connection * const con, const plugin_config * const pconf) /* create locktoken * (uuid_unparse() output is 36 chars + '\0') */ uuid_t id; - char lockstr[sizeof("urn:uuid:") + 36] = "urn:uuid:"; - lockdata.locktoken.ptr = lockstr; - lockdata.locktoken.used = sizeof(lockstr); + char lockstr[sizeof("<urn:uuid:>") + 36] = "<urn:uuid:"; + lockdata.locktoken.ptr = lockstr+1; /*(without surrounding <>)*/ + lockdata.locktoken.used = sizeof(lockstr)-2;/*(without surrounding <>)*/ uuid_generate(id); - uuid_unparse(id, lockstr+sizeof("urn:uuid:")-1); + uuid_unparse(id, lockstr+sizeof("<urn:uuid:")-1); /* XXX: consider fix TOC-TOU race condition by starting transaction * and re-running webdav_lock_activelocks() check before running * webdav_lock_acquire() (but both routines would need to be modified * to defer calling sqlite3_reset(stmt) to be part of transaction) */ if (webdav_lock_acquire(pconf, &lockdata)) { + lockstr[sizeof(lockstr)-2] = '>'; http_header_response_set(con, HTTP_HEADER_OTHER, CONST_STR_LEN("Lock-Token"), - CONST_BUF_LEN(&lockdata.locktoken)); + lockstr, sizeof(lockstr)-1); webdav_xml_doc_lock_acquired(con, pconf, &lockdata); http_status_set_fin(con, created ? 201 : 200); /* Created | OK */ }
Install all the internal header files, including the pallene_core.h
@@ -40,7 +40,11 @@ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix # What to install. TO_BIN= lua luac -TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp +TO_INC= lua.hpp \ + lapi.h lauxlib.h lcode.h lctype.h ldebug.h ldo.h lfunc.h lgc.h ljumptab.h \ + llex.h llimits.h lmem.h lobject.h lopcodes.h lopnames.h lparser.h lprefix.h \ + lstate.h lstring.h ltable.h ltm.h luaconf.h lua.h lualib.h lundump.h lvm.h \ + lzio.h pallene_core.h TO_LIB= liblua.a TO_MAN= lua.1 luac.1
Fixed typo for http admin tests
@@ -44,14 +44,14 @@ struct activator { }; //Local function prototypes -int alias_test_post(void *handle, struct mg_connection *connection, const char *path, const char *data, size_t length); +int alias_test_put(void *handle, struct mg_connection *connection, const char *path, const char *data, size_t length); int websocket_data_echo(struct mg_connection *connection, int op_code, char *data, size_t length, void *handle); celix_status_t bnd_start(struct activator *act, celix_bundle_context_t *ctx) { celix_properties_t *props = celix_properties_create(); celix_properties_set(props, HTTP_ADMIN_URI, "/alias"); act->httpSvc.handle = act; - act->httpSvc.doPut = alias_test_post; + act->httpSvc.doPut = alias_test_put; act->httpSvcId = celix_bundleContext_registerService(ctx, &act->httpSvc, HTTP_ADMIN_SERVICE_NAME, props); celix_properties_t *props2 = celix_properties_create(); @@ -84,7 +84,7 @@ celix_status_t bnd_stop(struct activator *act, celix_bundle_context_t *ctx) { CELIX_GEN_BUNDLE_ACTIVATOR(struct activator, bnd_start, bnd_stop); -int alias_test_post(void *handle __attribute__((unused)), struct mg_connection *connection, const char *path __attribute__((unused)), const char *data, size_t length) { +int alias_test_put(void *handle __attribute__((unused)), struct mg_connection *connection, const char *path __attribute__((unused)), const char *data, size_t length) { //If data received, echo the data for the test case if(length > 0 && data != NULL) { const char *mime_type = mg_get_header(connection, "Content-Type");
doc: fix duplicate line due to rebase
@@ -292,8 +292,6 @@ you up to date with the multi-language support provided by Elektra. - Finalize 1.0 decisions. _(Markus Raab)_ - Update [API design document](/doc/DESIGN.md) _(Markus Raab and Stefan Hanreich)_ -- <<TODO>> -- Changed api documentation terms [current, latest] to [latest, master]. The api documentation of the latest release is now available at https://doc.libelektra.org/api/latest/html/ and of the current git master at https://doc.libelektra.org/api/master/html/. _(Robert Sowula)_ - Changed api documentation terms [current, latest] to [latest, master]. The api documentation of the latest release is now available at https://doc.libelektra.org/api/latest/html/ and of the current git master at https://doc.libelektra.org/api/master/html/. _(Robert Sowula)_ - <<TODO>>
Matrix22 template constructor and make identity no longer use memset.
@@ -1181,8 +1181,9 @@ template <class T> inline Matrix22<T>::Matrix22 () { - memset (x, 0, sizeof (x)); x[0][0] = 1; + x[0][1] = 0; + x[1][0] = 0; x[1][1] = 1; } @@ -1326,8 +1327,9 @@ template <class T> inline void Matrix22<T>::makeIdentity() { - memset (x, 0, sizeof (x)); x[0][0] = 1; + x[0][1] = 0; + x[1][0] = 0; x[1][1] = 1; }
Add QUIC protocol extensions section
@@ -203,6 +203,14 @@ if their corresponding crypto helper library is built: - bsslclient: BoringSSL client - bsslserver: BoringSSL server +QUIC protocol extensions +------------------------- + +The library implements the following QUIC protocol extensions: + +- `An Unreliable Datagram Extension to QUIC + <https://quicwg.org/datagram/draft-ietf-quic-datagram.html>`_ + Configuring Wireshark for QUIC ------------------------------
PIC32-FPU: fix compile for non-fpu hardware
@@ -132,14 +132,11 @@ os_bytes_to_stack_aligned_words(int byts) { os_stack_t * os_arch_task_stack_init(struct os_task *t, os_stack_t *stack_top, int size) { - int lazy_space = 0; + int ctx_space = os_bytes_to_stack_aligned_words(sizeof(struct ctx)); #if MYNEWT_VAL(HARDFLOAT) - lazy_space += os_bytes_to_stack_aligned_words(sizeof(struct ctx_fp)); -#endif - /* If stack does not have space for the FPU context, assume the thread won't use it. */ - int ctx_space = os_bytes_to_stack_aligned_words(sizeof(struct ctx)); + int lazy_space = os_bytes_to_stack_aligned_words(sizeof(struct ctx_fp)); if ((lazy_space + ctx_space + 4) >= size) { /* stack too small */ stack_top -= 4; @@ -149,6 +146,10 @@ os_arch_task_stack_init(struct os_task *t, os_stack_t *stack_top, int size) memcpy(stack_top - os_bytes_to_stack_aligned_words(sizeof(struct ctx_fp)), &ctx_fp, sizeof(ctx_fp)); stack_top -= lazy_space + 4; } +#else + stack_top -= 4; +#endif + os_stack_t *s = stack_top - ctx_space; struct ctx ctx; @@ -160,7 +161,7 @@ os_arch_task_stack_init(struct os_task *t, os_stack_t *stack_top, int size) /* copy struct onto the stack */ memcpy(s, &ctx, sizeof(ctx)); - return (uint32_t)stack_top; + return stack_top; } void
doc: add section describing build server configuration
@@ -163,3 +163,43 @@ If you have issues that are related to the build system you can open a normal issue and tag it with `build` and `question`. If you feel like your inquiry does not warrent a issue on its own, please use [our buildserver issue](https://issues.libelektra.org/160). + +## Jenkins + +### Jenkins libelektra configuration +The `libelektra` build job is a multibranch pipeline job. +It is easiest to add via the BlueOcean interface. + +The newly added job can afterwards configured. +All options have a helptext next to them explaining what the settings do. + +Most of the default settings should be ok, however some settings need to be +verified or added: +* In Branch Sources under Behaviours `Filter by name` should be + added to exclude the `debian` branch from beeing build. +* `Advanced clone behaviours` should be added and the path to the git mirror + needs to be specified: `/home/jenkins/git_mirrors/libelektra` +* Under Property strategy you can add `Trigger build on pull request comment`. + `jenkins build (libelektra|all) please` is a good starting point. +* For Build Configuration you want to specify `by Jenkinsfile` and add the + script path: `scripts/jenkins/Jenkinsfile`. + +You can also specify `Orphaning Strategies` but they are not essential to the +functinality of the build job. + +### Add a Jenkins node +A node needs to have a JRE (Java Runtime Environment) installed. +Further it should run an SSH (Secure SHell) server. +For Docker nodes Docker has to be installed as well. + +A `jenkins` user with 47000:47000 ids should be created as this is what is +expected in Docker images. + +Either set a password or better generate a key to add to the Jenkins master for +authentification. + +Nodes should be set to only build jobs matching their labels and to be online +as much as possible. +As for labels `gitmirror` should be if you want to cache repositories on this +node. +If Docker is available the `docker` label should be set.
peview: Fix 32bit build warning from previous commit
@@ -265,14 +265,14 @@ VOID PvDestroyExportNode( #define END_SORT_FUNCTION \ if (sortResult == 0) \ - sortResult = uintptrcmp(node1->UniqueId, node2->UniqueId); \ + sortResult = uintptrcmp((ULONG_PTR)node1->UniqueId, (ULONG_PTR)node2->UniqueId); \ \ return PhModifySort(sortResult, ((PPV_EXPORT_CONTEXT)_context)->TreeNewSortOrder); \ } BEGIN_SORT_FUNCTION(Index) { - sortResult = uintptrcmp(node1->UniqueId, node2->UniqueId); + sortResult = uintptrcmp((ULONG_PTR)node1->UniqueId, (ULONG_PTR)node2->UniqueId); } END_SORT_FUNCTION
a little more in usage()
@@ -70,9 +70,9 @@ static void usage(const char *prog) " -n, --num <int> How many elements in the table for random generated array.\n" " -l, --len <int> length of the random string.\n" " -s, --software Use software approach.\n" - " -m, --method <0/1> 0: compare one by one (Only in SW).\n" - " 1: Use hash table\n" - " 2: Sort and do intersection\n" + " -m, --method <0/1/2> 0: compare one by one (Slow, and only in SW).\n" + " 1: Use Hash table\n" + " 2: Use Sort and merge\n" " -I, --irq Enable Interrupts\n" "\n" "Example:\n"
Use py2/py3 compatible version of Iterable
@@ -3,7 +3,10 @@ from .core import check from .background import comoving_radial_distance, growth_rate, growth_factor from .pyutils import _check_array_params, NoneArr import numpy as np -import collections +try: + from collections.abc import Iterable +except ImportError: # for py2.7 + from collections import Iterable def get_density_kernel(cosmo, dndz): @@ -23,10 +26,10 @@ def get_density_kernel(cosmo, dndz): The units are arbitrary; N(z) will be normalized to unity. """ - if ((not isinstance(dndz, collections.Iterable)) + if ((not isinstance(dndz, Iterable)) or (len(dndz) != 2) - or (not (isinstance(dndz[0], collections.Iterable) - and isinstance(dndz[1], collections.Iterable)))): + or (not (isinstance(dndz[0], Iterable) + and isinstance(dndz[1], Iterable)))): raise ValueError("dndz needs to be a tuple of two arrays.") z_n, n = _check_array_params(dndz) # this call inits the distance splines neded by the kernel functions @@ -59,10 +62,10 @@ def get_lensing_kernel(cosmo, dndz, mag_bias=None): giving the magnification bias as a function of redshift. If `None`, s=0 will be assumed """ - if ((not isinstance(dndz, collections.Iterable)) + if ((not isinstance(dndz, Iterable)) or (len(dndz) != 2) - or (not (isinstance(dndz[0], collections.Iterable) - and isinstance(dndz[1], collections.Iterable)))): + or (not (isinstance(dndz[0], Iterable) + and isinstance(dndz[1], Iterable)))): raise ValueError("dndz needs to be a tuple of two arrays.") # we need the distance functions at the C layer