message
stringlengths
6
474
diff
stringlengths
8
5.22k
Security attribute clearified
@@ -106,7 +106,8 @@ Security Type ============= The attribute \em security defines the security setting for a memory or peripheral region. Only one of the settings is allow: - - \<empty\> non-secure: no security restrictions (default) + - \<empty\> security not defined (default) + - 'n' non-secure - 'c' secure on non-secure callable - 's' secure
Fix to u_select.py: it was only looking for changed files in the api directory, needs to also look in src and test.
@@ -152,7 +152,7 @@ def instance_api(database, paths, extensions, instances): del instances_local[:] parts = path.split("/") for idx, part in enumerate(parts): - if (part == "api") and (idx > 0): + if (part in ("api", "src", "test")) and (idx > 0): api = parts[idx - 1] instances_local.extend(u_data.get_instances_for_api(database, api)[:]) if instances_local:
cmd/kubectl-gadget/profile: Use BaseParser.Transform on cpu gadget
@@ -161,20 +161,7 @@ func (p *CPUParser) DisplayResultsCallback(traceOutputMode string, results []str } for _, report := range reports { - switch p.OutputConfig.OutputMode { - case commonutils.OutputModeJSON: - b, err := json.Marshal(report) - if err != nil { - return commonutils.WrapInErrMarshalOutput(err) - } - fmt.Println(string(b)) - case commonutils.OutputModeColumns: - fallthrough - case commonutils.OutputModeCustomColumns: - fmt.Println(p.TransformEvent(&report)) - default: - return commonutils.WrapInErrOutputModeNotSupported(p.OutputConfig.OutputMode) - } + fmt.Println(p.TransformReport(&report)) } } @@ -196,7 +183,8 @@ func getReverseStringSlice(toReverse []string) string { return fmt.Sprintf("\n\t%s", strings.Join(toReverse, "\n\t")) } -func (p *CPUParser) TransformEvent(report *types.Report) string { +func (p *CPUParser) TransformReport(report *types.Report) string { + return p.Transform(report, func(e *types.Report) string { var sb strings.Builder for _, col := range p.OutputConfig.CustomColumns { @@ -230,4 +218,5 @@ func (p *CPUParser) TransformEvent(report *types.Report) string { } return sb.String() + }) }
apps/passwd.c: free before error exiting use goto instead of returning directly while error handling
@@ -410,7 +410,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) n >>= 1; } if (!EVP_DigestFinal_ex(md, buf, NULL)) - return NULL; + goto err; for (i = 0; i < 1000; i++) { if (!EVP_DigestInit_ex(md2, EVP_md5(), NULL)) @@ -636,7 +636,7 @@ static char *shacrypt(const char *passwd, const char *magic, const char *salt) n >>= 1; } if (!EVP_DigestFinal_ex(md, buf, NULL)) - return NULL; + goto err; /* P sequence */ if (!EVP_DigestInit_ex(md2, sha, NULL)) @@ -647,7 +647,7 @@ static char *shacrypt(const char *passwd, const char *magic, const char *salt) goto err; if (!EVP_DigestFinal_ex(md2, temp_buf, NULL)) - return NULL; + goto err; if ((p_bytes = OPENSSL_zalloc(passwd_len)) == NULL) goto err; @@ -664,7 +664,7 @@ static char *shacrypt(const char *passwd, const char *magic, const char *salt) goto err; if (!EVP_DigestFinal_ex(md2, temp_buf, NULL)) - return NULL; + goto err; if ((s_bytes = OPENSSL_zalloc(salt_len)) == NULL) goto err;
boot: Add some missing unused arguments In MCUBOOT_RAM_LOAD mode, bootutil_img_hash has some arguments that end up being unused, which creates warnings. Add these to the list of variables intentionally unused.
@@ -85,6 +85,9 @@ bootutil_img_hash(struct enc_key_data *enc_state, int image_index, (void)blk_sz; (void)off; (void)rc; + (void)fap; + (void)tmp_buf; + (void)tmp_buf_sz; #endif #endif
add boomrocketexample to ci
@@ -161,6 +161,40 @@ jobs: paths: - "/home/riscvuser/project" + prepare-boomrocketexample: + docker: + - image: riscvboom/riscvboom-images:0.0.5 + environment: + JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit + TERM: dumb + + steps: + # Checkout the code + - checkout + + - run: + name: Create hash of toolchains + command: | + .circleci/create-hash.sh + + - restore_cache: + keys: + - riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }} + + - restore_cache: + keys: + - verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }} + + - run: + name: Building the boomrocketexample subproject using Verilator + command: .circleci/do-rtl-build.sh SUB_PROJECT=boomrocketexample CONFIG=SmallDefaultBoomAndRocketConfig + no_output_timeout: 120m + + - save_cache: + key: boomrocketexample-{{ .Branch }}-{{ .Revision }} + paths: + - "/home/riscvuser/project" + prepare-boom: docker: - image: riscvboom/riscvboom-images:0.0.5 @@ -319,6 +353,34 @@ jobs: name: Run boomexample benchmark tests command: make run-bmark-tests -C sims/verisim SUB_PROJECT=boomexample CONFIG=SmallDefaultBoomConfig + boomrocketexample-run-benchmark-tests: + docker: + - image: riscvboom/riscvboom-images:0.0.5 + environment: + JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit + TERM: dumb + + steps: + # Checkout the code + - checkout + + - run: + name: Create hash of toolchains + command: | + .circleci/create-hash.sh + + - restore_cache: + keys: + - riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }} + + - restore_cache: + keys: + - boomrocketexample-{{ .Branch }}-{{ .Revision }} + + - run: + name: Run boomrocketexample benchmark tests + command: make run-bmark-tests -C sims/verisim SUB_PROJECT=boomexample CONFIG=SmallDefaultBoomAndRocketConfig + boom-run-benchmark-tests: docker: - image: riscvboom/riscvboom-images:0.0.5 @@ -427,6 +489,11 @@ workflows: - install-riscv-toolchain - install-verilator + - prepare-boomrocketexample: + requires: + - install-riscv-toolchain + - install-verilator + - prepare-boom: requires: - install-riscv-toolchain @@ -456,6 +523,11 @@ workflows: - install-riscv-toolchain - prepare-boomexample + - boomrocketexample-run-benchmark-tests: + requires: + - install-riscv-toolchain + - prepare-boomrocketexample + - boom-run-benchmark-tests: requires: - install-riscv-toolchain
Fixed input buffering
@@ -9,6 +9,7 @@ using CodeContracts; using NetUV.Core.Handles; using NLog; using Newtonsoft.Json; +using NLog.LayoutRenderers; // http://www.jsonrpc.org/specification // https://github.com/Astn/JSON-RPC.NET @@ -39,15 +40,30 @@ namespace MiningCore.JsonRpc var incomingLines = Observable.Create<string>(observer => { + var sb = new StringBuilder(); + upstream.OnRead((handle, buffer) => { // onAccept - var data = buffer.ReadString(Encoding.UTF8, new[] {(byte) 10}).Trim(); + var data = buffer.ReadString(Encoding.UTF8); if (!string.IsNullOrEmpty(data)) { - if (data.Length < MaxRequestLength) - observer.OnNext(data); + sb.Append(data); + + if (sb.Length < MaxRequestLength) + { + var index = sb.ToString().IndexOf('\n'); + + if (index != -1) + { + var line = sb.ToString(0, index); + sb.Remove(0, index + 1); + + observer.OnNext(line); + } + } + else observer.OnError(new InvalidDataException($"[{upstream.UserToken}] Incoming message exceeds maximum length of {MaxRequestLength}")); }
Update doc/dev/hooks.md
Hooks are central points in the KDB lifecycle, where specialized plugins are called. -## Selecting which Plugin will be used for a specific hook +## Selecting which Plugin will be Used for a Specific Hook Currently, the names of the plugins are hard-coded. This decision was made, because these plugins are meant to fulfil very specific purposes.
Test UTF-16LE vs explicit UTF-16BE encoding
@@ -5742,7 +5742,39 @@ START_TEST(test_ext_entity_latin1_utf16be_bom2) } END_TEST +/* Test little-endian UTF-16 given an explicit big-endian encoding */ +START_TEST(test_ext_entity_utf16_be) +{ + const char *text = + "<!DOCTYPE doc [\n" + " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n" + "]>\n" + "<doc>&en;</doc>"; + ExtTest2 test_data = { + "<\0e\0/\0>\0", + 8, + "utf-16be", + NULL, + EE_PARSE_NONE + }; + const XML_Char *expected = + "\xe3\xb0\x80" /* U+3C00 */ + "\xe6\x94\x80" /* U+6A00 */ + "\xe2\xbc\x80" /* U+2F00 */ + "\xe3\xb8\x80"; /* U+3E00 */ + CharData storage; + CharData_Init(&storage); + test_data.storage = &storage; + XML_SetExternalEntityRefHandler(parser, external_entity_loader2); + XML_SetUserData(parser, &test_data); + XML_SetCharacterDataHandler(parser, ext2_accumulate_characters); + if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), + XML_TRUE) == XML_STATUS_ERROR) + xml_failure(parser); + CharData_CheckXMLChars(&storage, expected); +} +END_TEST /* * Namespaces tests. @@ -11043,6 +11075,7 @@ make_suite(void) tcase_add_test(tc_basic, test_ext_entity_latin1_utf16be_bom); tcase_add_test(tc_basic, test_ext_entity_latin1_utf16le_bom2); tcase_add_test(tc_basic, test_ext_entity_latin1_utf16be_bom2); + tcase_add_test(tc_basic, test_ext_entity_utf16_be); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace,
examples/openssl: add srp support to server.c
@@ -581,6 +581,21 @@ unsigned int psk_callback(SSL* ssl, const char* identity, unsigned char* psk, return max_psk_len; } +#if !defined(LIBRESSL_VERSION_NUMBER) && !defined(BORINGSSL_API_VERSION) +static int srp_callback(SSL* s, int* ad, void* arg) +{ + if (strcmp(SSL_get_srp_username(s), "USER") != 0) { + *ad = SSL_AD_INTERNAL_ERROR; + return SSL3_AL_FATAL; + } + if (SSL_set_srp_server_param_pw(s, "USER", "PASS", "GROUP") < 0) { + *ad = SSL_AD_INTERNAL_ERROR; + return SSL3_AL_FATAL; + } + return SSL_ERROR_NONE; +} +#endif /* !defined(LIBRESSL_VERSION_NUMBER) && !defined(BORINGSSL_API_VERSION) */ + int LLVMFuzzerInitialize(int* argc, char*** argv) { rand_predictable = 1; @@ -650,6 +665,13 @@ int LLVMFuzzerInitialize(int* argc, char*** argv) assert(ret == 1); #endif /* !defined(LIBRESSL_VERSION_NUMBER) */ +#if !defined(LIBRESSL_VERSION_NUMBER) && !defined(BORINGSSL_API_VERSION) + ret = SSL_CTX_set_srp_username_callback(ctx, srp_callback); + assert(ret == 1); + ret = SSL_CTX_set_srp_cb_arg(ctx, NULL); + assert(ret == 1); +#endif /* !defined(LIBRESSL_VERSION_NUMBER) && !defined(BORINGSSL_API_VERSION) */ + return 1; }
improve cuda flags detection
@@ -122,6 +122,15 @@ function _check_try_running(flags, opt, islinker) end end + -- add architecture flags if cross compiling + if not is_arch(os.arch()) then + if is_arch(".+64.*") then + table.insert(args, 1, "-m64") + else + table.insert(args, 1, "-m32") + end + end + -- check flags return _try_running(opt.program, table.join(flags, args), opt) end
Fix PANIC error in ALTER TABLE xxx EXPAND PARTITION PREPARE When we changing the `rd_cdbpolicy` for a relation, we should make sure the memory be allocated in context of relation's own context, and we should make the policy between on-disk catalog and on-memory relation cache consistently.
@@ -16383,21 +16383,25 @@ ATExecExpandPartitionTablePrepare(Relation rel) { int new_numsegments = getgpsegmentCount(); Oid relid = RelationGetRelid(rel); - GpPolicy *rel_dist = rel->rd_cdbpolicy; - if (GpPolicyIsRandomPartitioned(rel_dist) || rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) + if (GpPolicyIsRandomPartitioned(rel->rd_cdbpolicy) || rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) { + GpPolicy *new_policy; + MemoryContext oldcontext; + /* * we only change numsegments for root/interior/leaf partitions distributed randomly - * and root/interior partitions distributed by hash + * and root/interior partitions distributed by hash, and change the numsegments of policy to + * current cluster size */ + oldcontext = MemoryContextSwitchTo(GetMemoryChunkContext(rel)); + new_policy = GpPolicyCopy(rel->rd_cdbpolicy); + new_policy->numsegments = new_numsegments; + MemoryContextSwitchTo(oldcontext); - GpPolicy *root_dist = GpPolicyCopy(rel_dist); - /* change numsegments of policy to current cluster size */ - root_dist->numsegments = new_numsegments; - - GpPolicyReplace(relid, root_dist); - rel->rd_cdbpolicy = root_dist; + GpPolicyReplace(relid, new_policy); + /* We should make the policy between on-disk catalog and on-memory relation cache consistently */ + rel->rd_cdbpolicy = new_policy; } else { @@ -16412,19 +16416,34 @@ ATExecExpandPartitionTablePrepare(Relation rel) ExtTableEntry *ext = GetExtTableEntry(relid); if (ext->iswritable) { + GpPolicy *new_policy; + MemoryContext oldcontext; + /* Just modify the numsegments for external writable leaves */ - GpPolicy *leaf_dist = GpPolicyCopy(rel_dist); - leaf_dist->numsegments = new_numsegments; - GpPolicyReplace(relid, leaf_dist); + oldcontext = MemoryContextSwitchTo(GetMemoryChunkContext(rel)); + new_policy = GpPolicyCopy(rel->rd_cdbpolicy); + new_policy->numsegments = new_numsegments; + MemoryContextSwitchTo(oldcontext); + + GpPolicyReplace(relid, new_policy); + /* We should make the policy between on-disk catalog and on-memory relation cache consistently */ + rel->rd_cdbpolicy = new_policy; } } } else { + GpPolicy *new_policy; + MemoryContext oldcontext; + /* we change policy type to randomly for regular leaf partitions distributed by hash */ - GpPolicy *random_dist = createRandomPartitionedPolicy(new_numsegments); - GpPolicyReplace(relid, random_dist); - rel->rd_cdbpolicy = random_dist; + oldcontext = MemoryContextSwitchTo(GetMemoryChunkContext(rel)); + new_policy = createRandomPartitionedPolicy(new_numsegments); + MemoryContextSwitchTo(oldcontext); + + GpPolicyReplace(relid, new_policy); + /* We should make the policy between on-disk catalog and on-memory relation cache consistently */ + rel->rd_cdbpolicy = new_policy; } } }
Deinit all registered volume types
@@ -84,7 +84,7 @@ void ocf_ctx_unregister_volume_type(ocf_ctx_t ctx, uint8_t type_id) { OCF_CHECK_NULL(ctx); - if (type_id < OCF_VOLUME_TYPE_MAX_USER) + if (type_id < OCF_VOLUME_TYPE_MAX) ocf_ctx_unregister_volume_type_internal(ctx, type_id); }
ViewProfile: cleanup previews on contact change
@@ -35,7 +35,11 @@ export function ViewProfile(props: any) { ) ); })(); - }, [contact?.groups]); + + return () => { + setPreviews([]); + } + }, [ship]); return ( <>
iproved handling of ack and pspoll frames
@@ -3115,12 +3115,7 @@ if(macfrx->type == IEEE80211_FTYPE_CTL) return; } } -if(macfrx->subtype == IEEE80211_STYPE_PSPOLL) - { - process80211powersave_poll(); - return; - } -if(packetlen < (int)RTH_SIZE +(int)MAC_SIZE_NORM) return; +if(ieee82011len < (int)MAC_SIZE_NORM) return; if(macfrx->type == IEEE80211_FTYPE_MGMT) { if(macfrx->subtype == IEEE80211_STYPE_BEACON) @@ -3147,6 +3142,10 @@ if(macfrx->type == IEEE80211_FTYPE_MGMT) else if(macfrx->subtype == IEEE80211_STYPE_ACTION) process80211action(); else return; } +else if(macfrx->type == IEEE80211_FTYPE_CTL) + { + if(macfrx->subtype == IEEE80211_STYPE_PSPOLL) process80211powersave_poll(); + } else if(macfrx->type == IEEE80211_FTYPE_DATA) { if(((macfrx->subtype &IEEE80211_STYPE_NULLFUNC) == IEEE80211_STYPE_NULLFUNC) || ((macfrx->subtype &IEEE80211_STYPE_QOS_NULLFUNC) == IEEE80211_STYPE_QOS_NULLFUNC))
examples:dns_matching: helper function for adding cache entry Makes it slightly easier to add more cache entries
@@ -27,7 +27,12 @@ def encode_dns(name): return (c_ubyte * size).from_buffer(b) - +def add_cache_entry(cache, name): + key = cache.Key() + key.p = encode_dns(name) + leaf = cache.Leaf() + leaf.p = (c_ubyte * 4).from_buffer(bytearray(4)) + cache[key] = leaf # initialize BPF - load source code from http-parse-simple.c bpf = BPF(src_file = "dns_matching.c", debug=0) @@ -46,12 +51,8 @@ BPF.attach_raw_socket(function_dns_matching, "eth1") # Get the table. cache = bpf.get_table("cache") -# Create first entry for foo.bar -key = cache.Key() -key.p = encode_dns("foo.bar") - -leaf = cache.Leaf() -leaf.p = (c_ubyte * 4).from_buffer(bytearray(4)) -cache[key] = leaf +# Add cache entries +add_cache_entry(cache, "foo.bar") +add_cache_entry(cache, "another.sample.domain") bpf.trace_print()
segger/sysview: add up_perf_freq result chaeck
@@ -375,6 +375,12 @@ int note_sysview_initialize(void) note_sysview_send_tasklist, }; + if (freq == 0) + { + syslog(LOG_ERR, "up_perf isn't initialized, sysview isn't available"); + PANIC(); + } + SEGGER_SYSVIEW_Init(freq, freq, &g_sysview_trace_api, note_sysview_send_description);
group-store: automatically run rebuild on load
=| cards=(list card) |^ ?- -.old - %3 [(flop cards) this(state old)] + %3 + :_ this(state old) + :_ cards + [%pass /pyre/rebuild %agent [our dap]:bowl %poke noun+!>(%rebuild)] :: %2 %_ $
release: update numbers of test suites
@@ -88,7 +88,7 @@ If version numbers are correct in Rebuild cleanly, run all tests and also check for memleaks: cd ~build && ~e/scripts/configure-debian ~e && make -j5 && make run_all -j5 && make run_memcheck -j5 -Check if there are really >=135 or >=95 tests +Check if there are really >=241 or >=131 tests - Log tests: kdb run_all -v > ~elektra/$VERSION/run_all 2>&1
OpenXR: Cleanup/warnings;
@@ -306,7 +306,7 @@ static bool openxr_init(float offset, uint32_t msaa) { return true; } -static void openxr_destroy() { +static void openxr_destroy(void) { lovrRelease(Canvas, state.canvas); for (uint32_t i = 0; i < state.imageCount; i++) { lovrRelease(Texture, state.textures[i]); @@ -340,7 +340,7 @@ static bool openxr_getName(char* name, size_t length) { return true; } -static HeadsetOrigin openxr_getOriginType() { +static HeadsetOrigin openxr_getOriginType(void) { return state.referenceSpaceType == XR_REFERENCE_SPACE_TYPE_STAGE ? ORIGIN_FLOOR : ORIGIN_HEAD; } @@ -436,8 +436,8 @@ static bool openxr_getPose(Device device, vec3 position, quat orientation) { return false; } - XrSpaceLocation location; - XR(xrLocateSpace(state.spaces[device], state.referenceSpace, state.frameState.predictedDisplayTime, &location)); + XrSpaceLocation location = { .next = NULL }; + xrLocateSpace(state.spaces[device], state.referenceSpace, state.frameState.predictedDisplayTime, &location); memcpy(orientation, &location.pose.orientation, 4 * sizeof(float)); memcpy(position, &location.pose.position, 3 * sizeof(float)); return location.locationFlags & (XR_SPACE_LOCATION_POSITION_VALID_BIT | XR_SPACE_LOCATION_ORIENTATION_VALID_BIT); @@ -450,7 +450,7 @@ static bool openxr_getVelocity(Device device, vec3 linearVelocity, vec3 angularV XrSpaceVelocity velocity = { .type = XR_TYPE_SPACE_VELOCITY }; XrSpaceLocation location = { .next = &velocity }; - XR(xrLocateSpace(state.spaces[device], state.referenceSpace, state.frameState.predictedDisplayTime, &location)); + xrLocateSpace(state.spaces[device], state.referenceSpace, state.frameState.predictedDisplayTime, &location); memcpy(linearVelocity, &velocity.linearVelocity, 3 * sizeof(float)); memcpy(angularVelocity, &velocity.angularVelocity, 3 * sizeof(float)); return velocity.velocityFlags & (XR_SPACE_VELOCITY_LINEAR_VALID_BIT | XR_SPACE_VELOCITY_ANGULAR_VALID_BIT); @@ -611,12 +611,13 @@ static void openxr_renderTo(void (*callback)(void*), void* userdata) { callback(userdata); lovrGraphicsSetCamera(NULL, false); + const XrCompositionLayerBaseHeader* layers[1] = { (XrCompositionLayerBaseHeader*) &state.layers[0] }; + endInfo.layers = layers; + endInfo.layerCount = 1; state.layerViews[0].pose = views[0].pose; state.layerViews[0].fov = views[0].fov; state.layerViews[1].pose = views[1].pose; state.layerViews[1].fov = views[1].fov; - endInfo.layerCount = 1; - endInfo.layers = (const XrCompositionLayerBaseHeader*[1]) { &state.layers[0] }; } XR(xrReleaseSwapchainImage(state.swapchain, NULL));
build fix for Apple M1 (issue and pr
@@ -324,10 +324,14 @@ static inline mi_heap_t** mi_tls_pthread_heap_slot(void) { #elif defined(MI_TLS_PTHREAD) #include <pthread.h> extern pthread_key_t _mi_heap_default_key; -#else -extern mi_decl_thread mi_heap_t* _mi_heap_default; // default heap to allocate from #endif +// Default heap to allocate from (if not using TLS- or pthread slots). +// Do not use this directly but use through `mi_heap_get_default()` (or the unchecked `mi_get_default_heap`). +// This thread local variable is only used when neither MI_TLS_SLOT, MI_TLS_PTHREAD, or MI_TLS_PTHREAD_SLOT_OFS are defined. +// However, on the Apple M1 we do use the address of this variable as the unique thread-id (issue #356). +extern mi_decl_thread mi_heap_t* _mi_heap_default; // default heap to allocate from + static inline mi_heap_t* mi_get_default_heap(void) { #if defined(MI_TLS_SLOT) mi_heap_t* heap = (mi_heap_t*)mi_tls_slot(MI_TLS_SLOT);
Update picotls commit reference
# Build at a known-good commit # Must select a commit date (can copy-paste from git log) -COMMIT_ID=a760bd5812441d3ef44fd34ae3c5aaab2016712d +COMMIT_ID=ed9b9fee4ce8484ab86280e017bb5aafbd60adc3 COMMIT_DATE="Wed Oct 3 11:06:54 2018 +0900" cd ..
idf.py: add encoding option Merges
@@ -2,6 +2,7 @@ import os import re import subprocess import sys +from io import open from .constants import GENERATORS from .errors import FatalError @@ -96,7 +97,7 @@ def _parse_cmakecache(path): CMakeCache entries also each have a "type", but this is currently ignored. """ result = {} - with open(path) as f: + with open(path, encoding='utf-8') as f: for line in f: # cmake cache lines look like: CMAKE_CXX_FLAGS_DEBUG:STRING=-g # groups are name, type, value
Log retire-prior-to field
@@ -339,10 +339,12 @@ static void log_fr_new_connection_id(ngtcp2_log *log, const ngtcp2_pkt_hd *hd, log->log_printf( log->user_data, - (NGTCP2_LOG_PKT " NEW_CONNECTION_ID(0x%02x) seq=%" PRIu64 " cid=0x%s " + (NGTCP2_LOG_PKT " NEW_CONNECTION_ID(0x%02x) seq=%" PRIu64 + " cid=0x%s retire_prior_to=%" PRIu64 " stateless_reset_token=0x%s"), NGTCP2_LOG_FRM_HD_FIELDS(dir), fr->type, fr->seq, (const char *)ngtcp2_encode_hex(cid, fr->cid.data, fr->cid.datalen), + fr->retire_prior_to, (const char *)ngtcp2_encode_hex(buf, fr->stateless_reset_token, sizeof(fr->stateless_reset_token))); }
Ensure we free the copy of the orig. string when extracting a string via regex.
@@ -292,6 +292,7 @@ regex_extract_string (const char *str, const char *regex, int max_groups) { dest = xmalloc (snprintf (NULL, 0, "%s", copy + groups[i].rm_so) + 1); sprintf (dest, "%s", copy + groups[i].rm_so); + free (copy); } err:
Fix JSON fromating for non-object NULL
@@ -942,6 +942,10 @@ size_t fiobj_json2obj(FIOBJ *pobj, const void *data, size_t len) { */ FIOBJ fiobj_obj2json2(FIOBJ dest, FIOBJ o, uint8_t pretty) { assert(dest && FIOBJ_TYPE_IS(dest, FIOBJ_T_STRING)); + if (!o) { + fiobj_str_write(dest, "null", 4); + return 0; + } fio_ary_s stack; obj2json_data_s data = { .dest = dest, .stack = &stack, .pretty = pretty, .count = 1,
[kernel] correct initialization of _isWSymmetricDefinitePositive
@@ -61,7 +61,8 @@ MoreauJeanOSI::MoreauJeanOSI(double theta, double gamma): OneStepIntegrator(OSI::MOREAUJEANOSI), _constraintActivationThreshold(0.0), _useGammaForRelation(false), - _explicitNewtonEulerDSOperators(false) + _explicitNewtonEulerDSOperators(false), + _isWSymmetricDefinitePositive(false) { _levelMinForOutput= 0; _levelMaxForOutput =1;
Fix dumbindent comment typo
// // Each output line is indented according to the net number of open braces // preceding it, although lines starting with close braces will outdent first, -// similar to `gofmt` style. A line which starts ins a so-far-unbalanced open +// similar to `gofmt` style. A line which starts in a so-far-unbalanced open // parenthesis, such as the "w);" line above, gets 2 additional indent levels. // // Horizontal adjustment only affects a line's leading white space (and will
Skip symlinks to named pipes The d_type field contains the type as lstat would put it, but when checking for a named pipe we need the stat behavior. Fixes
@@ -516,7 +516,7 @@ int is_symlink(const char *path, const struct dirent *d) { int is_named_pipe(const char *path, const struct dirent *d) { #ifdef HAVE_DIRENT_DTYPE - if (d->d_type != DT_UNKNOWN) { + if (d->d_type != DT_UNKNOWN && d->d_type != DT_LNK) { return d->d_type == DT_FIFO || d->d_type == DT_SOCK; } #endif
sdcard: add async wait for idle
@@ -110,6 +110,31 @@ static uint8_t sdcard_wait_for_idle() { return 0; } +static bool sdcard_wait_for_idle_async() { + if (!spi_txn_ready(&bus)) { + return false; + } + + static uint8_t ret = 0; + static bool in_progress = false; + if (in_progress) { + in_progress = false; + return ret == 0xFF; + } + + spi_txn_t *txn = spi_txn_init(&bus, NULL); + for (uint8_t i = 0; i < 7; i++) { + spi_txn_add_seg_const(txn, 0xFF); + } + spi_txn_add_seg(txn, &ret, NULL, 1); + spi_txn_submit(txn); + + spi_txn_continue(&bus); + in_progress = true; + + return false; +} + static uint8_t sdcard_command(const uint8_t cmd, const uint32_t args) { if (cmd != SDCARD_GO_IDLE && !sdcard_wait_for_idle()) { return 0xFF; @@ -446,10 +471,7 @@ uint8_t sdcard_update() { } case SDCARD_WRITE_MULTIPLE_VERIFY: { - if (!spi_txn_ready(&bus)) { - break; - } - if (!sdcard_wait_for_idle()) { + if (!sdcard_wait_for_idle_async()) { break; } @@ -465,10 +487,7 @@ uint8_t sdcard_update() { case SDCARD_WRITE_MULTIPLE_FINISH: { spi_txn_t *txn = spi_txn_init(&bus, NULL); - - spi_txn_add_seg_const(txn, 0xff); spi_txn_add_seg_const(txn, 0xfd); - spi_txn_submit(txn); spi_txn_continue(&bus); @@ -477,28 +496,14 @@ uint8_t sdcard_update() { } case SDCARD_WRITE_MULTIPLE_FINISH_WAIT: { - if (!spi_txn_ready(&bus)) { + if (!sdcard_wait_for_idle_async()) { break; } - static uint8_t response = 0x0; - if (response == 0xFF) { state = SDCARD_WRITE_MULTIPLE_DONE; break; } - spi_txn_t *txn = spi_txn_init(&bus, NULL); - - for (uint32_t i = 0; i < IDLE_BYTES; i++) { - spi_txn_add_seg_const(txn, 0xff); - } - spi_txn_add_seg(txn, &response, NULL, 1); - - spi_txn_submit(txn); - spi_txn_continue(&bus); - break; - } - case SDCARD_READY: return 1;
[dfs] Fix stdio fd error when POSIX api is used POSIX api e.g. poll read write
#include <lwp.h> #endif +#ifdef RT_USING_DFS_DEVFS +#include <libc.h> +#endif + /* Global variables */ const struct dfs_filesystem_ops *filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX]; struct dfs_filesystem filesystem_table[DFS_FILESYSTEMS_MAX]; @@ -212,6 +216,11 @@ struct dfs_fd *fd_get(int fd) struct dfs_fd *d; struct dfs_fdtable *fdt; +#ifdef RT_USING_DFS_DEVFS + if ((0 <= fd) && (fd <= 2)) + fd = libc_stdio_get_console(); +#endif + fdt = dfs_fdtable_get(); fd = fd - DFS_FD_OFFSET; if (fd < 0 || fd >= fdt->maxfd)
hslua-module-zip: export peekZipOptions
@@ -23,10 +23,13 @@ module HsLua.Module.Zip ( -- ** archive methods , extract , bytestring - -- * Archive entries + -- * Zip entry , typeEntry , peekEntryFuzzy + -- ** entry methods , contents + -- * Zip Options + , peekZipOptions ) where
Router: follow up to HTTP parser changes.
@@ -956,6 +956,12 @@ nxt_router_conn_http_header_parse(nxt_task_t *task, void *obj, void *data) } c->socket.data = rp; + + ret = nxt_http_parse_request_init(rp, c->mem_pool); + if (nxt_slow_path(ret != NXT_OK)) { + nxt_router_conn_close(task, c, data); + return; + } } ret = nxt_http_parse_request(rp, &c->read->mem);
interface: fix colour display in group switcher
@@ -54,7 +54,7 @@ function RecentGroups(props: { recent: string[]; associations: Associations }) { borderColor="lightGray" height="16px" width="16px" - bg={color} + bg={`#${color}`} mr={2} display="block" flexShrink='0'
Update: Let cycling events decay a bit as well
//Event selections per cycle for inference #define EVENT_SELECTIONS 1 //Event priority decay of events per cycle -#define EVENT_DURABILITY 1.0 +#define EVENT_DURABILITY 0.995 //Additional event priority decay of an event which was selected #define EVENT_DURABILITY_ON_USAGE 0.0 //Concept priority decay of events per cycle
Reuse the old key when the old keyval exists. This makes it easier to not leak memory when inserting the same key repeatedly.
@@ -131,23 +131,25 @@ generic htfree = {ht generic htput = {ht, k, v var i, di var h - var neltincr + var found di = 0 h = xhash(k) i = h & (ht.keys.len - 1) - neltincr = 1 + found = false while ht.hashes[i] != 0 && !ht.dead[i] if ht.hashes[i] == h && eq(ht.keys[i], k) - neltincr = 0 + found = true break ;; di++ i = (h + di) & (ht.keys.len - 1) ;; - ht.nelt += neltincr - ht.hashes[i] = h + if !found ht.keys[i] = k + ht.nelt++ + ;; + ht.hashes[i] = h ht.vals[i] = v ht.dead[i] = false if ht.keys.len < ht.nelt * 2
fix order of log output during CI at github
@@ -29,7 +29,7 @@ run_test() { echo "$ENVVARS$1" # run the test - (export $ENVVARS; $1) + (export $ENVVARS; $1 2>&1) #(export $ENVVARS; valgrind $1) # accumulate errors reported by the return value of the test @@ -92,17 +92,17 @@ if [ "${OS}" = "linux" ]; then ENVARS=$SAVEVARS rm -f "/tmp/dnstest.log" - test/access_rights.sh + test/access_rights.sh 2>&1 ERR+=$? - test/unixpeer.sh + test/unixpeer.sh 2>&1 ERR+=$? - test/undefined_sym.sh + test/undefined_sym.sh 2>&1 ERR+=$? fi -test/options.sh +test/options.sh 2>&1 ERR+=$? # ^
rest-frontend: workaround backend bug We simply workaround Bug by directly specifying the 'sortby' parameter when building the sitemap. However, this needs to be fixed in the backend.
@@ -81,7 +81,7 @@ module.exports = function (grunt) { }; this.handleDynamicSnippets = function (urlset) { - var response = request('GET', self.data.dynamic.backend + 'database'); + var response = request('GET', self.data.dynamic.backend + 'database?sortby=key'); if (response.statusCode !== 200) { grunt.log.error('Could not reach Backend and could therefore not create sitemap.xml!'); }
set cic_*/NUMBER_OF_STAGES to 6 in sdr_transceiver_wspr/rx.tcl
@@ -135,7 +135,7 @@ for {set i 0} {$i <= 15} {incr i} { cell xilinx.com:ip:cic_compiler:4.0 cic_$i { INPUT_DATA_WIDTH.VALUE_SRC USER FILTER_TYPE Decimation - NUMBER_OF_STAGES 3 + NUMBER_OF_STAGES 6 SAMPLE_RATE_CHANGES Fixed FIXED_OR_INITIAL_RATE 250 INPUT_SAMPLE_FREQUENCY 125
compile_time_macros: Make _STATIC_ASSERT work with C++ BRANCH=none TEST=make buildall
#include <sys/util.h> #endif +#ifdef __cplusplus +#define _STATIC_ASSERT static_assert +#else +#define _STATIC_ASSERT _Static_assert +#endif + /* Test an important condition at compile time, not run time */ #define _BA1_(cond, file, line, msg) \ - _Static_assert(cond, file ":" #line ": " msg) + _STATIC_ASSERT(cond, file ":" #line ": " msg) #define _BA0_(c, f, l, msg) _BA1_(c, f, l, msg) /* Pass in an option message to display after condition */
make fwd code compile again
@@ -146,7 +146,7 @@ void fwd_remove( struct forwarding_t *item ) { * We do not actually check if we are in a private network. * This function is called in intervals. */ -void fwd_handle( int _rc, int _sock, void *_data ) { +void fwd_handle( int _rc, int _sock ) { struct forwarding_t *item; int rc; time_t lifespan;
Fix M_PI redefinition; We just set it in util now.
@@ -546,7 +546,6 @@ if(WIN32) set_target_properties(lovr PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") target_compile_definitions(lovr PUBLIC -D_CRT_SECURE_NO_WARNINGS) target_compile_definitions(lovr PUBLIC -D_CRT_NONSTDC_NO_WARNINGS) - target_compile_definitions(lovr PUBLIC -D_USE_MATH_DEFINES) if(MSVC_VERSION VERSION_LESS 1900) target_compile_definitions(lovr PUBLIC -Dinline=__inline -Dsnprintf=_snprintf)
Move MAC-ALL to self._ciphs in ssl-opt.sh
@@ -244,14 +244,14 @@ class GnuTLSServ(TLSProgram): priority_string_list.extend(update_priority_string_list( self._ciphers, self.CIPHER_SUITE)) else: - priority_string_list.append('CIPHER-ALL') + priority_string_list.extend(['CIPHER-ALL', 'MAC-ALL']) if self._sig_algs: signature_algorithms = set(self._sig_algs + self._cert_sig_algs) priority_string_list.extend(update_priority_string_list( signature_algorithms, self.SIGNATURE_ALGORITHM)) else: - priority_string_list.extend(['SIGN-ALL', 'MAC-ALL']) + priority_string_list.append('SIGN-ALL') if self._named_groups:
schema compile MAINTENANCE remove redundant asserts Performed in the function.
@@ -1283,7 +1283,6 @@ resolve_all: cctx.pmod = node->module->parsed; LOG_LOCSET(node, NULL, NULL, NULL); - assert(node->nodetype & (LYS_LEAF | LYS_LEAFLIST)); v = 0; while ((ret == LY_SUCCESS) && (lref = lys_type_leafref_next(node, &v))) { ret = lys_compile_unres_leafref(&cctx, node, lref, unres); @@ -1299,7 +1298,6 @@ resolve_all: cctx.pmod = node->module->parsed; LOG_LOCSET(node, NULL, NULL, NULL); - assert(node->nodetype & (LYS_LEAF | LYS_LEAFLIST)); v = 0; while ((ret == LY_SUCCESS) && (lref = lys_type_leafref_next(node, &v))) { ret = lys_compile_unres_leafref(&cctx, node, lref, unres);
Convert 2 obscure for loops in lib/parser.c to equivalent while loops
@@ -1556,10 +1556,12 @@ static void generate_implied_end_tags(GumboParser* parser, GumboTag exception) { TAG(DD), TAG(DT), TAG(LI), TAG(OPTION), TAG(OPTGROUP), TAG(P), TAG(RP), TAG(RB), TAG(RT), TAG(RTC) }; - for (; node_tag_in_set(get_current_node(parser), tags) && - !node_html_tag_is(get_current_node(parser), exception); - pop_current_node(parser)) - ; + while ( + node_tag_in_set(get_current_node(parser), tags) + && !node_html_tag_is(get_current_node(parser), exception) + ) { + pop_current_node(parser); + } } // This is the "generate all implied end tags thoroughly" clause of the spec. @@ -1570,9 +1572,9 @@ static void generate_all_implied_end_tags_thoroughly(GumboParser* parser) { TAG(OPTGROUP), TAG(P), TAG(RP), TAG(RT), TAG(RTC), TAG(TBODY), TAG(TD), TAG(TFOOT), TAG(TH), TAG(HEAD), TAG(TR) }; - for (; node_tag_in_set(get_current_node(parser), tags); - pop_current_node(parser)) - ; + while (node_tag_in_set(get_current_node(parser), tags)) { + pop_current_node(parser); + } } // This factors out the clauses relating to "act as if an end tag token with tag
hammer: Change PWM frequency to 10 kHz backlight driver required frequency between 5-100 kHz, let's pick 10 kHz. BRANCH=none TEST=Backlight works, scope output shows correct frequency. Commit-Ready: Nicolas Boichat Tested-by: Toshak Singhal
@@ -51,7 +51,7 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); /* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ const struct pwm_t pwm_channels[] = { - {STM32_TIM(TIM_KBLIGHT), STM32_TIM_CH(1), 0, 100 /* Hz */ }, + {STM32_TIM(TIM_KBLIGHT), STM32_TIM_CH(1), 0, 10000 /* Hz */ }, }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
update gripper control
@@ -852,13 +852,13 @@ class ChildApplet extends PApplet { if (flag) { - gripper.setValue(0.3); + // gripper.setValue(0.0); opencr_port.write("grip" + ',' + "on" + '\n'); } else { - gripper.setValue(-1.0); + // gripper.setValue(0.0); opencr_port.write("grip" + ',' + "off" + '\n'); }
Covering error
@@ -211,10 +211,14 @@ void DeRestPluginPrivate::handleTuyaClusterIndication(const deCONZ::ApsDataIndic case 0x0203: // position reached (more usefull I think) { quint8 lift = (quint8) data; - lightNode->setValue(RStateLift, lift); bool open = lift < 100; + lightNode->setValue(RStateLift, lift); lightNode->setValue(RStateOpen, open); - lightNode->setValue(RStateOn, open); + + quint8 level = lift * 254 / 100; + bool on = level > 0; + lightNode->setValue(RStateBri, level); + lightNode->setValue(RStateOn, on); } break;
NetworkTools: Fix ping dialog focus
@@ -350,7 +350,7 @@ INT_PTR CALLBACK NetworkPingWndProc( EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB); } - return TRUE; + break; case WM_COMMAND: { switch (GET_WM_COMMAND_ID(wParam, lParam))
Max FIS version update to 2.2
#define ERROR_INJ_TYPE_INVALID 0x08 #define MAX_FIS_SUPPORTED_BY_THIS_SW_MAJOR 2 -#define MAX_FIS_SUPPORTED_BY_THIS_SW_MINOR 1 +#define MAX_FIS_SUPPORTED_BY_THIS_SW_MINOR 2 /** The device path type for our driver and HII driver.
CMSIS-DSP:Corrected bug in arm_div_q63_to_q31
@@ -1350,7 +1350,7 @@ __STATIC_INLINE q31_t arm_div_q63_to_q31(q63_t num, q31_t den) /* * 64-bit division */ - result = (q31_t) num / den; + result = (q31_t) (num / den); return result; }
perf-tools/scorep: bump to v4.0
Summary: Scalable Performance Measurement Infrastructure for Parallel Codes Name: %{pname}-%{compiler_family}-%{mpi_family}%{PROJ_DELIM} -Version: 3.1 +Version: 4.0 Release: 1%{?dist} License: BSD Group: %{PROJ_NAME}/perf-tools
Update Timers section
@@ -300,15 +300,14 @@ clock should work better. It should be same clock passed to is :type:`ngtcp2_duration` which is also nanosecond resolution. `ngtcp2_conn_get_expiry()` tells an application when timer fires. -When timer fires, call `ngtcp2_conn_handle_expiry()` and -`ngtcp2_conn_write_pkt()` (or `ngtcp2_conn_writev_stream()`). - -After calling these functions, new expiry will be set. The -application should call `ngtcp2_conn_get_expiry()` to restart timer. -If `ngtcp2_conn_get_expiry()` returned :macro:`NGTCP2_ERR_IDLE_CLOSE`, -it means that an idle timer has expired for this particular -connection. In this case, drop the connection without calling -`ngtcp2_conn_write_connection_close()`. +When it fires, call `ngtcp2_conn_handle_expiry()`. If it returns +:macro:`NGTCP2_ERR_IDLE_CLOSE`, it means that an idle timer has fired +for this particular connection. In this case, drop the connection +without calling `ngtcp2_conn_write_connection_close()`. Otherwise, +call `ngtcp2_conn_writev_stream()`. After calling +`ngtcp2_conn_handle_expiry()` and `ngtcp2_conn_writev_stream()`, new +expiry is set. The application should call `ngtcp2_conn_get_expiry()` +to get a new deadline. Connection migration --------------------
machinarium: check for machinarium_init during free
#include <machinarium.h> #include <machinarium_private.h> +static int machinarium_initialized = 0; mm_t machinarium; MACHINE_API int @@ -18,12 +19,15 @@ machinarium_init(void) mm_tls_init(); mm_taskmgr_init(&machinarium.task_mgr); mm_taskmgr_start(&machinarium.task_mgr, 3); + machinarium_initialized = 1; return 0; } MACHINE_API void machinarium_free(void) { + if (! machinarium_initialized) + return; mm_taskmgr_stop(&machinarium.task_mgr); mm_machinemgr_free(&machinarium.machine_mgr); mm_msgcache_free(&machinarium.msg_cache);
fix(docs): Fix cmake version requirements
@@ -70,9 +70,7 @@ sudo apt install -y \ ``` :::note -Recent LTS releases of Debian and Ubuntu may include outdated CMake versions. If the output of `cmake --version` is older than 3.15, upgrade your distribution (e.g., from Ubuntu 18.04 LTS to Ubuntu 20.04 LTS), or else install CMake version 3.15 or newer manually (e.g, from Debian backports or by building from source). - -There is also a [zephyr bug](https://github.com/zephyrproject-rtos/zephyr/issues/22060) with cmake 3.19.x. You'll need a version _below_ 3.19. +Recent LTS releases of Debian and Ubuntu may include outdated CMake versions. If the output of `cmake --version` is older than 3.20, upgrade your distribution (e.g., from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS), or else install CMake version 3.20 or newer manually (e.g, from Debian backports or from PyPI with `pip install --user cmake`). ::: </TabItem> <TabItem value="raspberryos">
Fix scroll generation
@@ -1187,7 +1187,7 @@ class ScriptBuilder { // Replace newlines with scroll code if larger than max dialogue size if (scrollHeight) { let numNewlines = 0; - text = text.replace(/\n/g, (newline) => { + text = text.replace(/\\n/g, (newline) => { numNewlines++; if (numNewlines > scrollHeight - 1) { return "\\r";
Fix assign_wal_consistency_checking function It was noticed in CentOS 6 that the entries in the char* list would become blank after freeing the raw string that is obtained from setting the GUC wal_consistency_checking. We should free this string only after we finish using it. Authors: Jimmy Yih and Taylor Vesely
@@ -7449,8 +7449,6 @@ assign_wal_consistency_checking(const char *newval, bool doit, GucSource source) return NULL; } - free(rawstring); - foreach(l, elemlist) { char *tok = (char *) lfirst(l); @@ -7485,6 +7483,7 @@ assign_wal_consistency_checking(const char *newval, bool doit, GucSource source) /* If a valid resource manager is found, check for the next one. */ if (!found) { + free(rawstring); list_free(elemlist); ereport(GUC_complaint_elevel(source), @@ -7494,6 +7493,7 @@ assign_wal_consistency_checking(const char *newval, bool doit, GucSource source) } } + free(rawstring); list_free(elemlist); if (doit)
fix rs_input missing NULL pointer check
@@ -682,6 +682,9 @@ rs_input(void) uip_ds6_nbr_rm(nbr); nbr = uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned, 0, NBR_STALE, NBR_TABLE_REASON_IPV6_ND, NULL); + if(nbr == NULL) { + goto discard; + } nbr->reachable = nbr_data.reachable; nbr->sendns = nbr_data.sendns; nbr->nscount = nbr_data.nscount;
updated match_tag to not treat the 2nd argument as regex
@@ -97,7 +97,16 @@ end -- @param tag: The type name (string) -- @param tag_prefix: The prefix to test (string) function typedecl.match_tag(tag, tag_prefix) - return type(tag) == "string" and string.match(tag, tag_prefix .. ".(.*)") + local n = #tag_prefix + + if type(tag) == "string" and + string.sub(tag, 1, n) == tag_prefix and + string.byte(tag, n + 1) == 46 -- "." + then + return string.sub(tag, n + 2) + end + + return false end -- Throw an error at the given tag.
remove unused variables in pnlLimeNetMicro
@@ -67,8 +67,6 @@ void pnlLimeNetMicro::Initialize(lms_device_t* pControl) cmbTxPath->Clear(); cmbTxPath->Append(wxString(_("Band 1 TX"))); cmbTxPath->Append(wxString(_("Band 2 TX"))); - uint16_t addr = 3; - uint16_t value = 0; if (pControl) { uint16_t reg3 = 0;
common: add SIMDE_CHECKED_STATIC_CAST macro. Just like SIMDE_CHECKED_REINTERPRET_CAST, but for static instead of reinterpret casts.
@@ -363,12 +363,16 @@ HEDLEY_STATIC_ASSERT(sizeof(simde_float64) == 8, "Unable to find 64-bit floating /* This behaves like reinterpret_cast<to>(value), except that it will attempt te verify that value is of type "from" or "to". */ #if defined(__cplusplus) - template <typename To, typename From> class SIMDeCheckedReinterpretCastImpl { - public: - static To convert (To value) { return value; }; - static To convert (From value) { return reinterpret_cast<To>(value); }; + namespace SIMDeCheckedReinterpretCastImpl { + template <typename To, typename From> static To convert (To value) { return value; }; + template <typename To, typename From> static To convert (From value) { return reinterpret_cast<To>(value); }; }; - #define SIMDE_CHECKED_REINTERPRET_CAST(to, from, value) (SIMDeCheckedReinterpretCastImpl<to, from>::convert(value)) + namespace SIMDeCheckedStaticCastImpl { + template <typename To, typename From> static To convert (To value) { return value; }; + template <typename To, typename From> static To convert (From value) { return static_cast<To>(value); }; + }; + #define SIMDE_CHECKED_REINTERPRET_CAST(to, from, value) (SIMDeCheckedReinterpretCastImpl::convert<to, from>(value)) + #define SIMDE_CHECKED_STATIC_CAST(to, from, value) (SIMDeCheckedStaticCastImpl::convert<to, from>(value)) #elif \ HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ @@ -383,8 +387,16 @@ HEDLEY_STATIC_ASSERT(sizeof(simde_float64) == 8, "Unable to find 64-bit floating "Type of `" #value "` must be either `" #to "` or `" #from "`"); \ HEDLEY_REINTERPRET_CAST(to, value); \ })) + #define SIMDE_CHECKED_STATIC_CAST(to, from, value) \ + (__extension__({ \ + HEDLEY_STATIC_ASSERT(__builtin_types_compatible_p(from, __typeof__(value)) || \ + __builtin_types_compatible_p(to, __typeof__(value)), \ + "Type of `" #value "` must be either `" #to "` or `" #from "`"); \ + HEDLEY_STATIC_CAST(to, value); \ + })) #else #define SIMDE_CHECKED_REINTERPRET_CAST(to, from, value) HEDLEY_REINTERPRET_CAST(to, value) + #define SIMDE_CHECKED_STATIC_CAST(to, from, value) HEDLEY_STATIC_CAST(to, value) #endif #if HEDLEY_HAS_WARNING("-Wfloat-equal")
Make lv_ta_get_placeholder_text do what it says Thanks to on the forum for reporting this:
@@ -917,7 +917,7 @@ const char * lv_ta_get_placeholder_text(lv_obj_t * ta) const char * txt = NULL; - if(ext->placeholder) txt = lv_label_get_text(ext->label); + if(ext->placeholder) txt = lv_label_get_text(ext->placeholder); return txt; }
landscape: fix un-set avatars in participants list
@@ -304,7 +304,7 @@ function Participant(props: { }, [api, contact, association]); const avatar = - contact?.avatar !== null && !hideAvatars ? ( + contact?.avatar && !hideAvatars ? ( <Image src={contact.avatar} height={32}
Update header guards msf.h
-#ifndef __MSF_H -#define __MSF_H +#ifndef OPENWSN_MSF_H +#define OPENWSN_MSF_H /** \addtogroup MAChigh @@ -88,4 +88,4 @@ uint8_t msf_getPreviousNumCellsUsed(cellType_t cellType); \} */ -#endif +#endif /* OPENWSN_MSF_H */
nimble/ll: Create LL task only for Mynewt build NimBLE ported for other OS will require app to create task for LL manually. This is to avoid adding porting layer for task creation only to create single task.
@@ -208,6 +208,8 @@ static void ble_ll_event_rx_pkt(struct os_event *ev); static void ble_ll_event_tx_pkt(struct os_event *ev); static void ble_ll_event_dbuf_overflow(struct os_event *ev); +#if MYNEWT + /* The BLE LL task data structure */ #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) /* TODO: This is for testing. Check it we really need it */ @@ -220,6 +222,8 @@ struct os_task g_ble_ll_task; OS_TASK_STACK_DEFINE(g_ble_ll_stack, BLE_LL_STACK_SIZE); +#endif /* MYNEWT */ + /** Our global device address (public) */ uint8_t g_dev_addr[BLE_DEV_ADDR_LEN]; @@ -1536,10 +1540,19 @@ ble_ll_init(void) lldata->ll_supp_features = features; +#if MYNEWT /* Initialize the LL task */ os_task_init(&g_ble_ll_task, "ble_ll", ble_ll_task, NULL, MYNEWT_VAL(BLE_LL_PRIO), OS_WAIT_FOREVER, g_ble_ll_stack, BLE_LL_STACK_SIZE); +#else + +/* + * For non-Mynewt OS it is required that OS creates task for LL and run LL + * routine which is wrapped by nimble_port_ll_task_func(). + */ + +#endif rc = stats_init_and_reg(STATS_HDR(ble_ll_stats), STATS_SIZE_INIT_PARMS(ble_ll_stats, STATS_SIZE_32),
Avoid leak in error path of PKCS5_PBE_keyivgen CLA: trivial
@@ -51,11 +51,13 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, ivl = EVP_CIPHER_iv_length(cipher); if (ivl < 0 || ivl > 16) { EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN, EVP_R_INVALID_IV_LENGTH); + PBEPARAM_free(pbe); return 0; } kl = EVP_CIPHER_key_length(cipher); if (kl < 0 || kl > (int)sizeof(md_tmp)) { EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN, EVP_R_INVALID_KEY_LENGTH); + PBEPARAM_free(pbe); return 0; } @@ -84,6 +86,7 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, if (!EVP_DigestUpdate(ctx, salt, saltlen)) goto err; PBEPARAM_free(pbe); + pbe = NULL; if (!EVP_DigestFinal_ex(ctx, md_tmp, NULL)) goto err; mdsize = EVP_MD_size(md); @@ -106,6 +109,7 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, OPENSSL_cleanse(iv, EVP_MAX_IV_LENGTH); rv = 1; err: + PBEPARAM_free(pbe); EVP_MD_CTX_free(ctx); return rv; }
c++ bindings: bug fix
@@ -12,8 +12,13 @@ void ThreadTrampolineWithJoin(void *arg) { d->func_(); spin_lock(&d->lock_); d->done_ = true; - if (d->waiter_) thread_ready(d->waiter_); + if (d->waiter_) { spin_unlock(&d->lock_); + thread_ready(d->waiter_); + return; + } + d->waiter_ = thread_self(); + thread_park_and_unlock(&d->lock_); } } // namespace thread_internal @@ -53,6 +58,7 @@ void Thread::Join() { spin_lock(&join_data_->lock_); if (join_data_->done_) { spin_unlock(&join_data_->lock_); + thread_ready(join_data_->waiter_); join_data_ = nullptr; return; }
apps/x509: Improve doc fix for -CAserial anc -CAcreateserial This follows up on
@@ -496,8 +496,9 @@ See L<openssl-format-options(1)> for details. Sets the CA serial number file to use. -When creating a certificate with this option, the certificate serial number -is stored in the given file. This file consists of one line containing +When creating a certificate with this option and with the B<-CA> option, +the certificate serial number is stored in the given file. +This file consists of one line containing an even number of hex digits with the serial number used last time. After reading this number, it is incremented and used, and the file is updated. @@ -512,9 +513,10 @@ a random number is generated; this is the recommended practice. =item B<-CAcreateserial> -With this option the CA serial number file is created if it does not exist. -A random number is generated, used for the certificate, and saved into the -serial number file in that case. +With this option and the B<-CA> option +the CA serial number file is created if it does not exist. +A random number is generated, used for the certificate, +and saved into the serial number file determined as described above. =back
Exclude AMs with internal handlers in gpcheckcat dependency checks Creating AMs with internal handlers will not have entries in `pg_depend`, which is reasonable since internal handlers could not be dropped, but `gpcheckcat` is not happy with it. This commit excludes that and fixes the `getName()` deprecated issue.
@@ -392,7 +392,7 @@ class execThread(Thread): def processThread(threads): batch = [] for th in threads: - logger.debug('waiting on thread %s' % th.getName()) + logger.debug('waiting on thread %s' % th.name) th.join() if th.error: setError(ERROR_NOREPAIR) @@ -422,7 +422,7 @@ def connect2run(qry, col=None): thread = execThread(c, db, qry) thread.start() logger.debug('launching query thread %s for dbid %i' % - (thread.getName(), dbid)) + (thread.name, dbid)) threads.append(thread) # we don't want too much going on at once @@ -914,10 +914,15 @@ def checkCatalogJoinDepend(catalogs): # do drop their proclang handler functions) will be # replacing language so this exclusion should be fine. if str(cat) == 'pg_proc': - qry += """ - AND pronamespace != {oid} + qry += """AND pronamespace != {oid} """.format(oid=PG_CATALOG_OID) + # Exclude pg_am entries which depend on internal handlers. + if str(cat) == 'pg_am': + qry = """ + SELECT '{catalog}' AS catalog, pg_am.oid AS oid FROM {catalog} JOIN pg_proc ON pg_am.amhandler::text = pg_proc.proname WHERE pg_am.oid >= {oid} AND pg_proc.oid >= {oid} + """.format(catalog=cat, oid=FIRST_NORMAL_OID) + deps.append(qry) # Construct query that will check that each OID in our aggregated @@ -1420,7 +1425,7 @@ def checkAOSegVpinfo(): thread = checkAOSegVpinfoThread(cfg, db_connection) thread.start() logger.debug('launching check thread %s for dbid %i' % - (thread.getName(), dbid)) + (thread.name, dbid)) threads.append(thread) if (i % GV.opt['-B']) == 0:
tools/netqtop: fix rx queue id Net device driver uses 'skb_record_rx_queue' to mark rx queue mapping during receiving a packet. Also need to call 'skb_get_rx_queue' to get rx queue id.
@@ -95,19 +95,33 @@ TRACEPOINT_PROBE(net, net_dev_start_xmit){ } TRACEPOINT_PROBE(net, netif_receive_skb){ - struct sk_buff* skb = (struct sk_buff*)args->skbaddr; - if(!name_filter(skb)){ + struct sk_buff skb; + + bpf_probe_read(&skb, sizeof(skb), args->skbaddr); + if(!name_filter(&skb)){ return 0; } - u16 qid = skb->queue_mapping; + /* case 1: if the NIC does not support multi-queue feature, there is only + * one queue(qid is always 0). + * case 2: if the NIC supports multi-queue feature, there are several queues + * with different qid(from 0 to n-1). + * The net device driver should mark queue id by API 'skb_record_rx_queue' + * for a recieved skb, otherwise it should be a BUG(all of the packets are + * reported as queue 0). For example, virtio net driver is fixed for linux: + * commit: 133bbb18ab1a2("virtio-net: per-queue RPS config") + */ + u16 qid = 0; + if (skb_rx_queue_recorded(&skb)) + qid = skb_get_rx_queue(&skb); + struct queue_data newdata; __builtin_memset(&newdata, 0, sizeof(newdata)); struct queue_data *data = rx_q.lookup_or_try_init(&qid, &newdata); if(!data){ return 0; } - updata_data(data, skb->len); + updata_data(data, skb.len); return 0; }
Test XML_ErrorString range checking
@@ -2845,6 +2845,16 @@ START_TEST(test_misc_null_parser) } END_TEST +/* Test that XML_ErrorString rejects out-of-range codes */ +START_TEST(test_misc_error_string) +{ + if (XML_ErrorString((enum XML_Error)-1) != NULL) + fail("Negative error code not rejected"); + if (XML_ErrorString((enum XML_Error)100) != NULL) + fail("Large error code not rejected"); +} +END_TEST + static void alloc_setup(void) @@ -3382,6 +3392,7 @@ make_suite(void) tcase_add_test(tc_misc, test_misc_alloc_ns); tcase_add_test(tc_misc, test_misc_null_parser); tcase_add_test(tc_misc, test_misc_alloc_ns_parse_buffer); + tcase_add_test(tc_misc, test_misc_error_string); suite_add_tcase(s, tc_alloc); tcase_add_checked_fixture(tc_alloc, alloc_setup, alloc_teardown);
update java grpc version
-FAKEID=4286128 +FAKEID=4342739 CURDIR=. BINDIR=bin:/ @@ -1529,8 +1529,8 @@ module _JAVA_LIBRARY: BASE_UNIT { } JAVA_PROTOBUF=contrib/java/com/google/protobuf/protobuf-java/3.5.1 -JAVA_GRPC_STUB=contrib/java/io/grpc/grpc-stub/1.12.0 -JAVA_GRPC_PROTOBUF=contrib/java/io/grpc/grpc-protobuf/1.12.0 +JAVA_GRPC_STUB=contrib/java/io/grpc/grpc-stub/1.18.0 +JAVA_GRPC_PROTOBUF=contrib/java/io/grpc/grpc-protobuf/1.18.0 module PY_LIBRARY: _LIBRARY { _ARCADIA_PYTHON_ADDINCL()
BugID:16966632:modify mal ica test macro
@@ -5,7 +5,7 @@ $(NAME)_SOURCES := mdal_ica_at_client.c malica_test ?= 0 ifeq (1,$(malica_test)) $(NAME)_SOURCES += test/mdal_ica_at_client_test.c -GLOBAL_DEFINES += DMAL_MAL_ICA_TEST +GLOBAL_DEFINES += MDAL_MAL_ICA_TEST endif GLOBAL_INCLUDES += ./
Adjusted maximum number of operands
@@ -47,7 +47,7 @@ extern "C" { /* ---------------------------------------------------------------------------------------------- */ #define ZYDIS_MAX_INSTRUCTION_LENGTH 15 -#define ZYDIS_MAX_OPERAND_COUNT 9 +#define ZYDIS_MAX_OPERAND_COUNT 10 /* ---------------------------------------------------------------------------------------------- */
man: sway(5) move fixes
@@ -216,10 +216,9 @@ set|plus|minus|toggle <amount> further details. *move* left|right|up|down [<px> px] - Moves the focused container in the direction specified. If the container, - the optional _px_ argument specifies how many pixels to move the container. - If unspecified, the default is 10 pixels. Pixels are ignored when moving - tiled containers. + Moves the focused container in the direction specified. The optional _px_ + argument specifies how many pixels to move the container. If unspecified, + the default is 10 pixels. Pixels are ignored when moving tiled containers. *move* [absolute] position <pos_x> [px|ppt] <pos_y> [px|ppt] Moves the focused container to the specified position in the workspace.
[readme] added text_color
@@ -70,7 +70,7 @@ A partial list of parameters are below. See the config file for a complete list. | `no_display` | Hide the hud by default | | `toggle_hud=`<br>`toggle_logging=` | Modifiable toggle hotkeys. Default are F12 and F2, respectively. | | `time`<br>`time_format=%T` | Displays local time. See [std::put_time](https://en.cppreference.com/w/cpp/io/manip/put_time) for formatting help. | -| `gpu_color`<br>`gpu_color`<br>`vram_color`<br>`ram_color`<br>`io_color`<br>`engine_color`<br>`frametime_color`<br>`background_color` | Change default colors: `gpu_color=RRGGBB`| +| `gpu_color`<br>`gpu_color`<br>`vram_color`<br>`ram_color`<br>`io_color`<br>`engine_color`<br>`frametime_color`<br>`background_color`<br>`text_color` | Change default colors: `gpu_color=RRGGBB`| | `alpha` | Set the opacity of all text and frametime graph `0.0-1.0` | | `background_alpha` | Set the opacity of the background `0.0-1.0` |
%hold removed
%| %- fork %+ turn ~(tap in q.lap) |= [a=type *] - :- %hold ?> ?=([%core *] a) - =+ dox=[%core q.q.a q.a] - [dox [%$ 1]] + [%core q.q.a q.a] == :: :: ++ feel :: detect existence
enable multimodule for DOCS
@@ -1597,7 +1597,7 @@ module PACKAGE: BASE_UNIT { PACKED_PACKAGE_ARGS+=--dest-arch ${output;suf=.$PACKED_PACKAGE_EXT:REALPRJNAME} } SET(NEED_PLATFORM_PEERDIRS no) - PEERDIR_TAGS=CPP_PROTO PY2 PY2_NATIVE YQL_UDF_SHARED __EMPTY__ + PEERDIR_TAGS=CPP_PROTO PY2 PY2_NATIVE YQL_UDF_SHARED __EMPTY__ DOCBOOK } module TGZ_PACKAGE: UNION { @@ -1626,7 +1626,7 @@ module UNION: BASE_UNIT { SET(DONT_RESOLVE_INCLUDES yes) .CMD=TOUCH_UNIT_MF SET(NEED_PLATFORM_PEERDIRS no) - PEERDIR_TAGS=CPP_PROTO PY2 PY2_NATIVE YQL_UDF_SHARED __EMPTY__ + PEERDIR_TAGS=CPP_PROTO PY2 PY2_NATIVE YQL_UDF_SHARED __EMPTY__ DOCBOOK } module PY_PACKAGE: UNION { @@ -1643,14 +1643,29 @@ module PY_PACKAGE: UNION { ### Is only used together with the macros DOCS_DIR(), DOCS_CONFIG(), DOCS_VARS(). ### ### Module declaration must be finished with the macro END(). -module DOCS: UNION { +multimodule DOCS { + + module DOCBOOK: PACKAGE { .ALL_INS_TO_OUT=yes .CMD=TOUCH_DOCS_MF .FINAL_TARGET=yes - + SET(PEERDIR_TAGS DOCSLIB) + SET(MODULE_TAG DOCBOOK) PROCESS_DOCS() } + module DOCSLIB: UNION { + .ALL_INS_TO_OUT=yes + .CMD=TOUCH_DOCS_MF + .FINAL_TARGET=no + SET(MODULE_SUFFIX .pkg-dep.fake) + SET(PEERDIR_TAGS DOCSLIB) + SET(MODULE_TAG DOCSLIB) + PROCESS_DOCSLIB() + } + +} + DOCSDIR= ### @usage DOCS_DIR(path)
zephyr: guybrush: Drop PLATFORM_EC_{BOARD,BASEBOARD} variables We don't use these, a little bit by design, so that Skyrim has no dependency on the legacy board & baseboard directories. BRANCH=none TEST=zmake testall
@@ -9,11 +9,6 @@ project(guybrush) zephyr_library_include_directories(include) -set(PLATFORM_EC_BASEBOARD "${PLATFORM_EC}/baseboard/guybrush" CACHE PATH - "Path to the platform/ec baseboard directory") -set(PLATFORM_EC_BOARD "${PLATFORM_EC}/board/guybrush" CACHE PATH - "Path to the platform/ec board directory") - zephyr_library_sources("power_signals.c") zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC
Verbose command-line help
@@ -272,8 +272,15 @@ _main_getopt(c3_i argc, c3_c** argv) static void u3_ve_usage(c3_i argc, c3_c** argv) { -#if 0 - c3_c *use_c[] = {"Usage: %s [options...] computer\n", + c3_c *use_c[] = { + "Urbit: a personal server operating function\n", + "https://urbit.org\n", + "Version " URBIT_VERSION "\n", + "\n", + "Usage: %s [options...] ship_name\n", + "where ship_name is a @p phonetic representation of an urbit address\n", + "without the leading '~', and options is some subset of the following:\n", + "\n", "-c pier Create a new urbit in pier/\n", "-w name Immediately upgrade to ~name\n", "-t ticket Use ~ticket automatically\n", @@ -298,16 +305,21 @@ u3_ve_usage(c3_i argc, c3_c** argv) "-f Fuzz testing\n", "-k stage Start at Hoon kernel version stage\n", "-R Report urbit build info\n", - "-Xwtf Skip last event\n"}; -#else - c3_c *use_c[] = { - "simple usage: \n", + "-Xwtf Skip last event\n", + "\n", + "Development Usage:\n", + " To create a development ship, use a fakezod:\n", + " %s -FI zod -A /path/to/arvo/folder -B /path/to/pill -c zod\n", + "\n", + " For more information about developing on urbit, see:\n", + " https://github.com/urbit/urbit/blob/master/CONTRIBUTING.md\n", + "\n", + "Simple Usage: \n", " %s -c <mycomet> to create a comet (anonymous urbit)\n", " %s -w <myplanet> -t <myticket> if you have a ticket\n", " %s <myplanet or mycomet> to restart an existing urbit\n", 0 }; -#endif c3_i i; for ( i=0; use_c[i]; i++ ) {
KDB: Fix spelling mistake
@@ -138,7 +138,7 @@ public: ret.push_back (getStdColor (ANSI_COLOR::BOLD) + "help" + getStdColor (ANSI_COLOR::RESET) + "\t" + "View the man page of a tool"); ret.push_back (getStdColor (ANSI_COLOR::BOLD) + "list-tools" + getStdColor (ANSI_COLOR::RESET) + "\t" + - "List all external tool"); + "List all external tools"); return ret; }
Fix SRCS doc
@@ -3344,7 +3344,7 @@ macro SRC(FILE, FLAGS...) { ### Arcadia Paths from the root and is relative to the project's LIST are supported ### ### GLOBAL marks next file as direct input to link phase of the program/shared library project built into. This prevents symbols of the file to be excluded by linker as unused. -### The scope of the GLOBAL keyword is the following file (that is, in the case of SRCS(GLOBAL foo.the cpp bar.cpp) global will be only foo.cpp) +### The scope of the GLOBAL keyword is the following file (that is, in the case of SRCS(GLOBAL foo.cpp bar.cpp) global will be only foo.cpp) ### ### @example: ###
hfnd: allow to skip fuzzing if an env is set - missing coma
@@ -269,7 +269,7 @@ void netDriver_waitForServerReady(uint16_t portno) { __attribute__((weak)) int LLVMFuzzerInitialize(int *argc, char ***argv) { if (getenv(HFND_SKIP_FUZZING_ENV)) { LOG_I( - "Honggfuzz Net Driver (pid=%d): '%s is set, skipping fuzzing, calling main() directly", + "Honggfuzz Net Driver (pid=%d): '%s' is set, skipping fuzzing, calling main() directly", getpid(), HFND_SKIP_FUZZING_ENV); if (!HonggfuzzNetDriver_main) { LOG_F(
tsctp: fix compiler warning
@@ -67,7 +67,7 @@ struct socket *psock = NULL; static struct timeval start_time; unsigned int runtime = 0; static unsigned long messages = 0; -static unsigned long first_length = 0; +static unsigned long long first_length = 0; static unsigned long long sum = 0; static unsigned int use_cb = 0; @@ -211,7 +211,7 @@ handle_connection(void *arg) gettimeofday(&time_now, NULL); timersub(&time_now, &time_start, &time_diff); seconds = time_diff.tv_sec + (double)time_diff.tv_usec/1000000.0; - printf("%lu, %lu, %lu, %lu, %llu, %f, %f\n", + printf("%llu, %lu, %lu, %lu, %llu, %f, %f\n", first_length, messages, recv_calls, notifications, sum, seconds, (double)first_length * (double)messages / seconds); fflush(stdout); usrsctp_close(conn_sock); @@ -307,7 +307,7 @@ server_receive_cb(struct socket *sock, union sctp_sockstore addr, void *data, gettimeofday(&now, NULL); timersub(&now, &start_time, &diff_time); seconds = diff_time.tv_sec + (double)diff_time.tv_usec/1000000.0; - printf("%lu, %lu, %llu, %f, %f\n", + printf("%llu, %lu, %llu, %f, %f\n", first_length, messages, sum, seconds, (double)first_length * (double)messages / seconds); usrsctp_close(sock); first_length = 0;
A slightly more complex take: keep track successes and failures
@@ -57,6 +57,51 @@ struct st_h2o_http3_ingress_unistream_t { const ptls_iovec_t h2o_http3_alpn[1] = {{(void *)H2O_STRLIT("h3-25")}}; +static struct { + pthread_mutex_t lock; + time_t last_reported; + size_t failures; + size_t successes; + int last_errno; +} track_sendmsg = { + .lock = PTHREAD_MUTEX_INITIALIZER, +}; + +static void track_sendmsg_failure(void) +{ + __sync_fetch_and_add(&track_sendmsg.failures, 1); + track_sendmsg.last_errno = errno; +} + +static void track_sendmsg_success(void) +{ + __sync_fetch_and_add(&track_sendmsg.successes, 1); +} + +static void track_sendmsg_flush(h2o_loop_t *loop) +{ + uint64_t now = h2o_now(loop); + if (track_sendmsg.last_reported + 60000 < now) { + /* this is racy, and might under report successes when there is a + failure, but allows to avoid taking the lock in the happy path */ + if (track_sendmsg.failures == 0) { + track_sendmsg.last_reported = now; + track_sendmsg.successes = 0; + return; + } + pthread_mutex_lock(&track_sendmsg.lock); + if (track_sendmsg.last_reported + 60000 < now) { + fprintf(stderr, "sendmsg failed %zu time%s, succeeded: %zu time%s, over the last minute: %s\n", track_sendmsg.failures, + track_sendmsg.failures > 1 ? "s" : "", track_sendmsg.successes, track_sendmsg.successes > 1 ? "s" : "", + strerror(track_sendmsg.last_errno)); + track_sendmsg.failures = 0; + track_sendmsg.successes = 0; + track_sendmsg.last_errno = 0; + track_sendmsg.last_reported = now; + } + pthread_mutex_unlock(&track_sendmsg.lock); + } +} /** * Sends a packet, returns if the connection is still maintainable (false is returned when not being able to send a packet from the * designated source address). @@ -134,16 +179,11 @@ int h2o_http3_send_datagram(h2o_http3_ctx_t *ctx, quicly_datagram_t *p) /* Temporary failure to send a packet is not a permanent error fo the connection. (TODO do we want do something more * specific?) */ - static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; - static time_t last_reported = 0; - time_t now = time(NULL); - pthread_mutex_lock(&lock); - if (last_reported + 60 < now) { - last_reported = now; - perror("sendmsg failed"); - } - pthread_mutex_unlock(&lock); + track_sendmsg_failure(); + } else { + track_sendmsg_success(); } + track_sendmsg_flush(ctx->loop); return 1; }
fix segfault from no tracker
@@ -214,7 +214,7 @@ SURVIVE_EXPORT int8_t survive_get_bsd_idx(SurviveContext *ctx, survive_channel c if (ctx->lh_version == 0) { if (ctx->bsd[channel].mode == 0xFF) { - ctx->bsd[channel] = (BaseStationData){0}; + ctx->bsd[channel] = (BaseStationData){.tracker = ctx->bsd[channel].tracker}; ctx->bsd[channel].mode = channel; ctx->activeLighthouses++; SV_INFO("Adding lighthouse ch %d (cnt: %d)", channel, ctx->activeLighthouses);
IPSEC: crypto overflow decrypting too many bytes.
@@ -234,7 +234,7 @@ esp_decrypt_inline (vlib_main_t * vm, op->key = sa0->crypto_key.data; op->iv = payload; op->src = op->dst = payload += cpd.iv_sz; - op->len = len; + op->len = len - cpd.iv_sz; op->user_data = b - bufs; }
show_mnemonic: line break in "Recovery words" title Without a newline, the words touch the cross/checkmarks left and right. The cancel screen after already has a line break in the title, so this makes it also consistent.
@@ -78,7 +78,7 @@ pub async fn process() -> Result<Response, Error> { let mnemonic_sentence = keystore::get_bip39_mnemonic()?; confirm::confirm(&confirm::Params { - title: "Recovery words", + title: "Recovery\nwords", body: "Please write down\nthe following words", accept_is_nextarrow: true, ..Default::default()
Change to minimize register clear in pop_callinfo.
@@ -282,14 +282,14 @@ void mrbc_pop_callinfo( struct VM *vm ) assert( vm->callinfo_tail ); // clear used register. - mrbc_value *reg1 = vm->cur_regs + 1; + mrbc_callinfo *callinfo = vm->callinfo_tail; + mrbc_value *reg1 = vm->cur_regs + callinfo->cur_irep->nregs - callinfo->reg_offset; mrbc_value *reg2 = vm->cur_regs + vm->cur_irep->nregs; - while( reg1 != reg2 ) { + while( reg1 < reg2 ) { mrbc_decref_empty( reg1++ ); } // copy callinfo to vm - mrbc_callinfo *callinfo = vm->callinfo_tail; vm->cur_irep = callinfo->cur_irep; vm->inst = callinfo->inst; vm->cur_regs = callinfo->cur_regs;
fix nsis version
@@ -14,8 +14,10 @@ install: - ps: New-Item ./winenv/bin -ItemType Directory # NSIS - ps: Invoke-WebRequest "https://svwh.dl.sourceforge.net/project/nsis/NSIS 3/3.04/nsis-3.04.zip" -UseBasicParsing -OutFile ./nsis.zip + - ps: Invoke-WebRequest "https://svwh.dl.sourceforge.net/project/nsis/NSIS 3/3.04/nsis-3.04-strlen_8192.zip" -UseBasicParsing -OutFile ./nsis-longstr.zip - ps: Expand-Archive ./nsis.zip -DestinationPath ./nsis - ps: Move-Item ./nsis/*/* ./nsis + - ps: Expand-Archive ./nsis-longstr.zip -DestinationPath ./nsis -Force # unzip - ps: Invoke-WebRequest "https://svwh.dl.sourceforge.net/project/gnuwin32/unzip/5.51-1/unzip-5.51-1-bin.zip" -UseBasicParsing -OutFile .\unzip.zip - ps: Expand-Archive ./unzip.zip -DestinationPath ./unzip
no recovery flow for partial update in the OS
@@ -1315,11 +1315,13 @@ ReadLabelStorageArea( // At first read the Index size only form the beginning of the LSA IndexSize = sizeof((*ppLsa)->Index); ReturnCode = FwGetPCDFromOffsetSmallPayload(pDimm, PCD_LSA_PARTITION_ID, Offset, IndexSize, &pRawData); + if (EFI_SUCCESS == ReturnCode) { // Read the IndexSize again plus 2 times siez of the Free Mask starting at the end of the previoues read Offset = IndexSize; IndexSize += 2 * LABELS_TO_FREE_BYTES(ROUNDUP(((LABEL_STORAGE_AREA *)pRawData)->Index[0].NumberOfLabels, NSINDEX_FREE_ALIGN)); ReturnCode = FwGetPCDFromOffsetSmallPayload(pDimm, PCD_LSA_PARTITION_ID, Offset, IndexSize, &pRawData); } + } else { ReturnCode = FwCmdGetPlatformConfigData(pDimm, PCD_LSA_PARTITION_ID, &pRawData); } @@ -1908,6 +1910,7 @@ CompareDpaInRange( } } +#ifndef OS_BUILD /** Recover a partially updated namespace label set Clear the updating bit and use the name from label in pos 0 @@ -2036,7 +2039,7 @@ Finish: NVDIMM_EXIT_I64(ReturnCode); return ReturnCode; } - +#endif // OS_BUILD /** Retrieve Namespaces information from provided LSA structure. @@ -2245,7 +2248,7 @@ RetrieveNamespacesFromLsa( NVDIMM_DBG("Unexpected TypeGuid for AppDirect NS"); continue; } - +#ifndef OS_BUILD // Iterate over DIMMs to check for partial update LIST_FOR_EACH(pNode, &gNvmDimmData->PMEMDev.Dimms) { pDimm = DIMM_FROM_NODE(pNode); @@ -2276,7 +2279,7 @@ RetrieveNamespacesFromLsa( } FREE_POOL_SAFE(pNamespaceLabel2); } - +#endif // OS_BUILD // Iterate over DIMMs to collect labels to assemble AppDirect NS LIST_FOR_EACH(pNode, &gNvmDimmData->PMEMDev.Dimms) { pDimm = DIMM_FROM_NODE(pNode);
files: default max file size is 8192
@@ -200,8 +200,8 @@ static bool files_getDirStatsAndRewind(honggfuzz_t * hfuzz) ATOMIC_SET(hfuzz->fileCnt, fileCnt); if (hfuzz->maxFileSz == 0U) { - if (maxSize < 128U) { - hfuzz->maxFileSz = 128U; + if (maxSize < 8192) { + hfuzz->maxFileSz = 8192; } else { hfuzz->maxFileSz = maxSize; }
dojo: set pd log level to 1 PD log level = 0 cannot pass FAFT, switch it to default 1. (CL:3386136) BRANCH=cherry TEST=none
#define CONFIG_LED_ONOFF_STATES_BAT_LOW 10 /* PD / USB-C / PPC */ -#define CONFIG_USB_PD_DEBUG_LEVEL 0 +#undef CONFIG_USB_PD_DEBUG_LEVEL /* default to 1, configurable in ec console */ /* Optional console commands */ #define CONFIG_CMD_FLASH
cmake: a single comment is enough see
include (LibAddMacros) -add_plugin (blockresolver # +add_plugin (blockresolver # cmake-format SOURCES blockresolver.h - blockresolver.c # - LINK_ELEKTRA elektra-invoke # - ADD_TEST # - INSTALL_TEST_DATA # + blockresolver.c + LINK_ELEKTRA elektra-invoke + ADD_TEST + INSTALL_TEST_DATA TEST_README)
Fix a bug of DCOPY_set_metadata() The level 0 directory is missed when copying the timestamps, ownership, permissions, etc. This causes wrong attr of top directory.
@@ -967,7 +967,7 @@ static void DCOPY_set_metadata(int levels, int minlevel, bayer_flist* lists) /* now set timestamps on files starting from deepest level */ int level; - for (level = levels-1; level > 0; level--) { + for (level = levels-1; level >= 0; level--) { /* get list at this level */ bayer_flist list = lists[level];
Ignore duplicate mouse events In SDL, a touch event may simulate an identical mouse event. Since we already handle touch event, ignore these duplicates.
@@ -389,6 +389,10 @@ input_manager_process_mouse_motion(struct input_manager *input_manager, // do not send motion events when no button is pressed return; } + if (event->which == SDL_TOUCH_MOUSEID) { + // simulated from touch events, so it's a duplicate + return; + } struct control_msg msg; if (convert_mouse_motion(event, input_manager->screen->frame_size, &msg)) { if (!controller_push_msg(input_manager->controller, &msg)) { @@ -419,6 +423,10 @@ void input_manager_process_mouse_button(struct input_manager *input_manager, const SDL_MouseButtonEvent *event, bool control) { + if (event->which == SDL_TOUCH_MOUSEID) { + // simulated from touch events, so it's a duplicate + return; + } if (event->type == SDL_MOUSEBUTTONDOWN) { if (control && event->button == SDL_BUTTON_RIGHT) { press_back_or_turn_screen_on(input_manager->controller);
Documentation: Added CMSIS-Zone to overview page.
@@ -46,6 +46,9 @@ The CMSIS components are: - <a href="../../DAP/html/index.html"><b>CMSIS-DAP</b></a>: Debug Access Port. Standardized firmware for a Debug Unit that connects to the CoreSight Debug Access Port. CMSIS-DAP is distributed as a separate package and is well suited for integration on evaluation boards. This component is provided as separate download. + - <a href="../../Zone/html/index.html"><b>CMSIS-Zone</b></a>: System resource definition and partitioning. Defines methods to describe system resources and to partition + these resources into multiple projects and execution areas. + \note Refer to \ref CM_Pack_Content for more information on the content of the Software Pack. \image html CMSISv4_small.png "CMSIS Structure"
Update ChaCha20-Poly1305 documentation Correctly describe the maximum IV length.
@@ -479,7 +479,9 @@ The following I<ctrl>s are supported for the ChaCha20-Poly1305 AEAD algorithm. Sets the nonce length. This call can only be made before specifying the nonce. If not called a default nonce length of 12 (i.e. 96 bits) is used. The maximum -nonce length is 16 (B<CHACHA_CTR_SIZE>, i.e. 128-bits). +nonce length is 12 bytes (i.e. 96-bits). If a nonce of less than 12 bytes is set +then the nonce is automatically padded with leading 0 bytes to make it 12 bytes +in length. =item EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, taglen, tag)
interrupts are set to ring3
@@ -76,7 +76,7 @@ static void idt_set_gate(idt_entry_t* entry, uint32_t base, uint16_t sel, idt_en entry->always0 = 0; //we must uncomment the OR below when we get to user mode //it sets the interrupt gate's privilege level to 3 - entry->flags = flags/* | 0x60*/; + entry->flags = flags | 0x60; } static void idt_map_all_gates(idt_entry_t* table) {
More realistic sim condition
@@ -26,17 +26,17 @@ STATIC_CONFIG_ITEM(Simulator_SHOW_GT_DEVICE, "simulator-show-gt", 'i', "0: No GT device, 1: Show GT device, 2: Only GT device", 1) STATIC_CONFIG_ITEM(Simulator_NOISE_SCALE, "simulator-noise-scale", 'f', "", 1.) STATIC_CONFIG_ITEM(Simulator_SENSOR_NOISE, "simulator-sensor-noise", 'f', "Variance of noise to apply to light sensors", - 1e-5) + 1e-4) STATIC_CONFIG_ITEM(Simulator_SENSOR_TIME_JITTER, "simulator-sensor-time-jitter", 'f', - "Variance of time jitter to apply to light sensors", 1e-3) + "Variance of time jitter to apply to light sensors", 1e-2) STATIC_CONFIG_ITEM(Simulator_GYRO_NOISE, "simulator-gyro-noise", 'f', "Variance of noise to apply to gyro", 1e-4) STATIC_CONFIG_ITEM(Simulator_ACC_NOISE, "simulator-acc-noise", 'f', "Variance of noise to apply to accelerometer", 5e-5) STATIC_CONFIG_ITEM(Simulator_GYRO_BIAS, "simulator-gyro-bias", 'f', "Scale of bias to apply to gyro", 1e-1) -STATIC_CONFIG_ITEM(Simulator_SENSOR_DROPRATE, "simulator-sensor-droprate", 'f', "Chance to drop a sensor reading", .1) +STATIC_CONFIG_ITEM(Simulator_SENSOR_DROPRATE, "simulator-sensor-droprate", 'f', "Chance to drop a sensor reading", .2) STATIC_CONFIG_ITEM(Simulator_INIT_TIME, "simulator-init-time", 'f', "Init time -- object wont move for this long", 2.) -STATIC_CONFIG_ITEM(Simulator_FCAL_NOISE, "simulator-fcal-noise", 'f', "Noise to apply to BSD fcal parameters", 0.) +STATIC_CONFIG_ITEM(Simulator_FCAL_NOISE, "simulator-fcal-noise", 'f', "Noise to apply to BSD fcal parameters", 1e-3) STATIC_CONFIG_ITEM(Simulator_LH_VERSION, "simulator-lh-gen", 'i', "Lighthouse generation", 1) typedef struct SurviveDriverSimulatorLHState {