message
stringlengths
6
474
diff
stringlengths
8
5.22k
[numerics] add test GFC3D NSN_AC
@@ -798,10 +798,12 @@ if(WITH_${COMPONENT}_TESTING) NEW_GFC_3D_TEST(GFC3D_Example0.dat SICONOS_GLOBAL_FRICTION_3D_VI_FPP 0 0 0 0 0) NEW_GFC_3D_TEST(GFC3D_Example0.dat SICONOS_GLOBAL_FRICTION_3D_ACLMFP) + NEW_GFC_3D_TEST(GFC3D_Example0.dat SICONOS_GLOBAL_FRICTION_3D_NSN_AC) NEW_GFC_3D_TEST(GFC3D_Example00.dat SICONOS_GLOBAL_FRICTION_3D_ACLMFP 1e-12 0) NEW_GFC_3D_TEST(GFC3D_Example00.dat SICONOS_GLOBAL_FRICTION_3D_NSGS) NEW_GFC_3D_TEST(GFC3D_Example00.dat SICONOS_GLOBAL_FRICTION_3D_VI_EG) + NEW_GFC_3D_TEST(GFC3D_Example00.dat SICONOS_GLOBAL_FRICTION_3D_NSN_AC ) @@ -821,6 +823,9 @@ if(WITH_${COMPONENT}_TESTING) INTERNAL_DPARAM 0 1e-10) NEW_GFC_3D_TEST(GFC3D_TwoRods1.dat SICONOS_GLOBAL_FRICTION_3D_NSGS) NEW_GFC_3D_TEST(GFC3D_TwoRods1.dat SICONOS_GLOBAL_FRICTION_3D_NSGS_WR) + NEW_GFC_3D_TEST(GFC3D_TwoRods1.dat SICONOS_GLOBAL_FRICTION_3D_NSN_AC 0 0 + 0 0 0 + WILL_FAIL) # Alart Curnier functions NEW_TEST(AlartCurnierFunctions_test fc3d_AlartCurnierFunctions_test.c)
esp_http_client: Include port in host field Closes:
@@ -513,11 +513,27 @@ static esp_err_t esp_http_client_prepare(esp_http_client_handle_t client) return ESP_OK; } +static char *_get_host_header(char *host, int port) +{ + int err = 0; + char *host_name; + if (port != DEFAULT_HTTP_PORT && port != DEFAULT_HTTPS_PORT) { + err = asprintf(&host_name, "%s:%d", host, port); + } else { + err = asprintf(&host_name, "%s", host); + } + if (err == -1) { + return NULL; + } + return host_name; +} + esp_http_client_handle_t esp_http_client_init(const esp_http_client_config_t *config) { esp_http_client_handle_t client; esp_transport_handle_t tcp; + char *host_name; bool _success; _success = ( @@ -595,22 +611,37 @@ esp_http_client_handle_t esp_http_client_init(const esp_http_client_config_t *co } if (config->host != NULL && config->path != NULL) { + host_name = _get_host_header(client->connection_info.host, client->connection_info.port); + if (host_name == NULL) { + ESP_LOGE(TAG, "Failed to allocate memory for host header"); + goto error; + } _success = ( (esp_http_client_set_header(client, "User-Agent", DEFAULT_HTTP_USER_AGENT) == ESP_OK) && - (esp_http_client_set_header(client, "Host", client->connection_info.host) == ESP_OK) + (esp_http_client_set_header(client, "Host", host_name) == ESP_OK) ); - + free(host_name); if (!_success) { ESP_LOGE(TAG, "Error while setting default configurations"); goto error; } } else if (config->url != NULL) { + if (esp_http_client_set_url(client, config->url) != ESP_OK) { + ESP_LOGE(TAG, "Failed to set URL"); + goto error; + } + host_name = _get_host_header(client->connection_info.host, client->connection_info.port); + if (host_name == NULL) { + ESP_LOGE(TAG, "Failed to allocate memory for host header"); + goto error; + } + _success = ( - (esp_http_client_set_url(client, config->url) == ESP_OK) && (esp_http_client_set_header(client, "User-Agent", DEFAULT_HTTP_USER_AGENT) == ESP_OK) && - (esp_http_client_set_header(client, "Host", client->connection_info.host) == ESP_OK) + (esp_http_client_set_header(client, "Host", host_name) == ESP_OK) ); + free(host_name); if (!_success) { ESP_LOGE(TAG, "Error while setting default configurations"); goto error;
Avoid free of uninitialized ptr If glfs_check_config() is called with a cfgstring that doesn't have '/' then it can lead to crash as ptr 'hosts' is not initialized to NULL. Fixing that in this commit.
@@ -436,7 +436,7 @@ static bool glfs_check_config(const char *cfgstring, char **reason) char *path; glfs_t *fs = NULL; glfs_fd_t *gfd = NULL; - gluster_server *hosts; /* gluster server defination */ + gluster_server *hosts = NULL; /* gluster server defination */ bool result = true; path = strchr(cfgstring, '/');
workflow/mnemonic: add password check
#include <ui/screen_stack.h> #include <util.h> #include <workflow/mnemonic.h> +#include <workflow/password.h> #include "workflow.h" @@ -162,10 +163,12 @@ static void _check_word(uint8_t selection) bool workflow_show_mnemonic_create(void) { - if (!workflow_get_interface_functions()->get_bip39_mnemonic(&_mnemonic)) { - screen_sprintf_debug(1000, "mnemonic create not possible"); + if (!password_check()) { return false; } + if (!workflow_get_interface_functions()->get_bip39_mnemonic(&_mnemonic)) { + Abort("mnemonic create not possible"); + } // This field must be set before we tokenize the _mnemonic, // because we use the length when we zero the memory after confirmation. _mnemonic_length = strlens(_mnemonic);
Hide sprites under window if camera moved
@@ -762,7 +762,12 @@ void SceneRenderActors_b() LOG("a Reposition Actor %u\n", i); screen_x = actors[i].pos.x + scx; screen_y = actors[i].pos.y + scy; + if (actors[i].enabled && (win_pos_y == MENU_CLOSED_Y || screen_y < win_pos_y + 16)) + { move_sprite_pair(sprite_index, screen_x, screen_y); + } else { + hide_sprite_pair(sprite_index); + } } } else
plugins: in_syslog: only release tcp connections when cleaning up
@@ -222,7 +222,9 @@ int syslog_conn_del(struct syslog_conn *conn) /* The downstream unregisters the file descriptor from the event-loop * so there's nothing to be done by the plugin */ + if (!ctx->dgram_mode_flag) { flb_downstream_conn_release(conn->connection); + } /* Release resources */ mk_list_del(&conn->_head);
wpa_supplicant: Fix wps_free_pins to remove all pins Current code does not correctly free all pins in wps_free_pins due to the semicolon at the end of dl_list_for_each_safe(). Fix it.
@@ -101,7 +101,7 @@ static void wps_remove_pin(struct wps_uuid_pin *pin) static void wps_free_pins(struct dl_list *pins) { struct wps_uuid_pin *pin, *prev; - dl_list_for_each_safe(pin, prev, pins, struct wps_uuid_pin, list); + dl_list_for_each_safe(pin, prev, pins, struct wps_uuid_pin, list) wps_remove_pin(pin); }
improve commit/decommit on Linux
@@ -889,8 +889,7 @@ static bool mi_os_commitx(void* addr, size_t size, bool commit, bool conservativ #if defined(_WIN32) if (commit) { - // if the memory was already committed, the call succeeds but it is not zero'd - // *is_zero = true; + // *is_zero = true; // note: if the memory was already committed, the call succeeds but the memory is not zero'd void* p = VirtualAlloc(start, csize, MEM_COMMIT, PAGE_READWRITE); err = (p == start ? 0 : GetLastError()); } @@ -900,23 +899,40 @@ static bool mi_os_commitx(void* addr, size_t size, bool commit, bool conservativ } #elif defined(__wasi__) // WebAssembly guests can't control memory protection - #elif defined(MAP_FIXED) - if (!commit) { - // use mmap with MAP_FIXED to discard the existing memory (and reduce commit charge) - void* p = mmap(start, csize, PROT_NONE, (MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE), -1, 0); - if (p != start) { err = errno; } + #elif 0 && defined(MAP_FIXED) && !defined(__APPLE__) + // Linux: disabled for now as mmap fixed seems much more expensive than MADV_DONTNEED (and splits VMA's?) + if (commit) { + // commit: just change the protection + err = mprotect(start, csize, (PROT_READ | PROT_WRITE)); + if (err != 0) { err = errno; } } else { - // for commit, just change the protection + // decommit: use mmap with MAP_FIXED to discard the existing memory (and reduce rss) + const int fd = mi_unix_mmap_fd(); + void* p = mmap(start, csize, PROT_NONE, (MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE), fd, 0); + if (p != start) { err = errno; } + } + #else + // Linux, macOSX and others. + if (commit) { + // commit: ensure we can access the area err = mprotect(start, csize, (PROT_READ | PROT_WRITE)); if (err != 0) { err = errno; } + } + else { + #if defined(MADV_DONTNEED) && MI_DEBUG == 0 && MI_SECURE == 0 + // decommit: use MADV_DONTNEED as it decreases rss immediately (unlike MADV_FREE) + // (on the other hand, MADV_FREE would be good enough.. it is just not reflected in the stats :-( ) + err = madvise(start, csize, MADV_DONTNEED); + #else + // decommit: just disable access (also used in debug and secure mode to trap on illegal access) + err = mprotect(start, csize, PROT_NONE); + if (err != 0) { err = errno; } + #endif //#if defined(MADV_FREE_REUSE) // while ((err = mi_madvise(start, csize, MADV_FREE_REUSE)) != 0 && errno == EAGAIN) { errno = 0; } //#endif } - #else - err = mprotect(start, csize, (commit ? (PROT_READ | PROT_WRITE) : PROT_NONE)); - if (err != 0) { err = errno; } #endif if (err != 0) { _mi_warning_message("%s error: start: %p, csize: 0x%zx, err: %i\n", commit ? "commit" : "decommit", start, csize, err);
fix way sha key is applied for new clones
@@ -215,10 +215,11 @@ AOMP_ROCR_COMPONENT_NAME=${AOMP_ROCR_COMPONENT_NAME:-rocr} AOMP_LIBDEVICE_REPO_NAME=${AOMP_LIBDEVICE_REPO_NAME:-rocm-device-libs} AOMP_LIBDEVICE_COMPONENT_NAME=${AOMP_LIBDEVICE_COMPONENT_NAME:-rocdl} if [ "$AOMP_MAJOR_VERSION" == "12" ] ; then -AOMP_LIBDEVICE_REPO_BRANCH=${AOMP_LIBDEVICE_REPO_BRANCH:-f16f5b1b90a21943306b87e160654b5738c8a884} -#AOMP_LIBDEVICE_REPO_BRANCH=${AOMP_LIBDEVICE_REPO_BRANCH:-amd-stg-open} + AOMP_LIBDEVICE_REPO_BRANCH=${AOMP_LIBDEVICE_REPO_BRANCH:-amd-stg-open} + AOMP_LIBDEVICE_REPO_SHA="f16f5b1b90a21943306b87e160654b5738c8a884" elif [ "$AOMP_MAJOR_VERSION" == "13" ] ; then -AOMP_LIBDEVICE_REPO_BRANCH=${AOMP_LIBDEVICE_REPO_BRANCH:-5c5f64ef02ebebcdb6ed81e1af076dcf37a9de8a} + AOMP_LIBDEVICE_REPO_BRANCH=${AOMP_LIBDEVICE_REPO_BRANCH:-amd-stg-open} + AOMP_LIBDEVICE_REPO_SHA="5c5f64ef02ebebcdb6ed81e1af076dcf37a9de8a" else AOMP_LIBDEVICE_REPO_BRANCH=${AOMP_LIBDEVICE_REPO_BRANCH:-rocm-3.10.x} fi
At the end of an interrupt handler allow the scheduler to run
@@ -85,6 +85,7 @@ void irq_receive(register_state_t* regs) { if (int_no != INT_VECTOR_IRQ12 && int_no != INT_VECTOR_IRQ1) { pic_signal_end_of_interrupt(int_no); } + if (tasking_is_active()) task_switch(); return ret; }
qt-gui: try to compile without libqt5svg5-dev
@@ -45,7 +45,6 @@ RUN apt-get update \ libpcre++-dev \ libpcre3-dev \ libpython3-dev \ - libqt5svg5-dev \ libssl-dev \ libsystemd-dev \ libuv1-dev \
FlexArray: Fix behaviour at zero-length after discard
@@ -55,7 +55,6 @@ InternalFlexArrayAddItem ( return NULL; } } else { - ASSERT (FlexArray->Count > 0); ASSERT (FlexArray->AllocatedCount > 0); ASSERT (FlexArray->Count <= FlexArray->AllocatedCount); ++(FlexArray->Count); @@ -194,6 +193,10 @@ OcFlexArrayFreeContainer ( } else { *Items = (*FlexArray)->Items; *Count = (*FlexArray)->Count; + if (*Count == 0 && *Items != NULL) { + FreePool (*Items); + *Items = NULL; + } FreePool (*FlexArray); *FlexArray = NULL; }
Fix typo Update params.h
/// - the plugin is responsible for updating its GUI /// /// V. Turning a knob via plugin's internal MIDI mapping -/// - the plugin sends a CLAP_EVENT_PARAM_SET output event, set should_record to false -/// - the plugin is responsible to update its GUI +/// - the plugin sends a CLAP_EVENT_PARAM_VALUE output event, set should_record to false +/// - the plugin is responsible for updating its GUI /// /// VI. Adding or removing parameters /// - if the plugin is activated call clap_host->restart()
Jenkinsfile: remove website backend build
@@ -1177,7 +1177,6 @@ def deployWebsite() { def buildWebsite() { def websiteTasks = [:] websiteTasks << buildImageStage(DOCKER_IMAGES.website_frontend) - websiteTasks << buildImageStage(DOCKER_IMAGES.website_backend) return websiteTasks }
Add Magic Value Setting to Force Failure/Assert
@@ -85,6 +85,19 @@ QuicStreamInitialize( } } +#if 1 // Special case code to force bugcheck or failure. Will be removed when no longer needed. + QUIC_FRE_ASSERT(Connection->Settings.StreamRecvBufferDefault != 0x80000000u); + if (Connection->Settings.StreamRecvBufferDefault == 0x40000000u) { + QuicTraceEvent( + StreamError, + "[strm][%p] ERROR, %s.", + Stream, + "Unsupported receive buffer size"); + Status = QUIC_STATUS_NOT_SUPPORTED; + goto Exit; + } +#endif + InitialRecvBufferLength = Connection->Settings.StreamRecvBufferDefault; if (InitialRecvBufferLength == QUIC_DEFAULT_STREAM_RECV_BUFFER_SIZE) { PreallocatedRecvBuffer = QuicPoolAlloc(&Worker->DefaultReceiveBufferPool);
allow to set channel on injection test
@@ -9560,7 +9560,8 @@ if(checkdriverflag == true) if(injectionflag == true) { - getscanlist(); + if(userscanliststring == NULL) getscanlist(); + else getscanlistchannel(userscanliststring); process_fd_injection(); globalclose(); return EXIT_SUCCESS;
Fix the long help parameter check in makewindows
@@ -50,7 +50,7 @@ int windowmaker_main(int argc, char* argv[]) { int parameterLength = (int)strlen(argv[i]); if((PARAMETER_CHECK("-h", 2, parameterLength)) || - (PARAMETER_CHECK("--help", 5, parameterLength))) { + (PARAMETER_CHECK("--help", 6, parameterLength))) { showHelp = true; } }
added doc target back
@@ -53,7 +53,7 @@ help: @echo " test to run all tests" @echo -all: deps-generator c python javascript java haskell +all: deps-generator c python javascript java haskell doc docs: verify-prereq-docs deps-generator pdf html c: deps-c gen-c test-c
opae-sdk: replace include file with array.h
#include "mock/opae_fixtures.h" #include "props.h" +#include <array> -#include<bits/stdc++.h> fpga_guid known_guid = {0xc5, 0x14, 0x92, 0x82, 0xe3, 0x4f, 0x11, 0xe6, 0x8e, 0x3a, 0x13, 0xcc, 0x9d, 0x38, 0xca, 0x28};
Fix matrix rotation decomposition when matrix has scale; Similar to mat4_getAngleAxis, quat_fromMat4 and mat4_getOrientation need to divide by the scale.
@@ -156,17 +156,21 @@ MAF quat quat_fromAngleAxis(quat q, float angle, float ax, float ay, float az) { } MAF quat quat_fromMat4(quat q, mat4 m) { - float a = 1.f + m[0] - m[5] - m[10]; - float b = 1.f - m[0] + m[5] - m[10]; - float c = 1.f - m[0] - m[5] + m[10]; - float d = 1.f + m[0] + m[5] + m[10]; + float sx = vec3_length(m + 0); + float sy = vec3_length(m + 4); + float sz = vec3_length(m + 8); + float diagonal[4] = { m[0] / sx, m[5] / sy, m[10] / sz }; + float a = 1.f + diagonal[0] - diagonal[1] - diagonal[2]; + float b = 1.f - diagonal[0] + diagonal[1] - diagonal[2]; + float c = 1.f - diagonal[0] - diagonal[1] + diagonal[2]; + float d = 1.f + diagonal[0] + diagonal[1] + diagonal[2]; float x = sqrtf(a > 0.f ? a : 0.f) / 2.f; float y = sqrtf(b > 0.f ? b : 0.f) / 2.f; float z = sqrtf(c > 0.f ? c : 0.f) / 2.f; float w = sqrtf(d > 0.f ? d : 0.f) / 2.f; - x = (m[9] - m[6]) > 0.f ? -x : x; - y = (m[2] - m[8]) > 0.f ? -y : y; - z = (m[4] - m[1]) > 0.f ? -z : z; + x = (m[9] / sz - m[6] / sy) > 0.f ? -x : x; + y = (m[2] / sx - m[8] / sz) > 0.f ? -y : y; + z = (m[4] / sy - m[1] / sx) > 0.f ? -z : z; return quat_set(q, x, y, z, w); }
Add support for RSA-PSS to X509_certificate_type()
@@ -35,6 +35,9 @@ int X509_certificate_type(const X509 *x, const EVP_PKEY *pkey) /* if (!sign only extension) */ ret |= EVP_PKT_ENC; break; + case EVP_PKEY_RSA_PSS: + ret = EVP_PK_RSA | EVP_PKT_SIGN; + break; case EVP_PKEY_DSA: ret = EVP_PK_DSA | EVP_PKT_SIGN; break;
refactor codeStateFromURI
#include <string.h> #include <syslog.h> -struct codeState codeStateFromURI(const char* uri) { +char* getBaseUri(const char* uri) { if (uri == NULL) { oidc_setArgNullFuncError(__func__); - return (struct codeState){}; + return NULL; } char* tmp = oidc_strcopy(uri); char* tmp_uri = strtok(tmp, "?"); - char* args = strtok(NULL, ""); - char* arg1 = strtok(args, "&"); - char* arg2 = strtok(NULL, ""); - char* tmp_state = NULL; - char* tmp_code = NULL; - if (strSubStringCase(arg1, "state")) { - strtok(arg1, "="); - tmp_state = strtok(NULL, ""); - } - if (strSubStringCase(arg2, "state")) { - strtok(arg2, "="); - tmp_state = strtok(NULL, ""); - } - if (strSubStringCase(arg1, "code")) { - strtok(arg1, "="); - tmp_code = strtok(NULL, ""); + char* base = oidc_strcopy(tmp_uri); + secFree(tmp); + return base; } - if (strSubStringCase(arg2, "code")) { - strtok(arg2, "="); - tmp_code = strtok(NULL, ""); + +struct codeState codeStateFromURI(const char* uri) { + if (uri == NULL) { + oidc_setArgNullFuncError(__func__); + return (struct codeState){}; } - char* state = oidc_strcopy(tmp_state); - char* code = oidc_strcopy(tmp_code); - char* base_uri = oidc_strcopy(tmp_uri); - secFree(tmp); + char* state = extractParameterValueFromUri(uri, "state"); + char* code = extractParameterValueFromUri(uri, "code"); + char* base_uri = getBaseUri(uri); if (base_uri == NULL) { oidc_errno = OIDC_ENOBASEURI; } else if (state == NULL) { @@ -88,8 +76,9 @@ char* extractParameterValueFromUri(const char* uri, const char* parameter) { char* param_v = strtok(NULL, "&"); char* value = NULL; while (value == NULL && param_k != NULL && param_v != NULL) { - syslog(LOG_AUTHPRIV | LOG_DEBUG, "URI contains parameter: %s - %s", param_k, - param_v); + // syslog(LOG_AUTHPRIV | LOG_DEBUG, "URI contains parameter: %s - %s", + // param_k, + // param_v); if (strequal(parameter, param_k)) { value = oidc_strcopy(param_v); break;
Improve detection of 32 bit versions of ModelSim.
@@ -168,13 +168,15 @@ MENT_COMMAND = $(shell command -v vsim) ## GCC version GCC_VERSION_GT_49 = $(shell gcc -dumpversion | gawk '{print $$1>=4.9?"1":"0"}') -## For ModelSim figure out whether it is the 32 bit starter edition +## For ModelSim figure out whether it is a 32 bit edition CC_INT_SIZE=-m64 ifeq ($(SIMULATOR), QUESTA) ifdef MENT_COMMAND - MENT_VERSION=$(shell vsim -version) - ifneq (,$(findstring STARTER EDITION, $(MENT_VERSION))) + # Assume 32 bit edition unless "vsim -version" indicates -64 CC_INT_SIZE=-m32 + MENT_VERSION=$(shell vsim -version) + ifneq (,$(findstring -64, $(MENT_VERSION))) + CC_INT_SIZE=-m64 endif endif endif
fix issue of mutex for send_new_block_thread
@@ -122,6 +122,8 @@ static void *xdag_send_new_block_thread(void *arg) while(1) { pthread_mutex_lock(&g_send_new_block_mutex); elem = list_new_blocks; + pthread_mutex_unlock(&g_send_new_block_mutex); + if(elem) { if(elem->block) { xdag_debug("xdag_send_new_block_thread send block begin"); @@ -130,7 +132,11 @@ static void *xdag_send_new_block_thread(void *arg) xdag_send_block_via_pool(elem->block); xdag_debug("xdag_send_new_block_thread send block done. delta ms: %lld", get_time_ms() - st); } + + pthread_mutex_lock(&g_send_new_block_mutex); LL_DELETE(list_new_blocks, elem); + pthread_mutex_unlock(&g_send_new_block_mutex); + free(elem); processed = 1; } @@ -139,7 +145,6 @@ static void *xdag_send_new_block_thread(void *arg) sleep(1); xdag_debug("xdag_send_new_block_thread idle loop"); } - pthread_mutex_unlock(&g_send_new_block_mutex); processed = 0; }
Python: Fix CMake warning for policy CMP0086
@@ -8,6 +8,10 @@ if (POLICY CMP0078) cmake_policy (SET CMP0078 OLD) endif (POLICY CMP0078) +if (POLICY CMP0086) + cmake_policy (SET CMP0086 NEW) +endif (POLICY CMP0086) + include (${SWIG_USE_FILE}) include (LibAddMacros)
{AH} fix collections.abc import
######################################################## import os import collections +try: + from collections.abc import Sequence, Mapping # noqa +except ImportError: + from collections import Sequence, Mapping # noqa import re import warnings import array @@ -99,11 +103,11 @@ IndexStats = collections.namedtuple("IndexStats", cdef int MAX_POS = (1 << 31) - 1 # valid types for SAM headers -VALID_HEADER_TYPES = {"HD" : collections.Mapping, - "SQ" : collections.Sequence, - "RG" : collections.Sequence, - "PG" : collections.Sequence, - "CO" : collections.Sequence} +VALID_HEADER_TYPES = {"HD" : Mapping, + "SQ" : Sequence, + "RG" : Sequence, + "PG" : Sequence, + "CO" : Sequence} # order of records within SAM headers VALID_HEADERS = ("HD", "SQ", "RG", "PG", "CO") @@ -293,7 +297,7 @@ cdef class AlignmentHeader(object): raise ValueError( "invalid type for record %s: %s, expected %s".format( record, type(data), VALID_HEADER_TYPES[record])) - if isinstance(data, collections.Mapping): + if isinstance(data, Mapping): lines.append(build_header_line(data, record)) else: for fields in header_dict[record]: @@ -303,7 +307,7 @@ cdef class AlignmentHeader(object): for record, data in sorted(header_dict.items()): if record in VALID_HEADERS: continue - if isinstance(data, collections.Mapping): + if isinstance(data, Mapping): lines.append(build_header_line(data, record)) else: for fields in header_dict[record]: @@ -455,13 +459,13 @@ cdef class AlignmentHeader(object): # interpret type of known header record tags, default to str x[key] = KNOWN_HEADER_FIELDS[record].get(key, str)(value) - if VALID_HEADER_TYPES[record] == collections.Mapping: + if VALID_HEADER_TYPES[record] == Mapping: if record in result: raise ValueError( "multiple '%s' lines are not permitted" % record) result[record] = x - elif VALID_HEADER_TYPES[record] == collections.Sequence: + elif VALID_HEADER_TYPES[record] == Sequence: if record not in result: result[record] = [] result[record].append(x) @@ -890,7 +894,7 @@ cdef class AlignmentFile(HTSFile): self.header = template.header.copy() elif isinstance(header, AlignmentHeader): self.header = header.copy() - elif isinstance(header, collections.Mapping): + elif isinstance(header, Mapping): self.header = AlignmentHeader.from_dict(header) elif reference_names and reference_lengths: self.header = AlignmentHeader.from_references( @@ -1605,7 +1609,6 @@ cdef class AlignmentFile(HTSFile): Or it can be a generator filtering such reads. Example samfile.find_introns((read for read in samfile.fetch(...) if read.is_reverse) """ - import collections res = collections.Counter() for r in read_iterator: if 'N' in r.cigarstring: @@ -1636,7 +1639,6 @@ cdef class AlignmentFile(HTSFile): AlignedSegment r int BAM_CREF_SKIP = 3 #BAM_CREF_SKIP - import collections res = collections.Counter() match_or_deletion = {0, 2, 7, 8} # only M/=/X (0/7/8) and D (2) are related to genome position
[CHANGELOG] Add Halide applications
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +### Added +- Add Halide runtime and build scripts for applications +- Add Halide example applications (2D convolution & matrix multiplication) + ## 0.4.0 - 2021-07-01 ### Added
ci: use inbuilt github concurrency feature
@@ -9,14 +9,11 @@ env: # Skip homebrew cleanup to avoid issues with removal of packages HOMEBREW_NO_INSTALL_CLEANUP: 1 +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - cancel: - name: auto-cancellation-running-action - runs-on: macos-11 - steps: - - uses: fauguste/auto-cancellation-running-action@0.1.4 - with: - githubToken: ${{ secrets.GITHUB_TOKEN }} build: # The CMake configure and build commands are platform agnostic and should work equally # well on Windows or Mac. You can convert this to a matrix build if you need
ARMv8: making coredata fields 64-bits wide
@@ -40,21 +40,21 @@ struct armv8_core_data { lpaddr_t multiboot2; ///< The physical multiboot2 location uint64_t multiboot2_size; lpaddr_t efi_mmap; - uint32_t module_start; ///< The start of the cpu module - uint32_t module_end; ///< The end of the cpu module - uint32_t urpc_frame_base; - uint8_t urpc_frame_bits; - uint32_t monitor_binary; - uint32_t monitor_binary_size; - uint32_t memory_base_start; - uint8_t memory_bits; + lpaddr_t module_start; ///< The start of the cpu module + lpaddr_t module_end; ///< The end of the cpu module + lpaddr_t urpc_frame_base; + size_t urpc_frame_size; + lpaddr_t monitor_binary; + size_t monitor_binary_size; + lpaddr_t memory_base_start; + size_t memory_size; coreid_t src_core_id; - uint8_t src_arch_id; + uint64_t src_arch_id; coreid_t dst_core_id; char kernel_cmdline[128]; - uint32_t initrd_start; - uint32_t initrd_size; + lpaddr_t initrd_start; + lpaddr_t initrd_size; uint64_t start_kernel_ram; ///< The physical start of allocated kernel memory @@ -69,4 +69,5 @@ struct armv8_core_data { #define ARMV8_CORE_DATA_PAGES 1100 + #endif
esp_lcd: add condition for spi to keep cs low
@@ -209,7 +209,9 @@ static esp_err_t panel_io_spi_tx_param(esp_lcd_panel_io_t *io, int lcd_cmd, cons memset(lcd_trans, 0, sizeof(lcd_spi_trans_descriptor_t)); lcd_trans->base.user = spi_panel_io; + if (param && param_size) { lcd_trans->base.flags |= SPI_TRANS_CS_KEEP_ACTIVE; + } if (spi_panel_io->flags.octal_mode) { // use 8 lines for transmitting command, address and data lcd_trans->base.flags |= (SPI_TRANS_MULTILINE_CMD | SPI_TRANS_MULTILINE_ADDR | SPI_TRANS_MODE_OCT);
MSR: Add `/tests` convention to ReadMe
@@ -42,6 +42,10 @@ the third command, which will fail with exit code `1`, since it tries to delete value the last command prints to the standard error output, since we specified the expected text `Did not find the key` via the special comment `# STDERR:`. +## Conventions + +- Only add tests that store data below `/tests` (See also [TESTING.md](/doc/TESTING.md)). + ## Add a Test If you want to add a Markdown Shell Recorder tests for the `README.md` of your plugin, you can simply pass
Fix a table of contents of maps
@@ -45,16 +45,18 @@ This guide is incomplete. If something feels missing, check the bcc and kernel s - [10. BPF_DEVMAP](#10-bpf_devmap) - [11. BPF_CPUMAP](#11-bpf_cpumap) - [12. BPF_XSKMAP](#12-bpf_xskmap) - - [13. map.lookup()](#13-maplookup) - - [14. map.lookup_or_try_init()](#14-maplookup_or_try_init) - - [15. map.delete()](#15-mapdelete) - - [16. map.update()](#16-mapupdate) - - [17. map.insert()](#17-mapinsert) - - [18. map.increment()](#18-mapincrement) - - [19. map.get_stackid()](#19-mapget_stackid) - - [20. map.perf_read()](#20-mapperf_read) - - [21. map.call()](#21-mapcall) - - [22. map.redirect_map()](#22-mapredirect_map) + - [13. BPF_ARRAY_OF_MAPS](#13-bpf_array_of_maps) + - [14. BPF_HASH_OF_MAPS](#14-bpf_hash_of_maps) + - [15. map.lookup()](#15-maplookup) + - [16. map.lookup_or_try_init()](#16-maplookup_or_try_init) + - [17. map.delete()](#17-mapdelete) + - [18. map.update()](#18-mapupdate) + - [19. map.insert()](#19-mapinsert) + - [20. map.increment()](#20-mapincrement) + - [21. map.get_stackid()](#21-mapget_stackid) + - [22. map.perf_read()](#22-mapperf_read) + - [23. map.call()](#23-mapcall) + - [24. map.redirect_map()](#24-mapredirect_map) - [Licensing](#licensing) - [bcc Python](#bcc-python)
Tests: added tests for translating $dollar into a literal $. If you need to specify a $ in a URI you can now use '$dollar' or '${dollar}'. Added some tests for the above to test_variables.py setting a Location string.
@@ -114,6 +114,27 @@ class TestVariables(TestApplicationProto): check_user_agent('', 404) check_user_agent('no', 404) + def test_variables_dollar(self): + assert 'success' in self.conf( + { + "listeners": {"*:7080": {"pass": "routes"}}, + "routes": [{"action": {"return": 301}}], + } + ) + + def check_dollar(location, expect): + assert 'success' in self.conf( + '"' + location + '"', + 'routes/0/action/location', + ) + assert self.get()['headers']['Location'] == expect + + check_dollar( + 'https://${host}${uri}path${dollar}dollar', + 'https://localhost/path$dollar', + ) + check_dollar('path$dollar${dollar}', 'path$$') + def test_variables_many(self): self.conf_routes("\"routes$uri$method\"") assert self.get(url='/5')['status'] == 206, 'many'
default toolset for linux/gmake is 'gcc'.
trigger = "gmake2", shortname = "Alternative GNU Make", description = "Generate GNU makefiles for POSIX, MinGW, and Cygwin", + toolset = "gcc", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Utility", "Makefile" },
vere: add -fcommon to be compatible with gcc 10 gcc 9 and earlier default to -fcommon, i.e. linker merges identical symbols. gcc 10 defaults to -fno-common, and the build breaks because c3_global is not defined anywhere.
@@ -93,7 +93,7 @@ do LDFLAGS="${LDFLAGS-} -I$header" done cat >config.mk <<EOF -CFLAGS := ${CFLAGS-} -funsigned-char -ffast-math -std=gnu99 +CFLAGS := ${CFLAGS-} -funsigned-char -ffast-math -fcommon -std=gnu99 LDFLAGS := $LDFLAGS CC := ${CC-cc} EOF
[STM32L4] Remove error clearing on flash driver This removes custom error clearing code. Calls to `erase` and `program` already do pretty good error checking and clearing on both beginning/end. This code was causing flash corruption when swap upgrades were performed with interruptions.
@@ -78,16 +78,7 @@ stm32l4_flash_write(const struct hal_flash *dev, uint32_t address, align = dev->hf_align; num_dwords = ((num_bytes - 1) / align) + 1; - /* clear previous errors */ - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_SR_ERRORS); - for (i = 0; i < num_dwords; i++) { - /* - * FIXME: need to check why PGSERR gets set in this loop - * no obvious reason so far... - */ - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_PGSERR); - if (num_bytes < 8) { memcpy(&val, &((uint8_t *)src)[i * align], num_bytes); memset((uint64_t *)&val + num_bytes, 0xff, align - num_bytes); @@ -127,11 +118,6 @@ stm32l4_flash_erase_sector(const struct hal_flash *dev, uint32_t sector_address) (void)PageError; if (!(sector_address & (_FLASH_SECTOR_SIZE - 1))) { - /* FIXME: why is an err flag set? */ - - /* Clear status of previous operation. */ - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_SR_ERRORS); - eraseinit.TypeErase = FLASH_TYPEERASE_PAGES; if ((sector_address - dev->hf_base_addr) < (_FLASH_SIZE / 2)) { eraseinit.Banks = FLASH_BANK_1;
sse2: MSVC doesn't include _mm_set{,1}_epi64x until 19
@@ -3458,7 +3458,7 @@ simde_mm_set_epi64 (simde__m64 e1, simde__m64 e0) { SIMDE__FUNCTION_ATTRIBUTES simde__m128i simde_mm_set_epi64x (int64_t e1, int64_t e0) { -#if defined(SIMDE_SSE2_NATIVE) +#if defined(SIMDE_SSE2_NATIVE) && (!defined(HEDLEY_MSVC_VERSION) || HEDLEY_MSVC_VERSION_CHECK(19,0,0)) return _mm_set_epi64x(e1, e0); #else simde__m128i_private r_; @@ -3676,7 +3676,7 @@ simde_mm_set1_epi32 (int32_t a) { SIMDE__FUNCTION_ATTRIBUTES simde__m128i simde_mm_set1_epi64x (int64_t a) { -#if defined(SIMDE_SSE2_NATIVE) +#if defined(SIMDE_SSE2_NATIVE) && (!defined(HEDLEY_MSVC_VERSION) || HEDLEY_MSVC_VERSION_CHECK(19,0,0)) return _mm_set1_epi64x(a); #else simde__m128i_private r_;
improved help menu: john use the same option as hashcat for PMKID
@@ -5123,7 +5123,7 @@ printf("%s %s (C) %s ZeroBeat\n" "options:\n" "-o <file> : output hccapx file (hashcat -m 2500/2501)\n" "-O <file> : output raw hccapx file (hashcat -m 2500/2501)\n" - "-z <file> : output PMKID file (hashcat hashmode -m 16800)\n" + "-z <file> : output PMKID file (hashcat hashmode -m 16800 and john)\n" "-j <file> : output john WPAPSK-PMK file (john wpapsk-opencl)\n" "-J <file> : output raw john WPAPSK-PMK file (john wpapsk-opencl)\n" "-E <file> : output wordlist (autohex enabled) to use as input wordlist for cracker\n"
make ivlen optional unless AEAD
@@ -477,7 +477,10 @@ ACVP_RESULT acvp_aes_kat_handler(ACVP_CTX *ctx, JSON_Object *obj) } } keylen = (unsigned int)json_object_get_number(groupobj, "keyLen"); + ivlen = keylen; + if (alg_id == ACVP_AES_GCM || alg_id == ACVP_AES_CCM) { ivlen = (unsigned int)json_object_get_number(groupobj, "ivLen"); + } ptlen = (unsigned int)json_object_get_number(groupobj, "ptLen"); aadlen = (unsigned int)json_object_get_number(groupobj, "aadLen"); taglen = (unsigned int)json_object_get_number(groupobj, "tagLen");
Simplify 'is_blacklisted' function
@@ -49,13 +49,6 @@ static bool check_blacklisted() { } bool& is_blacklisted() { - static bool checked = false; - static bool blacklisted = false; - - if (!checked) { - checked = true; - blacklisted = check_blacklisted(); - } - + static bool blacklisted = check_blacklisted(); return blacklisted; }
Also rename NProvides namespace. Note: mandatory check (NEED_CHECK) was skipped
@@ -4,7 +4,7 @@ import sys def main(): out, names = sys.argv[1], sys.argv[2:] with open(out, 'w') as f: - f.write('namespace NProvide {\n') + f.write('namespace NProvides {\n') for name in sorted(names): f.write(' bool {} = true;\n'.format(name)) f.write('}\n')
cmake: suggestion to add flags see
@@ -131,6 +131,7 @@ set (COMMON_FLAGS "${COMMON_FLAGS} -Wformat-security") set (COMMON_FLAGS "${COMMON_FLAGS} -Wshadow") set (COMMON_FLAGS "${COMMON_FLAGS} -Wcomments -Wtrigraphs -Wundef") set (COMMON_FLAGS "${COMMON_FLAGS} -Wuninitialized -Winit-self") +#set (COMMON_FLAGS "${COMMON_FLAGS} -Wmissing-declarations -Wmissing-prototypes") # not fixed in code # Not every compiler understands -Wmaybe-uninitialized check_c_compiler_flag(-Wmaybe-uninitialized HAS_CFLAG_MAYBE_UNINITIALIZED) @@ -152,7 +153,7 @@ set (CXX_EXTRA_FLAGS "${CXX_EXTRA_FLAGS} -Woverloaded-virtual -Wsign-promo") # # Merge all flags # -set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_STD} ${EXTRA_FLAGS} ${COMMON_FLAGS} -Wsign-compare -Wfloat-equal -Wformat-security") +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_STD} ${EXTRA_FLAGS} ${C_EXTRA_FLAGS} ${COMMON_FLAGS} -Wsign-compare -Wfloat-equal -Wformat-security") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STD} ${EXTRA_FLAGS} ${CXX_EXTRA_FLAGS} ${COMMON_FLAGS}") message (STATUS "C flags are ${CMAKE_C_FLAGS}")
Change definitions
@@ -51,9 +51,9 @@ typedef osSemaphoreId esp_sys_sem_t; typedef osMessageQId esp_sys_mbox_t; typedef osThreadId esp_sys_thread_t; typedef osPriority esp_sys_thread_prio_t; -#define ESP_SYS_MBOX_NULL (osMessageQId)0 -#define ESP_SYS_SEM_NULL (osSemaphoreId)0 -#define ESP_SYS_MUTEX_NULL (osMutexId)0 +#define ESP_SYS_MBOX_NULL (esp_sys_mbox_t)0 +#define ESP_SYS_SEM_NULL (esp_sys_sem_t)0 +#define ESP_SYS_MUTEX_NULL (esp_sys_mutex_t)0 #define ESP_SYS_TIMEOUT ((uint32_t)osWaitForever) #define ESP_SYS_THREAD_PRIO (osPriorityNormal) #define ESP_SYS_THREAD_SS (256)
Fixed issue where audience wasn't getting set on create/join.
?^ - (sh-note "has glyph {<u>}") =+ cha=(glyph (mug pan)) (sh-note:(set-glyph cha pan) "new glyph {<cha>}") + =. ..sh-work + sh-prod(active.she pan) =+ loc=shape:(~(got by tales) man) ::x change local mailbox config to include subscription to pan. %^ sh-tell %design man
Add combination_pairs helper function Wrapper function for itertools.combinations_with_replacement, with explicit cast due to imprecise typing with older versions of mypy.
@@ -73,6 +73,17 @@ def hex_to_int(val: str) -> int: def quote_str(val) -> str: return "\"{}\"".format(val) +def combination_pairs(values: List[T]) -> List[Tuple[T, T]]: + """Return all pair combinations from input values. + + The return value is cast, as older versions of mypy are unable to derive + the specific type returned by itertools.combinations_with_replacement. + """ + return typing.cast( + List[Tuple[T, T]], + list(itertools.combinations_with_replacement(values, 2)) + ) + class BignumTarget(test_generation.BaseTarget, metaclass=ABCMeta): #pylint: disable=abstract-method @@ -165,10 +176,7 @@ class BignumOperation(BignumTarget, metaclass=ABCMeta): Combinations are first generated from all input values, and then specific cases provided. """ - yield from typing.cast( - Iterator[Tuple[str, str]], - itertools.combinations_with_replacement(cls.input_values, 2) - ) + yield from combination_pairs(cls.input_values) yield from cls.input_cases @classmethod @@ -215,14 +223,11 @@ class BignumAdd(BignumOperation): symbol = "+" test_function = "mbedtls_mpi_add_mpi" test_name = "MPI add" - input_cases = typing.cast( - List[Tuple[str, str]], - list(itertools.combinations_with_replacement( + input_cases = combination_pairs( [ "1c67967269c6", "9cde3", "-1c67967269c6", "-9cde3", - ], 2 - )) + ] ) def result(self) -> str:
[numerics] improve tls variable definition
#define tlsvar thread_local #else - #if defined(__GNUC__) + #if defined(__GNUC__) || (defined(__ICC) && defined(__linux)) #define tlsvar __thread + #elif defined(__ICC) && defined(_WIN32) + #define tlsvar __declspec(thread) + #elif defined(SICONOS_ALLOW_GLOBAL) + #define tlsvar static #else #error "Don't know how to create a thread-local variable" #endif #if SICONOS_CXXVERSION >= 201103L #define tlsvar thread_local #else - #if defined(__GNUC__) + #if defined(__GNUC__) || (defined(__ICC) && defined(__linux)) #define tlsvar __thread - #elif defined(_MSC_VER) + #elif defined(_MSC_VER) || (defined(__ICC) && defined(_WIN32)) #define tlsvar __declspec(thread) + #elif defined(SICONOS_ALLOW_GLOBAL) + #define tlsvar static #else #error "Don't know how to create a thread-local variable" #endif
OpenSSL::ParseC: handle OSSL_CORE_MAKE_FUNC
@@ -282,6 +282,20 @@ EOF massager => sub { return "$1 $2"; }, }, + ##### + # Core stuff + + # OSSL_CORE_MAKE_FUNC is a macro to create the necessary data and inline + # function the libcrypto<->provider interface + { regexp => qr/OSSL_CORE_MAKE_FUNC<<<\((.*?),(.*?),(.*?)\)>>>/, + massager => sub { + return (<<"EOF"); +typedef $1 OSSL_FUNC_$2_fn$3; +static ossl_inline OSSL_FUNC_$2_fn *OSSL_FUNC_$2(const OSSL_DISPATCH *opf); +EOF + }, + }, + ##### # LHASH stuff
extmod/modiodevices: read data from mode
@@ -45,22 +45,24 @@ STATIC mp_obj_t iodevices_LUMPDevice_make_new(const mp_obj_type_t *type, size_t } // pybricks.iodevices.LUMPDevice.read -STATIC mp_obj_t iodevices_LUMPDevice_read(mp_obj_t self_in) { - iodevices_LUMPDevice_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t iodevices_LUMPDevice_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + PB_PARSE_ARGS_METHOD(n_args, pos_args, kw_args, + iodevices_LUMPDevice_obj_t, self, + PB_ARG_REQUIRED(mode) + ); + // Get data already in correct data format + uint8_t data[PBIO_IODEV_MAX_DATA_SIZE]; + mp_obj_t objs[PBIO_IODEV_MAX_DATA_SIZE]; + pbdevice_get_values(self->pbdev, mp_obj_get_int(mode), data); + + // Get info about the sensor and its mode pbio_port_t port; pbio_iodev_type_id_t id; - uint8_t mode; + uint8_t curr_mode; pbio_iodev_data_type_t data_type; uint8_t num_values; - - // Get info about the sensor and its mode - pbdevice_get_info(self->pbdev, &port, &id, &mode, &data_type, &num_values); - - // Get data already in correct data format - uint8_t data[PBIO_IODEV_MAX_DATA_SIZE]; - mp_obj_t objs[PBIO_IODEV_MAX_DATA_SIZE]; - pbdevice_get_values(self->pbdev, mode, data); + pbdevice_get_info(self->pbdev, &port, &id, &curr_mode, &data_type, &num_values); // Return as MicroPython objects for (uint8_t i = 0; i < num_values; i++) { @@ -87,7 +89,7 @@ STATIC mp_obj_t iodevices_LUMPDevice_read(mp_obj_t self_in) { return mp_obj_new_tuple(num_values, objs); } -MP_DEFINE_CONST_FUN_OBJ_1(iodevices_LUMPDevice_read_obj, iodevices_LUMPDevice_read); +MP_DEFINE_CONST_FUN_OBJ_KW(iodevices_LUMPDevice_read_obj, 0, iodevices_LUMPDevice_read); // dir(pybricks.iodevices.LUMPDevice) STATIC const mp_rom_map_elem_t iodevices_LUMPDevice_locals_dict_table[] = {
[bug][bsp][stm32][pandora] fix a bug that cannot use fatfs in the main thread at starting up
* Change Logs: * Date Author Notes * 2018-12-14 balanceTWK add sdcard port file + * 2021-02-26 Meco Man fix a bug that cannot use fatfs in the main thread at starting up */ #include <rtthread.h> @@ -46,6 +47,12 @@ int stm32_sdcard_mount(void) { rt_thread_t tid; + if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK) + { + LOG_I("sd card mount to '/'"); + } + else + { tid = rt_thread_create("sd_mount", sd_mount, RT_NULL, 1024, RT_THREAD_PRIORITY_MAX - 2, 20); if (tid != RT_NULL) @@ -56,6 +63,11 @@ int stm32_sdcard_mount(void) { LOG_E("create sd_mount thread err!"); } + } + + + + return RT_EOK; } INIT_APP_EXPORT(stm32_sdcard_mount);
server: Fix alignment issue in session ticket QUIC version
*/ #include "tls_server_context_openssl.h" +#include <cstring> #include <iostream> #include <fstream> #include <limits> @@ -220,12 +221,13 @@ SSL_TICKET_RETURN decrypt_ticket_cb(SSL *ssl, SSL_SESSION *session, return SSL_TICKET_RETURN_IGNORE_RENEW; } - uint32_t *pver; + uint8_t *pver; + uint32_t ver; size_t verlen; if (!SSL_SESSION_get0_ticket_appdata( session, reinterpret_cast<void **>(&pver), &verlen) || - verlen != sizeof(*pver)) { + verlen != sizeof(ver)) { switch (status) { case SSL_TICKET_SUCCESS: return SSL_TICKET_RETURN_IGNORE; @@ -235,10 +237,12 @@ SSL_TICKET_RETURN decrypt_ticket_cb(SSL *ssl, SSL_SESSION *session, } } + memcpy(&ver, pver, sizeof(ver)); + auto conn_ref = static_cast<ngtcp2_crypto_conn_ref *>(SSL_get_app_data(ssl)); auto h = static_cast<HandlerBase *>(conn_ref->user_data); - if (ngtcp2_conn_get_client_chosen_version(h->conn()) != ntohl(*pver)) { + if (ngtcp2_conn_get_client_chosen_version(h->conn()) != ntohl(ver)) { switch (status) { case SSL_TICKET_SUCCESS: return SSL_TICKET_RETURN_IGNORE;
removed copy and paste error
@@ -2324,8 +2324,6 @@ if(argc < 2) if(optind == argc) { printf("no input file(s) selected\n"); - if(fh_pmkideapolhc != NULL) fclose(fh_pmkideapolhc); - if(fh_pmkideapoljtr != NULL) fclose(fh_pmkideapoljtr); exit(EXIT_FAILURE); }
doc: fix maintainer full name
@@ -9,5 +9,5 @@ Fluent Bit is developed and supported by many individuals and companies. The fo | [Fujimoto Seiji](https://github.com/fujimotos) | Windows Platform | [Clear Code](http://clear-code.com/) | | [Wesley Pettit](https://github.com/PettitWesley) | Amazon Plugins (AWS) | [Amazon Web Services](https://aws.amazon.com/) | | [Cedric Lamoriniere](https://github.com/clamoriniere) | Datadog Output Plugin | [Datadog](https://www.datadoghq.com/) | -| [Jonathan Gonzalez](https://github.com/sxd) | PostgreSQL Output Plugin | [2ndQuadrant](https://www.2ndquadrant.com/en/) | +| [Jonathan Gonzalez V.](https://github.com/sxd) | PostgreSQL Output Plugin | [2ndQuadrant](https://www.2ndquadrant.com/en/) |
SO_NOSIGPIPE compilefix for netbsd
@@ -2369,13 +2369,13 @@ do_accept(neat_ctx *ctx, neat_flow *flow, struct neat_pollable_socket *listen_so neat_log(ctx, NEAT_LOG_DEBUG, "Call to setsockopt(SCTP_RECVNXTINFO) failed"); #endif // defined(SCTP_RECVNXTINFO) #endif -#if defined(SO_NOSIGPIPE) +#if defined(SO_NOSIGPIPE) && defined(IPPROTO_SCTP) optval = 1; rc = setsockopt(newFlow->socket->fd, IPPROTO_SCTP, SO_NOSIGPIPE, &optval, sizeof(optval)); if (rc < 0) { neat_log(ctx, NEAT_LOG_DEBUG, "Call to setsockopt(SO_NOSIGPIPE) failed"); } -#endif // defined(SO_NOSIGPIPE) +#endif // defined(SO_NOSIGPIPE) && defined(IPPROTO_SCTP) break; case NEAT_STACK_UDP: neat_log(ctx, NEAT_LOG_DEBUG, "Creating new UDP socket");
bugfix for osi_fixed_queue pointer type
@@ -154,7 +154,7 @@ void *fixed_queue_dequeue(fixed_queue_t *queue, uint32_t timeout) assert(queue != NULL); - if (osi_sem_take(queue->dequeue_sem, timeout) != 0) { + if (osi_sem_take(&queue->dequeue_sem, timeout) != 0) { return NULL; } @@ -208,14 +208,14 @@ void *fixed_queue_try_remove_from_queue(fixed_queue_t *queue, void *data) osi_mutex_lock(&queue->lock, OSI_MUTEX_MAX_TIMEOUT); if (list_contains(queue->list, data) && - osi_sem_take(queue->dequeue_sem, 0) == 0) { + osi_sem_take(&queue->dequeue_sem, 0) == 0) { removed = list_remove(queue->list, data); assert(removed); } osi_mutex_unlock(&queue->lock); if (removed) { - osi_sem_give(queue->enqueue_sem); + osi_sem_give(&queue->enqueue_sem); return data; }
interface: fix publish url preprocessing
@@ -19,7 +19,7 @@ export const isUrl = (str) => { const raceRegexes = (str) => { let link = str.match(URL_REGEX); - while(link?.[1]?.endsWith('(')) { + while(link?.[1]?.endsWith('(') || link?.[1].endsWith('[')) { const resumePos = link[1].length + link[2].length; const resume = str.slice(resumePos); link = resume.match(URL_REGEX);
Add ESP_SET_IP macro to set IPv4 IP addr
@@ -99,6 +99,13 @@ typedef struct { uint8_t ip[4]; /*!< IPv4 address */ } esp_ip_t; +/** + * \brief Set IP address to \ref esp_ip_t variable + * \param[in] ip: Pointer to IP structure + * \param[in] ip1,ip2,ip3,ip4: IPv4 parts + */ +#define ESP_SET_IP(ip_str, ip1, ip2, ip3, ip4) do { (ip_str)->ip[0] = (ip1); (ip_str)->ip[1] = (ip2); (ip_str)->ip[2] = (ip3); (ip_str)->ip[3] = (ip4); } while (0) + /** * \ingroup ESP_TYPEDEFS * \brief Port variable
stm32/modmachine: Add device and revision ids to machine.info().
@@ -155,6 +155,8 @@ STATIC mp_obj_t machine_info(size_t n_args, const mp_obj_t *args) { printf("ID=%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x\n", id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7], id[8], id[9], id[10], id[11]); } + printf("DEVID=0x%04x\nREVID=0x%04x\n", (unsigned int)HAL_GetDEVID(), (unsigned int)HAL_GetREVID()); + // get and print clock speeds // SYSCLK=168MHz, HCLK=168MHz, PCLK1=42MHz, PCLK2=84MHz {
distro-packages/python-Cython: fix fdupes
@@ -72,7 +72,7 @@ for p in cython cythonize cygdb ; do done %if 0%{?sles_version} || 0%{?suse_version} -%fdupes %{buildroot}%{$python_sitearch} +%fdupes %{buildroot}%{python3_sitearch} %{buildroot}%{_docdir} %endif }
lib/upytesthelper: Handle "wildcard lines" in .exp files, For some tests, if a line in .exp file contains ######## on its own, corresponding line is ignored in test output. Try to implement this feature, to make more tests runnable with qemu_arm/zephyr/etc.
@@ -66,6 +66,23 @@ bool upytest_is_failed(void) { // If mismatch happens, upytest_is_failed() returns true. void upytest_output(const char *str, mp_uint_t len) { if (!test_failed) { + #define WILDCARD_L "########\n" + while (strncmp(test_exp_output, WILDCARD_L, sizeof(WILDCARD_L) - 1) == 0) { + const char *p = memchr(str, '\n', len); + if (p == NULL) { + goto out; + } + p++; + mp_hal_stdout_tx_strn_cooked(str, p - str); + len -= p - str; + str = p; + test_exp_output += sizeof(WILDCARD_L) - 1; + test_rem_output_len -= sizeof(WILDCARD_L) - 1; + if (len == 0) { + return; + } + } + if (len > test_rem_output_len) { test_failed = true; } else { @@ -85,6 +102,7 @@ void upytest_output(const char *str, mp_uint_t len) { test_rem_output_len -= len; } } +out: mp_hal_stdout_tx_strn_cooked(str, len); }
[io] mechanics_run: fix typo on joints
@@ -1934,7 +1934,8 @@ class MechanicsHdf5Runner(siconos.io.mechanics_hdf5.MechanicsHdf5): options.minimumPointsPerturbationThreshold = 3*multipoints_iterations self._interman = interaction_manager(options) - if hasattr(self._interman, 'useEqualityConstraints') and len(self.joints())==0: + joints = list(self.joints()) + if hasattr(self._interman, 'useEqualityConstraints') and len(joints)==0: self._interman.useEqualityConstraints(False) # (0) NonSmooth Dynamical Systems definition @@ -1969,7 +1970,6 @@ class MechanicsHdf5Runner(siconos.io.mechanics_hdf5.MechanicsHdf5): # For the moment, the nslaw is implicitely added when we import_joint but is not stored # self._nslaws_data - joints=list(self.joints()) if len(joints) > 0: nslaw_type_list.append('EqualityConditionNSL')
improve build warning
@@ -165,7 +165,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags) { function (ok, outdata, errdata) -- show warnings? - if ok and errdata and #errdata > 0 and (option.get("diagnosis") or option.get("warning") or policy.build_warnings()) then + if ok and errdata and #errdata > 0 and policy.build_warnings() then local lines = errdata:split('\n', {plain = true}) if #lines > 0 then local warnings = table.concat(table.slice(lines, 1, (#lines > 8 and 8 or #lines)), "\n")
manage identification of module in the board running a detection
@@ -150,6 +150,8 @@ int wait_route_table(module_t* module, msg_t* intro_msg) { luos_send(module, intro_msg); uint32_t timestamp = HAL_GetTick(); while ((HAL_GetTick() - timestamp) < timeout) { + // If this request is for a module in this board allow him to respond. + luos_loop(); if (route_table[intro_msg->header.target].type != 0) { return 1; } @@ -167,21 +169,15 @@ void detect_modules(module_t* module) { // clear network detection state and all previous info. flush_route_table(); - // now add local module to the route_table - char hostString[25]; - sprintf(hostString, "%s", module->alias); - add_on_route_table (1, module->vm->type, hostString); - - // Next, starts the topology detection. + // Starts the topology detection. int nb_mod = topology_detection(module->vm); if (nb_mod > MAX_MODULES_NUMBER-1) nb_mod = MAX_MODULES_NUMBER-1; // Then, asks for introduction for every found modules. + for (int id = 1; id<nb_mod+1; id++) { intro_msg.header.cmd = IDENTIFY_CMD; intro_msg.header.target_mode = IDACK; intro_msg.header.size = 0; - - for (int id=2; id<nb_mod+1; id++) { intro_msg.header.target = id; // Ask to introduce and wait for a reply if (wait_route_table(module, &intro_msg)) {
pk: add generic defines for ECDSA capabilities The idea is to state what are ECDSA capabilities independently from how this is achieved
@@ -155,6 +155,28 @@ typedef struct mbedtls_pk_rsassa_pss_options { #endif #endif /* defined(MBEDTLS_USE_PSA_CRYPTO) */ +/** + * \brief The following defines are meant to list ECDSA capabilities of the + * PK module in a general way (without any reference to how this + * is achieved, which can be either through PSA driver or + * MBEDTLS_ECDSA_C) + */ +#if !defined(MBEDTLS_USE_PSA_CRYPTO) +#if defined(MBEDTLS_ECDSA_C) +#define MBEDTLS_PK_CAN_ECDSA_SIGN +#define MBEDTLS_PK_CAN_ECDSA_VERIFY +#endif +#else /* MBEDTLS_USE_PSA_CRYPTO */ +#if defined(PSA_WANT_ALG_ECDSA) +#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR) +#define MBEDTLS_PK_CAN_ECDSA_SIGN +#endif +#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) +#define MBEDTLS_PK_CAN_ECDSA_VERIFY +#endif +#endif /* PSA_WANT_ALG_ECDSA */ +#endif /* MBEDTLS_USE_PSA_CRYPTO */ + /** * \brief Types for interfacing with the debug module */
[numerics] fix memory leaks in NM_eye
@@ -2254,6 +2254,8 @@ NumericsMatrix* NM_eye(int size) { NumericsMatrix* M = NM_create(NM_SPARSE, size, size); /* version incremented in NSM_triplet_eye */ + NSM_clear(M->matrix2); + free(M->matrix2); M->matrix2 = NSM_triplet_eye(size); return M; } @@ -5329,6 +5331,9 @@ int NM_compute_balancing_matrices(NumericsMatrix* A, double tol, int itermax, Ba NumericsMatrix* D1_k = B->D1; NumericsMatrix* D2_k = B->D2; + double * D1_k_x= D1_k->matrix2->triplet->x; + double * D2_k_x= D2_k->matrix2->triplet->x; + unsigned int size0 = B->size0; unsigned int size1 = B->size1; @@ -5371,11 +5376,20 @@ int NM_compute_balancing_matrices(NumericsMatrix* A, double tol, int itermax, Ba } /* Update balancing matrix */ - NM_gemm(1.0, D1_k, D_R, 0.0, D1_tmp); - NM_copy(D1_tmp, D1_k); + /* NM_gemm(1.0, D1_k, D_R, 0.0, D1_tmp); */ + /* NM_copy(D1_tmp, D1_k); */ + + /* NM_gemm(1.0, D2_k, D_C, 0.0, D2_tmp); */ + /* NM_copy(D2_tmp, D2_k); */ - NM_gemm(1.0, D2_k, D_C, 0.0, D2_tmp); - NM_copy(D2_tmp, D2_k); + for(unsigned int i=0 ; i < size0; i++) + { + D1_k_x[i] = D1_k_x[i] * D_R_x[i]; + } + for(unsigned int i=0 ; i < size1; i++) + { + D2_k_x[i] = D2_k_x[i] * D_C_x[i]; + } /* NM_display(D1_k); */ /* DEBUG_PRINTF("D1_k ");NV_display(NM_triplet(D1_k)->x, size); */
utilities: using error-handling interface
/* - * Copyright (c) 2007 - 2015 Joseph Gaeddert + * Copyright (c) 2007 - 2020 Joseph Gaeddert * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,8 +36,8 @@ float liquid_rosenbrock(void * _userdata, unsigned int _n) { if (_n == 0) { - fprintf(stderr,"error: liquid_rosenbrock(), input vector length cannot be zero\n"); - exit(1); + liquid_error(LIQUID_EICONFIG,"liquid_rosenbrock(), input vector length cannot be zero"); + return 0.0f; } else if (_n == 1) { return (1.0f-_v[0])*(1.0f-_v[0]); } @@ -59,8 +59,8 @@ float liquid_invgauss(void * _userdata, unsigned int _n) { if (_n == 0) { - fprintf(stderr,"error: liquid_invgauss(), input vector length cannot be zero\n"); - exit(1); + liquid_error(LIQUID_EICONFIG,"liquid_invgauss(), input vector length cannot be zero"); + return 0.0f; } float t = 0.0f; @@ -85,8 +85,8 @@ float liquid_multimodal(void * _userdata, unsigned int _n) { if (_n == 0) { - fprintf(stderr,"error: liquid_multimodal(), input vector length cannot be zero\n"); - exit(1); + liquid_error(LIQUID_EICONFIG,"liquid_multimodal(), input vector length cannot be zero"); + return 0.0f; } float t0 = 1.0f; @@ -112,8 +112,8 @@ float liquid_spiral(void * _userdata, unsigned int _n) { if (_n == 0) { - fprintf(stderr,"error: liquid_rosenbrock(), input vector length cannot be zero\n"); - exit(1); + liquid_error(LIQUID_EICONFIG,"liquid_rosenbrock(), input vector length cannot be zero"); + return 0.0f; } else if (_n == 1) { return _v[0]*_v[0]; }
Allow specifying LogManagers as weak symbols on Apple This lets an consumer pull in the obj-c wrapper while also having their own LOGMANAGER_INSTANCE declaration
@@ -684,6 +684,9 @@ namespace ARIASDK_NS_BEGIN // #define DEFINE_LOGMANAGER(LogManagerClass, LogConfigurationClass) \ ILogManager* LogManagerClass::instance = nullptr; +#elif defined(__APPLE__) && defined(MAT_USE_WEAK_LOGMANAGER) +#define DEFINE_LOGMANAGER(LogManagerClass, LogConfigurationClass) \ + template<> __attribute__((weak)) ILogManager* LogManagerBase<LogConfigurationClass>::instance {}; #else // ISO C++ -compliant declaration #define DEFINE_LOGMANAGER(LogManagerClass, LogConfigurationClass) \
oauth2: fix to try ipv6 when getting upstream connection Add trial to establish upstream connection with FLB_IO_IPV6 mode, for the environment where the hostname is resolved to ipv6 primarily.
@@ -320,10 +320,15 @@ char *flb_oauth2_token_get(struct flb_oauth2 *ctx) /* Get Token and store it in the context */ u_conn = flb_upstream_conn_get(ctx->u); + if (!u_conn) { + ctx->u->flags |= FLB_IO_IPV6; + u_conn = flb_upstream_conn_get(ctx->u); if (!u_conn) { flb_error("[oauth2] could not get an upstream connection"); + ctx->u->flags &= ~FLB_IO_IPV6; return NULL; } + } /* Create HTTP client context */ c = flb_http_client(u_conn, FLB_HTTP_POST, ctx->uri,
publish: fetch notebook during navigation
@@ -41,7 +41,7 @@ export class Notebook extends Component { componentDidUpdate(prevProps) { const { props } = this; - if (prevProps && prevProps.api !== props.api) { + if ((prevProps && (prevProps.api !== props.api)) || props.api) { const notebook = props.notebooks?.[props.ship]?.[props.book]; if (!notebook?.subscribers) { props.api.fetchNotebook(props.ship, props.book); @@ -50,6 +50,7 @@ export class Notebook extends Component { } componentDidMount() { + this.componentDidUpdate(); const notebook = this.props.notebooks?.[this.props.ship]?.[this.props.book]; if (notebook?.notes) { this.onScroll();
Add a test for SSL_clear()
@@ -2649,6 +2649,60 @@ static int test_export_key_mat(int tst) return testresult; } +static int test_ssl_clear(int idx) +{ + SSL_CTX *cctx = NULL, *sctx = NULL; + SSL *clientssl = NULL, *serverssl = NULL; + int testresult = 0; + +#ifdef OPENSSL_NO_TLS1_2 + if (idx == 1) + return 1; +#endif + + /* Create an initial connection */ + if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), + TLS_client_method(), &sctx, + &cctx, cert, privkey)) + || (idx == 1 + && !TEST_true(SSL_CTX_set_max_proto_version(cctx, + TLS1_2_VERSION))) + || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, + &clientssl, NULL, NULL)) + || !TEST_true(create_ssl_connection(serverssl, clientssl, + SSL_ERROR_NONE))) + goto end; + + SSL_shutdown(clientssl); + SSL_shutdown(serverssl); + SSL_free(serverssl); + serverssl = NULL; + + /* Clear clientssl - we're going to reuse the object */ + if (!TEST_true(SSL_clear(clientssl))) + goto end; + + if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, + NULL, NULL)) + || !TEST_true(create_ssl_connection(serverssl, clientssl, + SSL_ERROR_NONE)) + || !TEST_true(SSL_session_reused(clientssl))) + goto end; + + SSL_shutdown(clientssl); + SSL_shutdown(serverssl); + + testresult = 1; + + end: + SSL_free(serverssl); + SSL_free(clientssl); + SSL_CTX_free(sctx); + SSL_CTX_free(cctx); + + return testresult; +} + int test_main(int argc, char *argv[]) { int testresult = 1; @@ -2704,6 +2758,7 @@ int test_main(int argc, char *argv[]) #endif ADD_ALL_TESTS(test_serverinfo, 8); ADD_ALL_TESTS(test_export_key_mat, 4); + ADD_ALL_TESTS(test_ssl_clear, 2); testresult = run_tests(argv[0]);
GRIB1: Nearest point incorrect for second order boustrophedonic
@@ -90,7 +90,7 @@ if(bitmapPresent) { } } else { if (boustrophedonicOrdering) { - + # See ECC-1402 meta numericValues data_g1second_order_general_extended_packing( #simple_packing args section4Length, @@ -126,8 +126,7 @@ if(bitmapPresent) { SPD, widthOfSPD, orderOfSPD, - numberOfPoints - ) : read_only; + numberOfPoints) : read_only; meta values data_apply_boustrophedonic(numericValues,numberOfRows,numberOfColumns,numberOfPoints,pl) : dump; alias data.codedValues = values; } else { @@ -166,9 +165,7 @@ if(bitmapPresent) { SPD, widthOfSPD, orderOfSPD, - numberOfPoints - - ) : dump; + numberOfPoints) : dump; alias codedValues=values; } alias data.packedValues = values;
HV: Fix compiler warnings in string.c fix below warnings when compiling lib/string.c: In function 'strtoul_hex': lib/string.c:25:26: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] .define ISSPACE(c) (((c) & 0xFFU == ' ') || ((c) & 0xFFU == '\t')) remove redundant MACROs in string.c
#include <hypervisor.h> -#ifndef ULONG_MAX #define ULONG_MAX ((uint64_t)(~0UL)) /* 0xFFFFFFFF */ -#endif - -#ifndef LONG_MAX #define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF */ -#endif - -#ifndef LONG_MIN #define LONG_MIN ((long)(~LONG_MAX)) /* 0x80000000 */ -#endif -#define ISSPACE(c) (((c) & 0xFFU == ' ') || ((c) & 0xFFU == '\t')) +#define ISSPACE(c) ((((c) & 0xFFU) == ' ') || (((c) & 0xFFU) == '\t')) /* * Convert a string to a long integer - decimal support only.
Remove 'show' functionality from muse. It was out of place *and* broken.
@@ -57,6 +57,7 @@ int main(int argc, char **argv) size_t i; FILE *f; + localincpath = "."; optinit(&ctx, "sd:hmo:p:I:l:", argv, argc); while (!optdone(&ctx)) { switch (optnext(&ctx)) { @@ -80,9 +81,6 @@ int main(int argc, char **argv) case 'l': lappend(&extralibs, &nextralibs, ctx.optarg); break; - case 's': - show = 1; - break; default: usage(argv[0]); exit(0); @@ -91,13 +89,14 @@ int main(int argc, char **argv) } lappend(&incpaths, &nincpaths, Instroot "/lib/myr"); - if (!outfile) { + if (!outfile && !show) { fprintf(stderr, "output file needed when merging usefiles.\n"); exit(1); } - localincpath = "."; - if (!pkgname) - pkgname = outfile; + if (!pkgname) { + fprintf(stderr, "package needed when merging usefiles.\n"); + exit(1); + } /* read and parse the file */ file = mkfile("internal"); @@ -112,9 +111,6 @@ int main(int argc, char **argv) /* generate the usefile */ f = fopen(outfile, "w"); - if (debugopt['s'] || show) - dumpstab(file->file.globls, stdout); - else writeuse(f, file); fclose(f); return 0;
Dockerfile: add user to plugdev group The plugdev group is mentioned on the Toolchain installation for Linux on the wiki so add the docker user to that group.
@@ -113,7 +113,7 @@ RUN pip3 -q install nrfutil && \ # Create user, add to groups dialout and sudo, and configure sudoers. RUN adduser --disabled-password --gecos '' user && \ - usermod -aG dialout,sudo user && \ + usermod -aG dialout,plugdev,sudo user && \ echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # Set user for what comes next
base64: undo ini/cache workaround
@@ -22,11 +22,6 @@ The values are decoded back to their original value after `kdb get` has read fro ## Usage -```sh -# Disable cache because of [ini bug](https://github.com/ElektraInitiative/libelektra/issues/2592) -kdb cache disable -``` - To mount a simple backend that uses the Base64 encoding, you can use: ```sh @@ -134,8 +129,3 @@ kdb umount user/tests/base64 ``` For another usage example, please take a look at the ReadMe of the [YAML CPP plugin](../yamlcpp). - -```sh -# Reset cache to default because of [ini bug](https://github.com/ElektraInitiative/libelektra/issues/2592) -kdb cache default -```
better jdk version detection
@@ -34,7 +34,6 @@ COLORING = { def colorize(err): for regex, sub in COLORING.iteritems(): err = re.sub(regex, sub, err, flags=re.MULTILINE) - return err @@ -42,17 +41,30 @@ def remove_notes(err): return '\n'.join([line for line in err.split('\n') if not line.startswith('Note:')]) +def find_javac(cmd): + if not cmd: + return None + if cmd[0].endswith('javac') or cmd[0].endswith('javac.exe'): + return cmd[0] + if len(cmd) > 2 and cmd[1].endswith('build_java_with_error_prone.py'): + for javas in ('java', 'javac'): + if cmd[2].endswith(javas) or cmd[2].endswith(javas + '.exe'): + return cmd[2] + return None + + # temporary, for jdk8/jdk9+ compatibility def fix_cmd(cmd): if not cmd: return cmd - javac = cmd[0] - if not javac.endswith('javac') and not javac.endswith('javac.exe'): + javac = find_javac(cmd) + if not javac: return cmd p = subprocess.Popen([javac, '-version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() out, err = out.strip(), err.strip() - if not ((out or '').startswith('javac 10') or (err or '').startswith('javac 10')): + for prefix in ('javac 1.8', 'java version "1.8'): + if (out or '').startswith(prefix) or (err or '').startswith(prefix): res = [] i = 0 while i < len(cmd):
hfuzz-cc: give option to use gcc >= 8 to use trace-cmp
@@ -69,6 +69,13 @@ static bool useHFNetDriver() { return false; } +static bool useGccGE8() { + if (getenv("HFUZZ_CC_USE_GCC_GE_8")) { + return true; + } + return false; +} + static bool isLDMode(int argc, char** argv) { for (int i = 1; i < argc; i++) { if (strcmp(argv[i], "--version") == 0) { @@ -232,8 +239,13 @@ static char* getLibHFNetDriverPath() { static void commonOpts(int* j, char** args) { args[(*j)++] = getIncPaths(); if (isGCC) { - /* That's the best gcc-6/7 currently offers */ + if (useGccGE8()) { + /* gcc-8 offers trace-cmp as well, but it's not that widely used yet */ + args[(*j)++] = "-fsanitize-coverage=trace-pc,trace-cmp"; + } else { + /* trace-pc is the best that gcc-6/7 currently offers */ args[(*j)++] = "-fsanitize-coverage=trace-pc"; + } } else { args[(*j)++] = "-Wno-unused-command-line-argument"; args[(*j)++] = "-fsanitize-coverage=trace-pc-guard,trace-cmp,indirect-calls";
Fixed potential integer overflow in VmaAllocator_T::AllocateMemoryOfType when maxMemoryAllocationCount Vulkan limit has high value Fixes
@@ -14475,7 +14475,8 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( // Protection against creating each allocation as dedicated when we reach or exceed heap size/budget, // which can quickly deplete maxMemoryAllocationCount: Don't prefer dedicated allocations when above // 3/4 of the maximum allocation count. - if(m_DeviceMemoryCount.load() > m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount * 3 / 4) + if(m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount < UINT32_MAX / 4 && + m_DeviceMemoryCount.load() > m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount * 3 / 4) { dedicatedPreferred = false; }
disable refhang.t due to flakiness test relies on jamming up network buffers, need better tooling.
use strict; use warnings; -use Test::More tests => 127; +use Test::More; use FindBin qw($Bin); use lib "$Bin/lib"; use MemcachedTest; +plan skip_all => 'Test is flaky. Needs special hooks.'; + +plan tests => 127; + # start up a server with 10 maximum connections my $server = new_memcached("-m 6"); my $sock = $server->sock;
Add README link to GitHub discussions
@@ -32,6 +32,7 @@ Find out more: Engage with the community: +* Discussions on GitHub: https://github.com/contiki-ng/contiki-ng/discussions * Contiki-NG tag on Stack Overflow: https://stackoverflow.com/questions/tagged/contiki-ng * Gitter: https://gitter.im/contiki-ng * Twitter: https://twitter.com/contiki_ng
Fix premature fopen() call in mbedtls_entropy_write_seed_file
@@ -466,28 +466,27 @@ int mbedtls_entropy_update_nv_seed( mbedtls_entropy_context *ctx ) #if defined(MBEDTLS_FS_IO) int mbedtls_entropy_write_seed_file( mbedtls_entropy_context *ctx, const char *path ) { - int ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR; - FILE *f; + int ret; + FILE *f = NULL; unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; - if( ( f = fopen( path, "wb" ) ) == NULL ) - return( MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR ); - if( ( ret = mbedtls_entropy_func( ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) ) != 0 ) goto exit; - if( fwrite( buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f ) != MBEDTLS_ENTROPY_BLOCK_SIZE ) - { ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR; + if( ( f = fopen( path, "wb" ) ) != NULL ) + { + if( fwrite( buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f ) != MBEDTLS_ENTROPY_BLOCK_SIZE ) goto exit; - } - ret = 0; + } exit: mbedtls_platform_zeroize( buf, sizeof( buf ) ); + if( f ) fclose( f ); + return( ret ); }
Fix missing APP_CAPABILITY process token groups, Fix missing container tab for msix installed applications
@@ -469,7 +469,7 @@ static NTSTATUS NTAPI PhpTokenGroupResolveWorker( ) { PPHP_TOKEN_GROUP_RESOLVE_CONTEXT context = ThreadParameter; - PPH_STRING fullUserName; + PPH_STRING sidString = NULL; INT lvItemIndex; lvItemIndex = PhFindListViewItemByParam( @@ -480,10 +480,27 @@ static NTSTATUS NTAPI PhpTokenGroupResolveWorker( if (lvItemIndex != -1) { - if (fullUserName = PhGetSidFullName(context->TokenGroupSid, TRUE, NULL)) + if (sidString = PhGetSidFullName(context->TokenGroupSid, TRUE, NULL)) { - PhSetListViewSubItem(context->ListViewHandle, lvItemIndex, PH_PROCESS_TOKEN_INDEX_NAME, PhGetString(fullUserName)); - PhDereferenceObject(fullUserName); + PhMoveReference(&sidString, PhReferenceObject(sidString)); + } + else if (sidString = PhGetAppContainerPackageName(context->TokenGroupSid)) + { + PhMoveReference(&sidString, PhConcatStringRefZ(&sidString->sr, L" (APP_PACKAGE)")); + } + else if (sidString = PhGetAppContainerName(context->TokenGroupSid)) + { + PhMoveReference(&sidString, PhConcatStringRefZ(&sidString->sr, L" (APP_CONTAINER)")); + } + else if (sidString = PhGetCapabilitySidName(context->TokenGroupSid)) + { + PhMoveReference(&sidString, PhConcatStringRefZ(&sidString->sr, L" (APP_CAPABILITY)")); + } + + if (sidString) + { + PhSetListViewSubItem(context->ListViewHandle, lvItemIndex, PH_PROCESS_TOKEN_INDEX_NAME, PhGetString(sidString)); + PhDereferenceObject(sidString); } else { @@ -1522,6 +1539,7 @@ INT_PTR CALLBACK PhpTokenPageProc( case IDC_ADVANCED: { HANDLE tokenHandle; + HANDLE processHandle; BOOLEAN tokenIsAppContainer = FALSE; if (NT_SUCCESS(tokenPageContext->OpenObject( @@ -1534,6 +1552,24 @@ INT_PTR CALLBACK PhpTokenPageProc( NtClose(tokenHandle); } + // Secondary check for desktop containers. (dmex) + if (!tokenIsAppContainer) + { + if (NT_SUCCESS(PhOpenProcess( + &processHandle, + PROCESS_QUERY_LIMITED_INFORMATION, + tokenPageContext->Context // ProcessId + ))) + { + PPH_STRING packageName = PhGetProcessPackageFullName(processHandle); + + tokenIsAppContainer = !PhIsNullOrEmptyString(packageName); + + PhClearReference(&packageName); + NtClose(processHandle); + } + } + PhpShowTokenAdvancedProperties(hwndDlg, tokenPageContext, tokenIsAppContainer); } break;
Windows compilation along with removing terminal colours on windows
@@ -14,8 +14,8 @@ struct TextAttr }; static size_t -log_fmt_parse(const size_t dst_size, char dst[dst_size], - const size_t src_size, const char src[src_size]) +log_fmt_parse(const size_t dst_size, char *dst, + const size_t src_size, const char *src) { size_t log_fmt_size = 0; @@ -31,6 +31,23 @@ log_fmt_parse(const size_t dst_size, char dst[dst_size], const size_t end = --src_i; +#ifdef _WIN32 + static const struct TextAttr attrs[] = { + { "reset", "" }, + { "bold", "" }, + { "dim", "" }, + { "italic", "" }, + { "underline", "" }, + { "black", "" }, + { "red", "" }, + { "green", "" }, + { "yellow", "" }, + { "blue", "" }, + { "magenta", "" }, + { "cyan", "" }, + { "white", "" } + }; +#else // _WIN32 static const struct TextAttr attrs[] = { { "reset", "\033[0m" }, { "bold", "\033[1m" }, @@ -46,6 +63,7 @@ log_fmt_parse(const size_t dst_size, char dst[dst_size], { "cyan", "\033[36m" }, { "white", "\033[37m" } }; +#endif // _WIN32 for (size_t i = 0; i < (sizeof(attrs) / sizeof(*(attrs))); i++) { @@ -111,14 +129,14 @@ vlog(const enum LogType type, const char *fmt, va_list args, const bool newline) static const struct TextAttr prefix[] = { [LOG_NONE] = { "", "" }, - [LOG_INFO] = { "info", "{white}%s:{reset} " }, - [LOG_NOTE] = { "note", "{dim}%s: " }, + [LOG_INFO] = { "Info", "{white}%s:{reset} " }, + [LOG_NOTE] = { "Note", "{dim}%s: " }, [LOG_PAD] = { "", "" }, [LOG_DEBUG] = { "DEBUG", "{bold}{white}%s:{reset} " }, - [LOG_SUCCESS] = { "success", "(bold}{green}%s:{reset} " }, - [LOG_WARNING] = { "warning", "{bold}{yellow}%s:{reset} " }, - [LOG_ERROR] = { "error", "{bold}{red}%s:{reset} " }, - [LOG_FATAL] = { "fatal error", "{bold}{red}%s:{reset} " }, + [LOG_SUCCESS] = { "Success", "(bold}{green}%s:{reset} " }, + [LOG_WARNING] = { "Warning", "{bold}{yellow}%s:{reset} " }, + [LOG_ERROR] = { "Error", "{bold}{red}%s:{reset} " }, + [LOG_FATAL] = { "Fatal Error", "{bold}{red}%s:{reset} " }, [LOG_BUG] = { "BUG", "{bold}{red}%s:{reset} " } };
update config patch for v3.2.0
---- nrpe-3.0.1/sample-config/nrpe.cfg.in 2016-09-08 09:18:58.000000000 -0700 -+++ nrpe-3.0.1.patch/sample-config/nrpe.cfg.in 2017-04-04 11:21:52.000000000 -0700 -@@ -257,8 +257,7 @@ +--- a/sample-config/nrpe.cfg.in 2017-06-27 14:13:20.000000000 -0700 ++++ b/sample-config/nrpe.cfg.in 2017-09-29 09:51:30.000000000 -0700 +@@ -282,8 +282,7 @@ # This directive allows you to include definitions from config files (with a # .cfg extension) in one or more directories (with recursion).
Fix bug preventing compilation
@@ -84,7 +84,7 @@ Faced with these challenges, the Dark Energy Science Collaboration (DESC), one o \begin{figure*} \centering \includegraphics[width=0.9\textwidth]{CCL_Flowchart4} -\caption{\ccl structure flowchart. \ccl is written in C with a Python interface. \ccl routines calculate basic cosmological functions such as the Hubble function, density parameters, distances and growth function. It uses various methods to compute the matter-power spectrum including {\tt CLASS}, ``Cosmic Emulator'' developed by \citet{Lawrence17}, or common approximations. It computes 2-point angular power spectra and correlation functions from various probes. \ccl is designed to accommodate multiple methods to calculate cosmological observables.}} +\caption{\ccl structure flowchart. \ccl is written in C with a Python interface. \ccl routines calculate basic cosmological functions such as the Hubble function, density parameters, distances and growth function. It uses various methods to compute the matter-power spectrum including {\tt CLASS}, ``Cosmic Emulator'' developed by \citet{Lawrence17}, or common approximations. It computes 2-point angular power spectra and correlation functions from various probes. \ccl is designed to accommodate multiple methods to calculate cosmological observables.} \label{fig:CCL_structure} \end{figure*} %------------------------
OHPC_macros: update arm compatibility package requirement
@@ -99,8 +99,8 @@ Requires: gcc-c++ intel-compilers-devel%{PROJ_DELIM} BuildRequires: arm_licenses BuildRequires: arm%{PROJ_DELIM} %endif # OHPC_BUILD -BuildRequires: arm-compilers-devel%{PROJ_DELIM} -Requires: arm-compilers-devel%{PROJ_DELIM} +BuildRequires: arm1-compilers-devel%{PROJ_DELIM} +Requires: arm1-compilers-devel%{PROJ_DELIM} %endif # arm %if "%{compiler_family}" == "llvm"
Build quasar backend with ya Allow boost for quasar backend Fix build Resolve simple conflicts Resolve simple conflicts Add untracked files
@@ -101,6 +101,8 @@ ALLOW quality/antifraud/common_lib -> contrib/libs/boost ALLOW quality/antifraud/common_lib -> contrib/deprecated/boost ALLOW quasar/yandex_io -> contrib/libs/boost ALLOW quasar/yandex_io -> contrib/deprecated/boost +ALLOW quasar/backend -> contrib/libs/boost +ALLOW quasar/backend -> contrib/deprecated/boost ALLOW regulargeo/research -> contrib/libs/boost ALLOW regulargeo/research -> contrib/deprecated/boost ALLOW rem/python/geobase30 -> contrib/libs/boost
Makefile: use -march=native by default in copts
@@ -29,7 +29,7 @@ HFUZZ_CC_SRCS := hfuzz_cc/hfuzz-cc.c COMMON_CFLAGS := -D_GNU_SOURCE -Wall -Werror -Wno-format-truncation -I. COMMON_LDFLAGS := -lm libhfcommon/libhfcommon.a COMMON_SRCS := $(sort $(wildcard *.c)) -CFLAGS ?= -O3 +CFLAGS ?= -O3 -march=native LDFLAGS ?= LIBS_CFLAGS ?= -fPIC -fno-stack-protector -fno-builtin -D__NO_STRING_INLINES -D__NO_INLINE__ HFUZZ_USE_RET_ADDR ?= false
enable stringio
@@ -267,7 +267,7 @@ void RhoRubyStart() #if !defined(OS_MACOSX) && !defined(OS_ANDROID) Init_Camera(); #endif - //Init_stringio(); //+ + Init_stringio(); //+ Init_DateTimePicker(); //#if !defined(WINDOWS_PLATFORM) && !defined(RHODES_EMULATOR) && !defined(OS_ANDROID) && !defined(OS_MACOSX) // Init_NativeBar();
opae.io: add N5010 and N5011 to ls
@@ -404,8 +404,9 @@ fpga_devices = {(0x8086, 0x09c4): "Intel PAC A10 GX", (0x8086, 0xaf00): "Intel N6000 ADP", (0x8086, 0xaf01): "Intel N6000 ADP VF", (0x8086, 0xbcce): "Intel N6000 ADP", - (0x8086, 0xbccf): "Intel N6000 ADP VF"} - + (0x8086, 0xbccf): "Intel N6000 ADP VF", + (0x1c2c, 0x1000): "Silicom SmartNIC N5010", + (0x1c2c, 0x1001): "Silicom SmartNIC N5011"} def read_attr(dirname, attr): fname = Path(dirname, attr)
increase the length of plugin memory But this shouldn't be systematic.
@@ -423,7 +423,7 @@ typedef struct st_picoquic_opaque_meta_t { #define PROTOOPPLUGINNAME_MAX 100 #define OPAQUE_ID_MAX 0x10 -#define PLUGIN_MEMORY (8 * 1024 * 1024) /* In bytes, at least needed by tests */ +#define PLUGIN_MEMORY (16 * 1024 * 1024) /* In bytes, at least needed by tests */ typedef struct memory_pool { uint64_t num_of_blocks;
meson v0.44.1
@@ -14,7 +14,7 @@ before_install: install: # pwd: ~/urbit - - pip3 install --user -I meson==0.46.1 + - pip3 install --user -I meson==0.44.1 - git clone https://github.com/urbit/arvo - cd ./arvo - git checkout $(cat ../.travis/pin-arvo-commit.txt)
Change function comments to doc style (\\), move to C99
#include "assert.h" -/* Sink statement (domain); depth: 0-indexed */ +/// Sink statement (domain); depth: 0-indexed. void pluto_sink_statement(Stmt *stmt, int depth, int val, PlutoProg *prog) { assert(stmt->dim == stmt->domain->ncols - prog->npar - 1); @@ -39,8 +39,8 @@ void pluto_sink_statement(Stmt *stmt, int depth, int val, PlutoProg *prog) { stmt->is_orig_loop[depth] = false; } -/* Stripmine 'dim'th time dimension of stmt by stripmine factor; use - * 'supernode' as the name of the supernode in the domain */ +/// Stripmine 'dim'th time dimension of stmt by stripmine factor; use +/// 'supernode' as the name of the supernode in the domain. void pluto_stripmine(Stmt *stmt, int dim, int factor, char *supernode, PlutoProg *prog) { pluto_stmt_add_dim(stmt, 0, dim, supernode, H_TILE_SPACE_LOOP, prog); @@ -63,7 +63,7 @@ void pluto_stripmine(Stmt *stmt, int dim, int factor, char *supernode, domain->val[domain->nrows - 1][stmt->trans->ncols] += factor; } -/* Interchange loops for a stmt */ +/// Interchange loops for a stmt. void pluto_stmt_loop_interchange(Stmt *stmt, int level1, int level2) { for (unsigned j = 0; j < stmt->trans->ncols; j++) { int64_t tmp = stmt->trans->val[level1][j]; @@ -73,17 +73,14 @@ void pluto_stmt_loop_interchange(Stmt *stmt, int level1, int level2) { } void pluto_interchange(PlutoProg *prog, int level1, int level2) { - int k; - HyperplaneProperties hTmp; - Stmt **stmts = prog->stmts; int nstmts = prog->nstmts; - for (k = 0; k < nstmts; k++) { + for (int k = 0; k < nstmts; k++) { pluto_stmt_loop_interchange(stmts[k], level1, level2); } - hTmp = prog->hProps[level1]; + HyperplaneProperties hTmp = prog->hProps[level1]; prog->hProps[level1] = prog->hProps[level2]; prog->hProps[level2] = hTmp; }
parse_unquoted: Check returned value from ossl_property_value()
@@ -213,11 +213,10 @@ static int parse_unquoted(OSSL_LIB_CTX *ctx, const char *t[], return 0; } v[i] = 0; - if (err) { + if (err) ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t); - } else { - res->v.str_val = ossl_property_value(ctx, v, create); - } + else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0) + err = 1; *t = skip_space(s); res->type = OSSL_PROPERTY_TYPE_STRING; return !err;
sp: parser: add default error for unhandled text
#include <stdio.h> #include <stdbool.h> #include <fluent-bit/flb_str.h> +#include <fluent-bit/flb_log.h> #include "sql_parser.h" static inline char *remove_dup_qoutes(const char *s, size_t n) @@ -116,4 +117,6 @@ RECORD_TIME return RECORD_TIME; \n [ \t]+ /* ignore whitespace */; +. flb_error("[sp] bad input character '%s' at line %d", yytext, yylineno); + %%
core: Avoid possible uninitialized pointer read (CID 209502) A likely copy and paste oversight. Fixes: (core: Add support for quiescing OPAL)
@@ -283,7 +283,7 @@ int64_t opal_quiesce(uint32_t quiesce_type, int32_t cpu_target) if (target) { while (target->in_opal_call) { if (tb_compare(mftb(), end) == TB_AAFTERB) { - printf("OPAL quiesce CPU:%04x stuck in OPAL\n", c->pir); + printf("OPAL quiesce CPU:%04x stuck in OPAL\n", target->pir); stuck = true; break; }
parser common UPDATE added stmt duplication
@@ -369,6 +369,14 @@ static LY_ERR lysp_stmt_grouping(struct lysp_ctx *ctx, const struct lysp_stmt *s static LY_ERR lysp_stmt_list(struct lysp_ctx *ctx, const struct lysp_stmt *stmt, struct lysp_node *parent, struct lysp_node **siblings); +/** + * @brief Validate stmt string value. + * + * @param[in] ctx Parser context. + * @param[in] val_type String value type. + * @param[in] val Value to validate. + * @return LY_ERR value. + */ static LY_ERR lysp_stmt_validate_value(struct lysp_ctx *ctx, enum yang_arg val_type, const char *val) { @@ -399,6 +407,45 @@ lysp_stmt_validate_value(struct lysp_ctx *ctx, enum yang_arg val_type, const cha return LY_SUCCESS; } +/** + * @brief Duplicate statement siblings, recursively. + * + * @param[in] ctx Parser context. + * @param[in] stmt Statement to duplicate. + * @param[out] first First duplicated statement, the rest follow. + * @return LY_ERR value. + */ +static LY_ERR +lysp_stmt_dup(struct lysp_ctx *ctx, const struct lysp_stmt *stmt, struct lysp_stmt **first) +{ + struct lysp_stmt *child, *last = NULL; + + LY_LIST_FOR(stmt, stmt) { + child = calloc(1, sizeof *child); + LY_CHECK_ERR_RET(!child, LOGMEM(PARSER_CTX(ctx)), LY_EMEM); + + if (last) { + last->next = child; + } else { + assert(!*first); + *first = child; + } + last = child; + + LY_CHECK_RET(lydict_insert(PARSER_CTX(ctx), stmt->stmt, 0, &child->stmt)); + LY_CHECK_RET(lydict_insert(PARSER_CTX(ctx), stmt->arg, 0, &child->arg)); + child->format = stmt->format; + LY_CHECK_RET(ly_dup_prefix_data(PARSER_CTX(ctx), stmt->format, stmt->prefix_data, &child->prefix_data)); + child->flags = stmt->flags; + child->kw = stmt->kw; + + /* recursively */ + LY_CHECK_RET(lysp_stmt_dup(ctx, stmt->child, &child->child)); + } + + return LY_SUCCESS; +} + /** * @brief Parse extension instance. * @@ -422,7 +469,7 @@ lysp_stmt_ext(struct lysp_ctx *ctx, const struct lysp_stmt *stmt, enum ly_stmt i e->parent_stmt = insubstmt; e->parent_stmt_index = insubstmt_index; e->parsed = NULL; - /* TODO (duplicate) e->child = stmt->child; */ + LY_CHECK_RET(lysp_stmt_dup(ctx, stmt->child, &e->child)); /* get optional argument */ if (stmt->arg) {
Check Bashisms: Ignore `reformat-java`
@@ -14,7 +14,7 @@ cd "@CMAKE_SOURCE_DIR@" # Use (non-emacs) extended regex for GNU find or BSD find find -version > /dev/null 2>&1 > /dev/null && FIND='find scripts -regextype egrep' || FIND='find -E scripts' -# - The scripts `reformat-c` and `install-config-file` use `command -v`, +# - The scripts `reformat-c`, `reformat-java` and `install-config-file` use `command -v`, # which was optional in POSIX until issue 7. Since `which` is not part of POSIX # at all `command -v` is probably the most portable solution to detect the # location of a command. @@ -28,6 +28,7 @@ set $( -path '*kdb-zsh-noglob' -or \ -path '*install-config-file' -or \ -path '*reformat-c' -or \ + -path '*reformat-java' -or \ -path '*run_env' -or \ -path '*sed' -or \ -path '*update-infos-status' -or \
support spread lexeme
@@ -388,7 +388,13 @@ Token scanToken(Scanner *scanner) { case ',': return makeToken(scanner, TOKEN_COMMA); case '.': + if (match(scanner, '.')) { + if (match(scanner, '.')) { + return makeToken(scanner, TOKEN_DOT_DOT_DOT); + } + } else { return makeToken(scanner, TOKEN_DOT); + } case '/': { if (match(scanner, '=')) { return makeToken(scanner, TOKEN_DIVIDE_EQUALS);
sysrepo BUGFIX no need for write lock ... until the data are actually being stored.
@@ -397,8 +397,8 @@ sr_discard_oper_changes(sr_conn_ctx_t *conn, sr_session_ctx_t *session, const ch } /* add modules, lock, and get data */ - if ((err_info = sr_modinfo_add_modules(&mod_info, &mod_set, 0, SR_LOCK_WRITE, SR_MI_PERM_WRITE, 0, NULL, NULL, NULL, - 0, 0))) { + if ((err_info = sr_modinfo_add_modules(&mod_info, &mod_set, 0, SR_LOCK_READ, + SR_MI_LOCK_UPGRADEABLE | SR_MI_PERM_WRITE, 0, NULL, NULL, NULL, 0, 0))) { goto cleanup; }
options/ansi: Return SIG_ERR instead of panic when sys_sigaction fails in signal() This is in line with the POSIX spec. Programs such as zsh may pass an invalid signal number and crash on EINVAL.
@@ -17,8 +17,10 @@ __sighandler signal(int sn, __sighandler handler) { sa.sa_flags = 0; sa.sa_mask = 0; struct sigaction old; - if(mlibc::sys_sigaction(sn, &sa, &old)) - mlibc::panicLogger() << "\e[31mmlibc: sys_sigaction() failed\e[39m" << frg::endlog; + if(int e = mlibc::sys_sigaction(sn, &sa, &old)){ + errno = e; + return SIG_ERR; + } return old.sa_handler; }