message
stringlengths
6
474
diff
stringlengths
8
5.22k
Add --ps-query sub-command to testpappl to test backchannel handling.
@@ -81,6 +81,7 @@ typedef struct _pappl_testprinter_s // Printer test data static http_t *connect_to_printer(pappl_system_t *system, char *uri, size_t urisize); static void device_error_cb(const char *message, void *err_data); static bool device_list_cb(const char *device_info, const char *device_uri, const char *device_id, void *data); +static int do_ps_query(const char *device_uri); static const char *make_raster_file(ipp_t *response, bool grayscale, char *tempname, size_t tempsize); static void *run_tests(_pappl_testdata_t *testdata); static bool test_api(pappl_system_t *system); @@ -180,6 +181,19 @@ main(int argc, // I - Number of command-line arguments { soptions |= PAPPL_SOPTIONS_NO_TLS; } + else if (!strcmp(argv[i], "--ps-query")) + { + i ++; + if (i < argc) + { + return (do_ps_query(argv[i])); + } + else + { + puts("testpappl: Missing device URI after '--ps-query'."); + return (usage(1)); + } + } else if (!strcmp(argv[i], "--version")) { puts(PAPPL_VERSION); @@ -489,6 +503,39 @@ device_list_cb(const char *device_info, // I - Device description } +// +// 'do_ps_query()' - Try doing a simple PostScript device query. +// + +static int // O - Exit status +do_ps_query(const char *device_uri) // I - Device URI +{ + pappl_device_t *device; // Connection to device + char buffer[8192]; // Read buffer + ssize_t bytes; // Bytes read + + + if ((device = papplDeviceOpen(device_uri, "ps-query", device_error_cb, NULL)) == NULL) + return (1); + + papplDevicePuts(device, "\033%-12345X%!\nproduct print\n"); + papplDeviceFlush(device); + + if ((bytes = papplDeviceRead(device, buffer, sizeof(buffer) - 1)) > 0) + { + buffer[bytes] = '\0'; + puts(buffer); + } + else + { + puts("<<no response>>"); + } + + papplDeviceClose(device); + return (0); +} + + // // 'make_raster_file()' - Create a temporary PWG raster file. //
Orion: update motelist string Updates the expected motelist string
@@ -60,7 +60,7 @@ if( $Opt{board} eq "z1" ) { } elsif( $Opt{board} eq "firefly" ) { $Opt{board} = "Zolertia Firefly platform"; } elsif( $Opt{board} eq "orion" ) { - $Opt{board} = "Zolertia Orion Router"; + $Opt{board} = "Zolertia Orion Ethernet router"; } my @devs = $Opt{method} eq "procfs" ? scan_procfs() : scan_sysfs();
update description of monotonic datasets Note: mandatory check (NEED_CHECK) was skipped
@@ -158,7 +158,7 @@ def epsilon(): def monotonic1(): """ - Yandex internal dataset with monotonic constraints. + Dataset with monotonic constraints. Can be used for poisson regression. Has several numerical and several categorical features. The first column contains target values. Columns with names Cat* contain categorical features. @@ -178,7 +178,7 @@ def monotonic1(): def monotonic2(): """ - Yandex internal dataset with monotonic constraints. + Dataset with monotonic constraints. Can be used for regression. The first column contains target values. Other columns contain contain numerical features, for which monotonic constraints must hold.
BugID:16880707:[build-rules] clean *.gcda when make distclean
@@ -178,7 +178,7 @@ distclean: rm -rf \ $(CONFIG_TPL) $(COMPILE_LOG) \ $(STAMP_PRJ_CFG) $(STAMP_BLD_ENV) $(STAMP_BLD_VAR) $(STAMP_POST_RULE) $(STAMP_LCOV) \ - $(DIST_DIR) $(STAMP_DIR) \ + $(DIST_DIR) $(STAMP_DIR) *.gcda \ $(TOP_Q) \ if [ -d $(OUTPUT_DIR) ]; then \
Make python script idempotent.
@@ -74,24 +74,33 @@ for struct_file in struct_files: pp = pprint.PrettyPrinter(indent=4) pp.pprint(files_to_visit) +mbedtls_private_access_include = "#include \"mbedtls/private_access.h\"" + for file_path, variables in files_to_visit.items(): + # check if this file has "mbedtls/private_access.h" include + file_has_private_access_include = False + with open(file_path, 'r') as file: + for line in file: + if mbedtls_private_access_include in line: + file_has_private_access_include = True + break + # FileInput redirects stdout to to 'file', so every print in this block will be put inside 'file' with fileinput.FileInput(file_path, inplace=True) as file: output_line_number = 1 # compile regex matching the header's include guard. re_include_guard = re.compile(r"^#define.*{name}$".format(name=os.path.basename(file_path).replace('.','_').upper())) for line in file: - insert_allow_private_include = False + insert_private_access_include = False if re_include_guard.match(line): - insert_allow_private_include = True + insert_private_access_include = not file_has_private_access_include # every line in file is checked against variables and lines in which they occur for variable, var_lines in variables.items(): for var_line in var_lines: # wrap variable with MBEDTLS_PRIVATE(...) macro if output_line_number == var_line: - line = re.sub(r"(^.*?\W+)({var})(\W+.*$)".format(var=variable), r"\1MBEDTLS_PRIVATE(\2)\3", line) + line = re.sub(r"(^.*?\W+)((?!MBEDTLS_PRIVATE\(){var})(\W+.*$)".format(var=variable), r"\1MBEDTLS_PRIVATE(\2)\3", line) output_line_number += 1 print(line, end='') # fileinput redirects stdout to the target file - if insert_allow_private_include: - insert_allow_private_include = False + if insert_private_access_include: print("#include \"mbedtls/private_access.h\"")
ocvalidate: Add checks for PlayChime
@@ -152,12 +152,14 @@ CheckUEFIAudio ( OC_UEFI_CONFIG *UserUefi; BOOLEAN IsAudioSupportEnabled; CONST CHAR8 *AsciiAudioDevicePath; + CONST CHAR8 *AsciiPlayChime; ErrorCount = 0; UserUefi = &Config->Uefi; IsAudioSupportEnabled = UserUefi->Audio.AudioSupport; AsciiAudioDevicePath = OC_BLOB_GET (&UserUefi->Audio.AudioDevice); + AsciiPlayChime = OC_BLOB_GET (&UserUefi->Audio.PlayChime); if (IsAudioSupportEnabled) { if (AsciiAudioDevicePath[0] == '\0') { DEBUG ((DEBUG_WARN, "UEFI->Audio->AudioDevicePath cannot be empty when AudioSupport is enabled!\n")); @@ -166,6 +168,16 @@ CheckUEFIAudio ( DEBUG ((DEBUG_WARN, "UEFI->Audio->AudioDevice is borked! Please check the information above!\n")); ++ErrorCount; } + + if (AsciiPlayChime[0] == '\0') { + DEBUG ((DEBUG_WARN, "UEFI->Audio->PlayChime cannot be empty when AudioSupport is enabled!\n")); + ++ErrorCount; + } else if (AsciiStrCmp (AsciiPlayChime, "Auto") != 0 + && AsciiStrCmp (AsciiPlayChime, "Enabled") != 0 + && AsciiStrCmp (AsciiPlayChime, "Disabled") != 0) { + DEBUG ((DEBUG_WARN, "UEFI->Audio->PlayChime is borked (Can only be Auto, Enabled, or Disabled)!\n")); + ++ErrorCount; + } } return ErrorCount;
wireless: gs2200m: Change usrsock xid from uint64_t to uint32_t Fix the type to match usrsock.h has been changed.
@@ -244,7 +244,7 @@ static int _write_to_usock(int fd, void *buf, size_t count) static int _send_ack_common(int fd, uint16_t events, - uint64_t xid, + uint32_t xid, FAR struct usrsock_message_req_ack_s *resp) { resp->head.msgid = USRSOCK_MESSAGE_RESPONSE_ACK;
line() tiny fix
@@ -597,6 +597,8 @@ static void drawLine(tic_mem* tic, float x0, float y0, float x1, float y1, u8 co else for (float t = initLine(&y0, &y1, &x0, &x1); x0 < x1; x0++, y0 += t) setPixel((tic_core*)tic, x0, y0, color); + + setPixel((tic_core*)tic, x1, y1, color); } typedef struct
fix typo in python imports
@@ -28,7 +28,7 @@ this_dir = os.path.realpath(os.path.dirname(__file__)) sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir))) from geodata.coordinates.conversion import latlon_to_decimal -from goedata.countries.constants import Countries +from geodata.countries.constants import Countries from geodata.encoding import safe_decode from geodata.file_utils import ensure_dir, download_file from geodata.i18n.unicode_properties import get_chars_by_script
Updated CHANGELOG.md for Release v1.5.0
@@ -93,17 +93,21 @@ Release date: 2018-02-16 Major changes and added features: -* STM32F72xx73xx support ([#1969148](https://github.com/texane/stlink/commit/19691485359afef1a256964afcbb8dcf4b733209)) * Added support of STM32L496xx/4A6xx devices ([#615](https://github.com/texane/stlink/pull/615)) +* Added unknown chip dummy to obtain the serial of the ST-link by a call to st-info --probe ([#641](https://github.com/texane/stlink/pull/641)) +* Added support for STM32F72xx (chip id: 0x452) devices (commit [#1969148](https://github.com/texane/stlink/commit/19691485359afef1a256964afcbb8dcf4b733209)) -Fixes: +Updates and fixes: -* Fixed memory map for stm32l496xx boards ([#639](https://github.com/texane/stlink/pull/639)) +* Fixed verification of flash error for STM32L496x device ([#617](https://github.com/texane/stlink/pull/617), [#618](https://github.com/texane/stlink/pull/618)) +* Updated Linux source repositories in README.md: Gentoo, Fedora and RedHat/CentOS ([#622](https://github.com/texane/stlink/pull/622), [#635](https://github.com/texane/stlink/pull/635)) +* Updated changelog in debian package ([#630](https://github.com/texane/stlink/pull/630)) +* Added LIB_INSTALL_DIR to correct libs install on 64-bit systems ([#633](https://github.com/texane/stlink/pull/633), [#636](https://github.com/texane/stlink/pull/636)) * Fixed write for microcontroller with RAM size less or equal to 32K ([#637](https://github.com/texane/stlink/pull/637)) -* Added LIB_INSTALL_DIR to correct libs install on 64-bit systems ([#636](https://github.com/texane/stlink/pull/636)) -* Fixed verification of flash error for STM32L496x device ([#618](https://github.com/texane/stlink/pull/618)) -* Fixed build on Fedora with GCC 8 ([#666](https://github.com/texane/stlink/pull/668)) - +* Fixed memory map for stm32l496xx boards ([#639](https://github.com/texane/stlink/pull/639)) +* Fixed __FILE__ base name extraction ([#624](https://github.com/texane/stlink/pull/624), [#628](https://github.com/texane/stlink/pull/628), [#648](https://github.com/texane/stlink/pull/648)) +* Added debian/triggers to run ldconfig ([#664](https://github.com/texane/stlink/pull/664)) +* Fixed build on Fedora with GCC 8 ([#666](https://github.com/texane/stlink/pull/666), [#667](https://github.com/texane/stlink/pull/667), [#668](https://github.com/texane/stlink/pull/668)) v1.4.0 ======
bootloader: Factory reset not for deep sleep Closes: Closes:
#include "bootloader_common.h" #include "sdkconfig.h" #include "esp_image_format.h" +#include "esp32/rom/rtc.h" static const char* TAG = "boot"; @@ -74,7 +75,8 @@ static int selected_boot_partition(const bootloader_state_t *bs) int boot_index = bootloader_utility_get_selected_boot_partition(bs); if (boot_index == INVALID_INDEX) { return boot_index; // Unrecoverable failure (not due to corrupt ota data or bad partition contents) - } else { + } + if (rtc_get_reset_reason(0) != DEEPSLEEP_RESET) { // Factory firmware. #ifdef CONFIG_BOOTLOADER_FACTORY_RESET if (bootloader_common_check_long_hold_gpio(CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET, CONFIG_BOOTLOADER_HOLD_TIME_GPIO) == 1) {
fix common realloc mistake and add null check more
@@ -219,7 +219,10 @@ sds sdsMakeRoomFor(sds s, size_t addlen) { hdrlen = sdsHdrSize(type); if (oldtype==type) { newsh = s_realloc(sh, hdrlen+newlen+1); - if (newsh == NULL) return NULL; + if (newsh == NULL) { + s_free(sh); + return NULL; + } s = (char*)newsh+hdrlen; } else { /* Since the header size changes, need to move the string forward, @@ -592,6 +595,7 @@ sds sdscatfmt(sds s, char const *fmt, ...) { /* Make sure there is always space for at least 1 char. */ if (sdsavail(s)==0) { s = sdsMakeRoomFor(s,1); + if (s == NULL) goto fmt_error; } switch(*f) { @@ -605,6 +609,7 @@ sds sdscatfmt(sds s, char const *fmt, ...) { l = (next == 's') ? strlen(str) : sdslen(str); if (sdsavail(s) < l) { s = sdsMakeRoomFor(s,l); + if (s == NULL) goto fmt_error; } memcpy(s+i,str,l); sdsinclen(s,l); @@ -621,6 +626,7 @@ sds sdscatfmt(sds s, char const *fmt, ...) { l = sdsll2str(buf,num); if (sdsavail(s) < l) { s = sdsMakeRoomFor(s,l); + if (s == NULL) goto fmt_error; } memcpy(s+i,buf,l); sdsinclen(s,l); @@ -638,6 +644,7 @@ sds sdscatfmt(sds s, char const *fmt, ...) { l = sdsull2str(buf,unum); if (sdsavail(s) < l) { s = sdsMakeRoomFor(s,l); + if (s == NULL) goto fmt_error; } memcpy(s+i,buf,l); sdsinclen(s,l); @@ -662,6 +669,10 @@ sds sdscatfmt(sds s, char const *fmt, ...) { /* Add null-term */ s[i] = '\0'; return s; + +fmt_error: + va_end(ap); + return NULL; } /* Remove the part of the string from left and from right composed just of @@ -1018,10 +1029,18 @@ sds *sdssplitargs(const char *line, int *argc) { if (*p) p++; } /* add the token to the vector */ - vector = s_realloc(vector,((*argc)+1)*sizeof(char*)); + { + char **new_vector = s_realloc(vector,((*argc)+1)*sizeof(char*)); + if (new_vector == NULL) { + s_free(vector); + return NULL; + } + + vector = new_vector; vector[*argc] = current; (*argc)++; current = NULL; + } } else { /* Even on empty input string return something not NULL. */ if (vector == NULL) vector = s_malloc(sizeof(void*));
Work around permission issue in marvell
@@ -259,7 +259,13 @@ target_link_libraries( ) # Convert afx file to bin file +if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") set(axf2fw "${mw320_dir}/sdk/tools/bin/Linux/axf2firmware") + execute_process(COMMAND chmod +x "${axf2fw}") # TODO, workaround for Amazon FreeRTOS console permission issue. +else() + message(FATAL_ERROR "Only Linux host is supported for marvell.") +endif() + add_custom_command( TARGET ${exe_target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E remove "${exe_target}.bin"
ci: stop checking FLASH_SPEED_BYTE_PER_SEC_EXT_WR_4B performance
#endif #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_4B -#define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_4B 73500 +//Collect data and correct it later +#define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_4B 0 #endif #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_4B #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_4B (261*1000)
[libc] Remove redefinition in minilibc/errno.h
#ifndef __ERRNO_H__ #define __ERRNO_H__ -#ifdef RT_USING_DFS - -#include <dfs_def.h> - -/* using device error codes */ -#define ENOENT DFS_STATUS_ENOENT -#define EIO DFS_STATUS_EIO -#define ENXIO DFS_STATUS_ENXIO -#define EBADF DFS_STATUS_EBADF -#define EAGAIN DFS_STATUS_EAGAIN -#define ENOMEM DFS_STATUS_ENOMEM -#define EBUSY DFS_STATUS_EBUSY -#define EEXIST DFS_STATUS_EEXIST -#define EXDEV DFS_STATUS_EXDEV -#define ENODEV DFS_STATUS_ENODEV -#define ENOTDIR DFS_STATUS_ENOTDIR -#define EISDIR DFS_STATUS_EISDIR -#define EINVAL DFS_STATUS_EINVAL -#define ENOSPC DFS_STATUS_ENOSPC -#define EROFS DFS_STATUS_EROFS -#define ENOSYS DFS_STATUS_ENOSYS -#define ENOTEMPTY DFS_STATUS_ENOTEMPTY - -#else - -/* error codes */ -#define ENOENT 2 /* No such file or directory */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define EBADF 9 /* Bad file number */ -#define EAGAIN 11 /* Try again */ -#define ENOMEM 12 /* no memory */ -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENOSPC 28 /* No space left on device */ -#define EROFS 30 /* Read-only file system */ -#define ENOSYS 38 /* Function not implemented */ -#define ENOTEMPTY 39 /* Directory not empty */ - -#endif - -#define EPERM 1 /* Not super-user */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EFAULT 14 /* Bad address */ -#define ENFILE 23 /* Too many open files in system */ -#define ERANGE 34 /* Math result not representable */ -#define EDEADLK 45 /* Deadlock condition */ -#define EBADMSG 77 /* Trying to read unreadable message */ -#define EMSGSIZE 90 /* Message too long */ -#define ENOPROTOOPT 92 /* Protocol not available */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define EADDRINUSE 98 /* Address already in use */ -#define ENETDOWN 100 /* Network is down */ -#define ENETUNREACH 101 /* Network is unreachable */ -#define ECONNABORTED 103 /* Software caused connection abort */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define ENOTCONN 107 /* Transport endpoint is not connected */ -#define EINPROGRESS 115 /* Operation now in progress */ -#define ETIMEDOUT 116 /* Connection timed out */ -#define EHOSTUNREACH 113 /* No route to host */ -#define EALREADY 114 /* Operation already in progress */ -#define ENOTSUP 134 /* Not supported */ +#include "libc/libc_errno.h" +/* Others defined in libc/libc_errno.h */ #define ENSRNOTFOUND 163 /* Domain name not found */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ #endif
cbor: cbor_major_type_t can be int
@@ -10,14 +10,14 @@ typedef enum { } cbor_error_t; typedef enum { - CBOR_TYPE_UINT = 0x00U, - CBOR_TYPE_NINT = 0x01U, - CBOR_TYPE_BSTR = 0x02U, - CBOR_TYPE_TSTR = 0x03U, - CBOR_TYPE_ARRAY = 0x04U, - CBOR_TYPE_MAP = 0x05U, - CBOR_TYPE_TAG = 0x06U, - CBOR_TYPE_FLOAT = 0x07U, + CBOR_TYPE_UINT = 0x00, + CBOR_TYPE_NINT = 0x01, + CBOR_TYPE_BSTR = 0x02, + CBOR_TYPE_TSTR = 0x03, + CBOR_TYPE_ARRAY = 0x04, + CBOR_TYPE_MAP = 0x05, + CBOR_TYPE_TAG = 0x06, + CBOR_TYPE_FLOAT = 0x07, } cbor_major_type_t; typedef enum {
refactor(discord-adapter-ratelimit.c): remove redundant struct
@@ -15,41 +15,39 @@ static void _discord_bucket_get_route(const char endpoint[], char route[DISCORD_ROUTE_LEN]) { /* split individual endpoint sections */ - struct { - const char *ptr; - int len; - } curr = { endpoint, 0 }, prev = { "", 0 }; - + const char *curr = endpoint, *prev = ""; + int currlen = 0; /* route len */ size_t len = 0; do { + /* check if section is a snowflake */ int digits = 0; - curr.ptr += 1 + curr.len; - curr.len = strcspn(curr.ptr, "/"); + curr += 1 + currlen; + currlen = strcspn(curr, "/"); /* reactions and sub-routes share the same bucket */ - if (0 == strncmp(prev.ptr, "reactions", 9)) break; + if (0 == strncmp(prev, "reactions", 9)) break; - sscanf(curr.ptr, "%*d%n", &digits); + sscanf(curr, "%*d%n", &digits); /* ignore literal ids for non-major parameters */ if ((digits >= 16 && digits <= 19) - && (strncmp(prev.ptr, "channels", 8) != 0 - && strncmp(prev.ptr, "guilds", 6) != 0)) + && (strncmp(prev, "channels", 8) != 0 + && strncmp(prev, "guilds", 6) != 0)) { len += snprintf(route + len, DISCORD_ROUTE_LEN - len, ":id"); } else { - len += snprintf(route + len, DISCORD_ROUTE_LEN - len, ":%.*s", curr.len, - curr.ptr); + len += + snprintf(route + len, DISCORD_ROUTE_LEN - len, ":%.*s", currlen, curr); } ASSERT_S(len < DISCORD_ROUTE_LEN, "Out of bounds write attempt"); prev = curr; - } while (curr.ptr[curr.len] != '\0'); + } while (curr[currlen] != '\0'); } struct discord_bucket *
sysdeps/linux: fix sys_accept
@@ -555,7 +555,7 @@ int sys_accept(int fd, int *newfd, struct sockaddr *addr_ptr, socklen_t *addr_le auto ret = do_syscall(SYS_accept, fd, addr_ptr, addr_length, 0, 0, 0); if (int e = sc_error(ret); e) return e; - *newfd = fd; + *newfd = sc_int_result<int>(ret); return 0; }
Rename data to reg_data.
#include <stdint.h> int cambus_init(); int cambus_scan(); -int cambus_readb(uint8_t slv_addr, uint8_t reg_addr, uint8_t *data); -int cambus_writeb(uint8_t slv_addr, uint8_t reg_addr, uint8_t data); -int cambus_readw(uint8_t slv_addr, uint8_t reg_addr, uint16_t *data); -int cambus_writew(uint8_t slv_addr, uint8_t reg_addr, uint16_t data); +int cambus_readb(uint8_t slv_addr, uint8_t reg_addr, uint8_t *reg_data); +int cambus_writeb(uint8_t slv_addr, uint8_t reg_addr, uint8_t reg_data); +int cambus_readw(uint8_t slv_addr, uint8_t reg_addr, uint16_t *reg_data); +int cambus_writew(uint8_t slv_addr, uint8_t reg_addr, uint16_t reg_data); #endif // __CAMBUS_H__
Fix micro-ROS library link
@@ -81,7 +81,7 @@ recipe.s.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mcpu={b ## Create archives recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--whole-archive {compiler.libraries.ldflags} "{build.path}/{archive_file}" -Wl,--no-whole-archive -Wl,--end-group +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--whole-archive "{build.path}/{archive_file}" -Wl,--no-whole-archive {compiler.libraries.ldflags} -Wl,--end-group ## Create eeprom recipe.objcopy.eep.pattern=
Apply two more small fixes to achieve parity with keygen-js argon2u salt account for larger seed when deriving from mnemonic
|= inp=byts ^- @ %- (argon2-urbit:argon2:crypto 32) - [inp (to-byts 'urbitwallet')] + [inp (to-byts 'urbitkeygen')] :: ++ child-node-from-seed |= [seed=@ met=meta pass=(unit @t)] ^- node - =+ sed=(seed:ds seed met) + =+ sed=(seed:ds 32^seed met) =+ nom=(from-entropy:bip39 32^sed) :+ met nom %- wallet:ds (nn "voting" voting.revs) :: =/ management=nodes - (nn "managementment" management.revs) + (nn "management" management.revs) :- management=management :: :- ^= transfer ^- nodes seed:(~(got by management) who) (trip (fall pass '')) =+ met=["network" network.revs who] - =+ sed=(seed:ds mad met) + =+ sed=(seed:ds 64^mad met) [met sed (urbit:ds sed)] :: ++ ds :: derive from raw seed (rsh 3 33 sec) :: ++ seed - |= [seed=@ meta] + |= [seed=byts meta] ^- @ux =/ salt=tape ;: weld ['-' (a-co:co rev)] == %- sha-256l:sha - :- (add 32 (lent salt)) - (cat 3 (crip (flop salt)) seed) + :- (add wid.seed (lent salt)) + (cat 3 (crip (flop salt)) dat.seed) -- --
Fix a potential out-of-bounds array access in RGBGFX This was caught by ASAN for pokered's gfx/battle/minimize.png.
@@ -224,7 +224,11 @@ void create_mapfiles(const struct Options *opts, struct GBImage *gb, if (!tile) err(1, "%s: Failed to allocate memory for tile", __func__); - for (i = 0; i < tile_size; i++) { + /* + * If the input image doesn't fill the last tile, + * `gb_i` will reach `gb_size`. + */ + for (i = 0; i < tile_size && gb_i < gb_size; i++) { tile[i] = gb->data[gb_i]; gb_i++; }
BugID:17646749:[solo] accept argv[1] as max running break time
@@ -522,13 +522,26 @@ void set_iotx_info() HAL_SetDeviceSecret(DEVICE_SECRET); } +static int max_running_seconds = 0; int linkkit_main(void *paras) { - int res = 0; uint64_t time_prev_sec = 0, time_now_sec = 0; - user_example_ctx_t *user_example_ctx = user_example_get_ctx(); + uint64_t time_begin_sec = 0; + int res = 0; iotx_linkkit_dev_meta_info_t master_meta_info; + user_example_ctx_t *user_example_ctx = user_example_get_ctx(); + int argc = ((app_main_paras_t *)paras)->argc; + char **argv = ((app_main_paras_t *)paras)->argv; + + if (argc > 1) { + int tmp = atoi(argv[1]); + + if (tmp >= 60) { + max_running_seconds = tmp; + EXAMPLE_TRACE("set [max_running_seconds] = %d seconds\n", max_running_seconds); + } + } #if !defined(WIFI_PROVISION_ENABLED) || !defined(BUILD_AOS) set_iotx_info(); @@ -595,6 +608,7 @@ int linkkit_main(void *paras) return -1; } + time_begin_sec = user_update_sec(); while (1) { IOT_Linkkit_Yield(USER_EXAMPLE_YIELD_TIMEOUT_MS); @@ -602,6 +616,10 @@ int linkkit_main(void *paras) if (time_prev_sec == time_now_sec) { continue; } + if (max_running_seconds && (time_now_sec - time_begin_sec > max_running_seconds)) { + EXAMPLE_TRACE("Example Run for Over %d Seconds, Break Loop!\n", max_running_seconds); + break; + } /* Post Proprety Example */ if (time_now_sec % 11 == 0 && user_master_dev_available()) {
Change the default sort order to Descending currently with ascending sort the useful information is commonly beyond the bottom of the terminal window and it is necessary to reverse the sort manually every execution.
@@ -136,7 +136,7 @@ def handle_loop(stdscr, args): stdscr.nodelay(1) # set default sorting field sort_field = FIELDS.index(DEFAULT_FIELD) - sort_reverse = False + sort_reverse = True # load BPF program bpf_text = """
Fix shared libraries compilation
#ifndef MCU_FILE_H #define MCU_FILE_H +#include "LimeSuiteConfig.h" + #include <stdio.h> #include <string.h> #include <vector> @@ -13,7 +15,7 @@ public: std::vector<unsigned char> m_bytes; }; -class MCU_File +class LIME_API MCU_File { public: explicit MCU_File(const char *fileName, const char *mode);
king: Handle replacement events correctly (dont try to parse them).
@@ -167,7 +167,7 @@ data RunInput | RunPeek Wen Gang Path (Maybe (Term, Noun) -> IO ()) | RunWork Ev (RunError -> IO ()) -data RunOutput = RunOutput EventId Mug Wen (Either Noun Ev) [Ef] +data RunOutput = RunOutput EventId Mug Wen Noun [Ef] -- Exceptions ------------------------------------------------------------------ @@ -432,11 +432,11 @@ running serf notice = do io (sendWrit serf (WWork wen evn)) io (recvWork serf) >>= \case WDone eid hash fx -> do - yield (RunOutput eid hash wen (Right evn) fx) + yield (RunOutput eid hash wen (toNoun evn) fx) loop hash eid WSwap eid hash (wen, noun) fx -> do io $ err (RunSwap eid hash wen noun fx) - yield (RunOutput eid hash wen (Left noun) fx) + yield (RunOutput eid hash wen noun fx) loop hash eid WBail goofs -> do io $ err (RunBail goofs)
sim: init events field when send ack/dack
@@ -78,6 +78,7 @@ static int usrsock_send_ack(struct usrsock_s *usrsock, ack.head.msgid = USRSOCK_MESSAGE_RESPONSE_ACK; ack.head.flags = (result == -EINPROGRESS); + ack.head.events = 0; ack.xid = xid; ack.result = result; @@ -93,6 +94,7 @@ static int usrsock_send_dack(struct usrsock_s *usrsock, { ack->reqack.head.msgid = USRSOCK_MESSAGE_RESPONSE_DATA_ACK; ack->reqack.head.flags = 0; + ack->reqack.head.events = 0; ack->reqack.xid = xid; ack->reqack.result = result;
Add fingerprint text, remove MD5
@@ -259,8 +259,11 @@ non-zero if yes it will expire or zero if not. =item B<-fingerprint> -Prints out the digest of the DER encoded version of the whole certificate -(see digest options). +Calculates and outputs the digest of the DER encoded version of the entire +certificate (see digest options). +This is commonly called a "fingerprint". Because of the nature of message +digests, the fingerprint of a certificate is unique to that certificate and +two certificates with the same fingerprint can be considered to be the same. =item B<-C> @@ -725,10 +728,6 @@ supporting UTF8: openssl x509 -in cert.pem -noout -subject -nameopt oneline,-esc_msb -Display the certificate MD5 fingerprint: - - openssl x509 -in cert.pem -noout -fingerprint - Display the certificate SHA1 fingerprint: openssl x509 -sha1 -in cert.pem -noout -fingerprint @@ -782,13 +781,6 @@ T61Strings use the ISO8859-1 character set. This is wrong but Netscape and MSIE do this as do many certificates. So although this is incorrect it is more likely to display the majority of certificates correctly. -The B<-fingerprint> option takes the digest of the DER encoded certificate. -This is commonly called a "fingerprint". Because of the nature of message -digests the fingerprint of a certificate is unique to that certificate and -two certificates with the same fingerprint can be considered to be the same. - -The Netscape fingerprint uses MD5 whereas MSIE uses SHA1. - The B<-email> option searches the subject name and the subject alternative name extension. Only unique email addresses will be printed out: it will not print the same address more than once.
Change based on PR suggestions
@@ -20,27 +20,26 @@ Information about the syntax: - Lines that start with a `#` character are considered comments. Comments are ignored too. - Configurations consist of groups and keys. Only keys can have values. - Key names can't start with a `[` character -- Keys can contain spaces and any special characters as long except `=`. +- Keys can contain spaces and any special characters except `=`. - If a key has a value, then it will be followed with an `=` symbol and then the value will be read until the end of the line. The white space characters around the `=` symbol are ignored. - In values, the following escape sequences can be used: - - `\n` and `r` are mapped to newline + - `\n` and `\r` are mapped to newline - `\t` is mapped to tab - `\\` is mapped to `\` -- Values can contain any character from the `UTF-8` set except for newline and `\` followed by an invalid excape sequence. -- Keys can be localized. The locale is surrounded with `[` and `]` and cannot contain start with `$`. -- Same key name can be used multiple times if it has different locales. The following example is valid: +- Values can contain any character from the `UTF-8` set except for newline and `\` followed by an invalid escape sequence. +- Keys can be localized. The locale is surrounded with `[` and `]` and cannot start with `$`. +- Same key names can be used multiple times if it has different locales. The following example is valid: ``` greeting[en] = Hello greeting[de] = Hallo ``` -- Keys can have meta data. Those are one character (1 byte only) long, start with `$` and are surrounded with `[` and `]`. -- Same key name can't be used multiple times with different metadata as in locales. The following example is invalid: +- Keys can have metadata. Those are one byte long, start with `$` and are surrounded with `[` and `]`. +- The same key name can't be used multiple times with different metadata (different to locales). The following example is invalid: ``` key.name[$a] = Something key.name[$i] = Something else ``` -- If a key `keyname[$metavalue]` is parsed, it will be represented as a Key with name `parent/keyname` and meta `kconfig` as `metavalue` - Group names begin have a `[` symbol at the beginning of a line and every key that follows them is part of this group (until the next group is declared) @@ -94,5 +93,5 @@ sudo kdb umount /tests/kconfig ## Limitations -- Comments from file are discarded on save (same as the default KConfig functionality) +- Comments from the file are discarded on save (same as the default KConfig functionality) - No validation for meta values or locale codes
twixread: add option for debug_level
@@ -337,6 +337,7 @@ int main_twixread(int argc, char* argv[argc]) OPT_SET('L', &linectr, "use linectr offset"), OPT_SET('P', &partctr, "use partctr offset"), OPT_SET('M', &mpi, "MPI mode"), + OPT_INT('d', &debug_level, "level", "Debug level"), }; cmdline(&argc, argv, ARRAY_SIZE(args), args, help_str, ARRAY_SIZE(opts), opts);
BugID:17132091: [WhiteScan] Fix buffer out of bounds error for rtl8711b I2CInitDat
@@ -281,6 +281,10 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl) obj->I2Cx = I2C_DEV_TABLE[i2c_idx].I2Cx; /* Set I2C Device Number */ + if (obj->i2c_idx >= sizeof(I2CInitDat)) { + return; + } + I2CInitDat[obj->i2c_idx].I2CIdx = i2c_idx; /* Load I2C default value */
Fix CID 168609.
@@ -775,6 +775,14 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ struct sctpasochead *head; + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + atomic_add_int(&stcb->asoc.refcnt, 1); + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_INFO_WLOCK(); + SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); + } if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); @@ -783,6 +791,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) /* put it in the bucket in the vtag hash of assoc's for the system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); + SCTP_INP_INFO_WUNLOCK(); return (1); } if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) { @@ -802,6 +811,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) /* put it in the bucket in the vtag hash of assoc's for the system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); + SCTP_INP_INFO_WUNLOCK(); return (1); } return (0);
Fix potential lock inversion
@@ -195,6 +195,7 @@ static void celix_logAdmin_addLogSvcForName(celix_log_admin_t* admin, const char newEntry->logSvc.vlog = celix_logAdmin_vlog; newEntry->logSvc.vlogDetails = celix_logAdmin_vlogDetails; hashMap_put(admin->loggers, (void*)newEntry->name, newEntry); + celixThreadRwlock_unlock(&admin->lock); { //register new log service async @@ -219,9 +220,9 @@ static void celix_logAdmin_addLogSvcForName(celix_log_admin_t* admin, const char } } else { found->count += 1; - } celixThreadRwlock_unlock(&admin->lock); } +} static void celix_logAdmin_trackerAdd(void *handle, const celix_service_tracker_info_t *info) { celix_log_admin_t* admin = handle; @@ -308,7 +309,7 @@ static void celix_logAdmin_remSink(void *handle, void *svc __attribute__((unused celixThreadRwlock_writeLock(&admin->lock); celix_log_sink_entry_t* entry = hashMap_get(admin->sinks, sinkName); - if (entry->svcId != svcId) { + if (entry != NULL && entry->svcId != svcId) { //no match (note there can be invalid log sinks with the same name, but different svc ids. entry = NULL; }
CBLK: Fix docu
@@ -240,7 +240,7 @@ struct cblk_dev { unsigned int ridx; struct cblk_req req[CBLK_IDX_MAX]; enum cblk_status req_status; - int prefetch_offs[CBLK_IDX_MAX]; + int prefetch_offs[CBLK_IDX_MAX]; /* list of LBA offsets to prefetch */ sem_t w_busy_sem; /* wait if there is no write slot */ sem_t r_busy_sem; /* wait if there is no read slot */
Add wiringPi to CircleCI install.
@@ -5,7 +5,7 @@ machine: dependencies: pre: - - sudo apt-get update; sudo apt-get install libusb-1.0-0-dev; cd ~/; git clone https://github.com/jpoirier/librtlsdr; cd librtlsdr; mkdir build; cd build; cmake ../; make; sudo make install; sudo ldconfig; cd ~/; mkdir gopath; cd ~/; mkdir gopath; wget https://storage.googleapis.com/golang/go1.6.src.tar.gz; tar -zxvf go1.6.src.tar.gz; cd go/src; export GOROOT_BOOTSTRAP=/usr/local/go; ./make.bash; echo $PATH; echo $GOPATH; go version; env + - sudo apt-get update; sudo apt-get install libusb-1.0-0-dev; sudo apt-get install wiringpi; cd ~/; git clone https://github.com/jpoirier/librtlsdr; cd librtlsdr; mkdir build; cd build; cmake ../; make; sudo make install; sudo ldconfig; cd ~/; mkdir gopath; cd ~/; mkdir gopath; wget https://storage.googleapis.com/golang/go1.6.src.tar.gz; tar -zxvf go1.6.src.tar.gz; cd go/src; export GOROOT_BOOTSTRAP=/usr/local/go; ./make.bash; echo $PATH; echo $GOPATH; go version; env override: - cd .. ; rm -rf stratux ; git clone --recursive https://github.com/cyoung/stratux ; cd stratux ; git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" ; git fetch origin ; BRANCH=`echo "$CIRCLE_BRANCH" | sed 's/pull\//pr\//g'` ; git checkout $BRANCH ; make
One More arm64 WinUser Build Fix
@@ -38,6 +38,7 @@ Environment: #pragma warning(disable:28251) #pragma warning(disable:28252) #pragma warning(disable:28253) +#pragma warning(disable:28301) #pragma warning(disable:5105) // The conformant preprocessor along with the newest SDK throws this warning for a macro. #include <windows.h> #include <winsock2.h>
king: address joe's comments again
@@ -45,15 +45,6 @@ instance Show Nock where -------------------------------------------------------------------------------- --- A Pill is a pair of [pil_p pil_q], where pil_p is cued and pil_q is an --- optional set of userspace ovums. --- --- The cued pil_p is a trel of [mot tag dat], where mot is 0 (version number?), --- tag is a cord about the type of pill, and dat is the traditional trel of --- [pBootForumlas pKernelOvums pUserspaceOvums]. --- --- So what's with pil_q? It looks like it is search for the %into. - data Pill = PillIvory [Noun] | PillPill
fix the Makefile of libbpf-tools, make it support cross compile
@@ -13,7 +13,7 @@ CFLAGS := -g -O2 -Wall BPFCFLAGS := -g -O2 -Wall INSTALL ?= install prefix ?= /usr/local -ARCH := $(shell uname -m | sed 's/x86_64/x86/' | sed 's/aarch64/arm64/' \ +ARCH ?= $(shell uname -m | sed 's/x86_64/x86/' | sed 's/aarch64/arm64/' \ | sed 's/ppc64le/powerpc/' | sed 's/mips.*/mips/' \ | sed 's/riscv64/riscv/' | sed 's/loongarch.*/loongarch/') BTFHUB_ARCHIVE ?= $(abspath btfhub-archive)
BugID:21900441:[hal tls]fix https read 0 length on platform linuxhost issue
@@ -781,9 +781,11 @@ static int _network_ssl_read(TLSDataParams_t *pTlsData, char *buffer, int len, uint32_t readLen = 0; static int net_status = 0; int ret = -1; - // char err_str[33] = {0}; + uint32_t cur_time = HAL_UptimeMs(); + uint32_t expire_time = cur_time + timeout_ms; mbedtls_ssl_conf_read_timeout(&(pTlsData->conf), timeout_ms); + while (readLen < len) { ret = mbedtls_ssl_read(&(pTlsData->ssl), (unsigned char *)(buffer + readLen), @@ -807,6 +809,16 @@ static int _network_ssl_read(TLSDataParams_t *pTlsData, char *buffer, int len, platform_err("ssl recv error: code = %d", ret); net_status = -2; /* connection is closed */ break; +#ifdef CSP_LINUXHOST + } else if (MBEDTLS_ERR_SSL_WANT_READ == ret && errno == EINTR) { + cur_time = HAL_UptimeMs(); + if ((cur_time - expire_time) < (UINT32_MAX / 2)) { + return readLen; + } + HAL_SleepMs(10); + continue; + +#endif } else if ((MBEDTLS_ERR_SSL_TIMEOUT == ret) || (MBEDTLS_ERR_SSL_CONN_EOF == ret) || (MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED == ret) || @@ -820,11 +832,6 @@ static int _network_ssl_read(TLSDataParams_t *pTlsData, char *buffer, int len, else { // mbedtls_strerror(ret, err_str, sizeof(err_str)); -#ifdef CSP_LINUXHOST - if (MBEDTLS_ERR_SSL_WANT_READ == ret && errno == EINTR) { - continue; - } -#endif platform_err("ssl recv error: code = %d", ret); #ifdef FEATURE_UND_SUPPORT und_update_statis(UND_STATIS_NETWORK_EXCEPTION_IDX,
Remove -veryfast from README.md
@@ -122,10 +122,10 @@ recommend experimenting with the block footprint to find the optimum balance between size and quality, as the finely adjustable compression ratio is one of major strengths of the ASTC format. -The compression speed can be controlled from `-veryfast`, through `-fast`, -`-medium` and `-thorough`, up to `-exhaustive`. In general, the more time the -encoder has to spend looking for good encodings the better the results, but it -does result in increasingly small improvements for the amount of time required. +The compression speed can be controlled from `-fast`, through `-medium` and +`-thorough`, up to `-exhaustive`. In general, the more time the encoder has to +spend looking for good encodings the better the results, but it does result in +increasingly small improvements for the amount of time required. There are many other command line options for tuning the encoder parameters which can be used to fine tune the compression algorithm. See the command line
Documentation: Fix formatting of enumeration
@@ -16,17 +16,17 @@ file before it is written to disc. Any of Elektra's user interfaces will work with the technique described in this tutorial, e.g.: -1.) `kdb qt-gui`: graphical user interface +1. `kdb qt-gui`: graphical user interface -2.) `kdb editor`: starts up your favourite text editor and +2. `kdb editor`: starts up your favourite text editor and allows you to edit configuration in any syntax. (generalization of `sudoedit`) -3.) `kdb set`: manipulate or add individual configuration +3. `kdb set`: manipulate or add individual configuration entries. (generalization of `adduser`) -4.) Any other tool using Elektra to store configuration +4. Any other tool using Elektra to store configuration (e.g. if the application itself has capabilities to modify its configuration)
Forgot some lines on the Changelog
@@ -7,6 +7,9 @@ Version 1.10.0 Proper allocation for an array of structs and a check for an unlikely overflow when calling the SIOCGIFCONF ioctl(). + It still bugs me the stack requirements of getlocalhostname() and + UpnpGetIfInfo(). + ******************************************************************************* Version 1.8.5 *******************************************************************************
[bsp] update gcc nocache section
@@ -218,14 +218,14 @@ SECTIONS *(NonCacheable.init) . = ALIGN(4); __noncachedata_init_end__ = .; /* create a global symbol at initialized ncache data end */ - } > m_dtcm + } > m_nocache . = __noncachedata_init_end__; .ncache : { *(NonCacheable) . = ALIGN(4); __noncachedata_end__ = .; /* define a global symbol at ncache data end */ - } > m_dtcm + } > m_nocache __DATA_END = __NDATA_ROM + (__noncachedata_init_end__ - __noncachedata_start__); text_end = ORIGIN(m_text) + LENGTH(m_text);
Bugfix for pointer handling.
@@ -166,7 +166,7 @@ static int copy_options(struct neat_tlv** optionsPtr, const int newOptCount) { if(*optionsPtr) { - free(optionsPtr); + free(*optionsPtr); *optionsPtr = NULL; *optcntPtr = 0; }
hv: handle the case of empty hypervisor cmdline Fix a bug: When the hypervisor cmdline is empty, the hypervisor will be unable to boot up.
@@ -368,17 +368,15 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *_table) */ cmdline16 = StrDuplicate(options); bootloader_name = strstr_16(cmdline16, bootloader_param); - if (bootloader_name) + if (bootloader_name) { bootloader_name = bootloader_name + StrLen(bootloader_param); - n = bootloader_name; i = 0; while (*n && !isspace((CHAR8)*n) && (*n < 0xff)) { n++; i++; } *n++ = '\0'; - - if (!bootloader_name) { + } else { /* * If we reach this point, it means we did not receive a specific * bootloader name to be used. Fall back to the default bootloader
padlock: generate assembler source for static libraries too The GENERATE lines for generating the padlock assembler source were wrongly placed in such a way that they only applied to the shared library build. [extended tests]
@@ -20,9 +20,6 @@ IF[{- !$disabled{"engine"} -}] SOURCE[padlock]=e_padlock.c {- $target{padlock_asm_src} -} DEPEND[padlock]=../libcrypto INCLUDE[padlock]=../include - GENERATE[e_padlock-x86.s]=asm/e_padlock-x86.pl \ - $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR) - GENERATE[e_padlock-x86_64.s]=asm/e_padlock-x86_64.pl $(PERLASM_SCHEME) IF[{- defined $target{shared_defflag} -}] SHARED_SOURCE[padlock]=padlock.ld GENERATE[padlock.ld]=../util/engines.num @@ -75,4 +72,7 @@ IF[{- !$disabled{"engine"} -}] GENERATE[ossltest.ld]=../util/engines.num ENDIF ENDIF + GENERATE[e_padlock-x86.s]=asm/e_padlock-x86.pl \ + $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR) + GENERATE[e_padlock-x86_64.s]=asm/e_padlock-x86_64.pl $(PERLASM_SCHEME) ENDIF
Supports for USDZ MIME type for iOS 12 Safari
@@ -106,6 +106,7 @@ MIMEMAP("ttc", "font/collection") MIMEMAP("ttf", "font/ttf") MIMEMAP("ttl", "text/turtle") MIMEMAP("txt", "text/plain") +MIMEMAP("usdz", "model/vnd.pixar.usd") MIMEMAP("vtt", "text/vtt") MIMEMAP("war", "application/java-archive") MIMEMAP("wasm", "application/wasm")
[Makefile] Update to latest version of CMAKE
@@ -26,7 +26,7 @@ ISA_SIM_INSTALL_DIR ?= ${INSTALL_DIR}/riscv-isa-sim LLVM_INSTALL_DIR ?= ${INSTALL_DIR}/llvm HALIDE_INSTALL_DIR ?= ${INSTALL_DIR}/halide -CMAKE ?= cmake-3.7.1 +CMAKE ?= cmake-3.18.1 # CC and CXX are Makefile default variables that are always defined in a Makefile. Hence, overwrite # the variable if it is only defined by the Makefile (its origin in the Makefile's default). ifeq ($(origin CC),default)
Do this on one place, so we can change it easy and don't duplicate const
@@ -444,6 +444,16 @@ return FALSE; /*===========================================================================*/ void showhashrecord(hcx_t *hcxrecord, uint8_t showinfo1, uint8_t showinfo2) { + void output(FILE *where, hcx_t *hcxrecord, uint32_t *hash) + { + + fprintf(where, "%08x%08x%08x%08x:%02x%02x%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%s\n", + hash[0], hash[1], hash[2], hash[3], + hcxrecord->mac_ap.addr[0], hcxrecord->mac_ap.addr[1], hcxrecord->mac_ap.addr[2], hcxrecord->mac_ap.addr[3], hcxrecord->mac_ap.addr[4], hcxrecord->mac_ap.addr[5], + hcxrecord->mac_sta.addr[0], hcxrecord->mac_sta.addr[1], hcxrecord->mac_sta.addr[2], hcxrecord->mac_sta.addr[3], hcxrecord->mac_sta.addr[4], hcxrecord->mac_sta.addr[5], + hcxrecord->essid); + } + int i; hcxhrc_t hashrec; uint32_t hash[4]; @@ -559,11 +569,7 @@ md5_64 (block, hash); if(showinfo1 == TRUE) { - printf("%08x%08x%08x%08x:%02x%02x%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%s\n", - hash[0], hash[1], hash[2], hash[3], - hcxrecord->mac_ap.addr[0], hcxrecord->mac_ap.addr[1], hcxrecord->mac_ap.addr[2], hcxrecord->mac_ap.addr[3], hcxrecord->mac_ap.addr[4], hcxrecord->mac_ap.addr[5], - hcxrecord->mac_sta.addr[0], hcxrecord->mac_sta.addr[1], hcxrecord->mac_sta.addr[2], hcxrecord->mac_sta.addr[3], hcxrecord->mac_sta.addr[4], hcxrecord->mac_sta.addr[5], - hcxrecord->essid); + output(stdout, hcxrecord, hash); } if(showinfo2 == TRUE) @@ -576,13 +582,7 @@ if(showinfo2 == TRUE) exit(EXIT_FAILURE); } } - - fprintf(fhshowinfo2, "%08x%08x%08x%08x:%02x%02x%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%s\n", - hash[0], hash[1], hash[2], hash[3], - hcxrecord->mac_ap.addr[0], hcxrecord->mac_ap.addr[1], hcxrecord->mac_ap.addr[2], hcxrecord->mac_ap.addr[3], hcxrecord->mac_ap.addr[4], hcxrecord->mac_ap.addr[5], - hcxrecord->mac_sta.addr[0], hcxrecord->mac_sta.addr[1], hcxrecord->mac_sta.addr[2], hcxrecord->mac_sta.addr[3], hcxrecord->mac_sta.addr[4], hcxrecord->mac_sta.addr[5], - hcxrecord->essid); - fclose(fhshowinfo2); + output(fhshowinfo2, hcxrecord, hash); } return; }
docs/library/uio: Typo/grammar fixes in the intro.
@@ -28,14 +28,14 @@ MicroPython, all streams are currently unbuffered. This is because all modern OSes, and even many RTOSes and filesystem drivers already perform buffering on their side. Adding another layer of buffering is counter- productive (an issue known as "bufferbloat") and takes precious memory. -Note that there still cases where buffering may be useful, so we may +Note that there are still cases where buffering may be useful, so we may introduce optional buffering support at a later time. But in CPython, another important dichotomy is tied with "bufferedness" - it's whether a stream may incur short read/writes or not. A short read is when a user asks e.g. 10 bytes from a stream, but gets less, similarly for writes. In CPython, unbuffered streams are automatically short -operation susceptible, while buffered are guarantee against them. The +operation susceptible, while buffered are guaranteed against them. The no short read/writes is an important trait, as it allows to develop more concise and efficient programs - something which is highly desirable for MicroPython. So, while MicroPython doesn't support buffered streams, @@ -54,14 +54,14 @@ fully supported by MicroPython. Non-blocking streams never wait for data either to arrive or be written - they read/write whatever possible, or signal lack of data (or ability to write data). Clearly, this conflicts with "no-short-operations" policy, and indeed, a case of non-blocking -buffered (and this no-short-ops) streams is convoluted in CPython - in +buffered (and thus no-short-ops) streams is convoluted in CPython - in some places, such combination is prohibited, in some it's undefined or just not documented, in some cases it raises verbose exceptions. The matter is much simpler in MicroPython: non-blocking stream are important -for efficient asynchronous operations, so this property prevails on +for efficient asynchronous operations, so this property prevails the "no-short-ops" one. So, while blocking streams will avoid short reads/writes whenever possible (the only case to get a short read is -if end of file is reached, or in case of error (but errors don't +if the end of file is reached, or in a case of error (but errors don't return short data, but raise exceptions)), non-blocking streams may produce short data to avoid blocking the operation.
Fix detecting reset in winsim
@@ -224,7 +224,7 @@ class ReadSerialThread(Thread): try: line = outStream.readline().decode() # For windows simulator once we reach a reboot place, then we will manually reboot. - if 'Failed to activate new image (0x00000000). Please reset manually.' in line: + if 'Please reset manually' in line: return 'reset' except UnicodeDecodeError: # Discard data if fails to decode.
YAML: Simplify logging macro
@@ -74,12 +74,7 @@ typedef struct /* -- Macros ---------------------------------------------------------------------------------------------------------------------------- */ #define LOG_PARSE(data, message, ...) \ - { \ - char filename[MAXPATHLEN]; \ - basename_r (keyString (data->parentKey), filename); \ - ELEKTRA_LOG_DEBUG ("%s:%lu:%lu: " message, filename, data->line, data->column, __VA_ARGS__); \ - } - + ELEKTRA_LOG_DEBUG ("%s:%lu:%lu: " message, strrchr (keyString (data->parentKey), '/') + 1, data->line, data->column, __VA_ARGS__); #define SET_ERROR_PARSE(data, message, ...) \ ELEKTRA_SET_ERRORF (ELEKTRA_ERROR_PARSE, data->parentKey, "%s:%lu:%lu: " message, keyString (data->parentKey), data->line, \ data->column, __VA_ARGS__);
license : add missing our copyright and license . add missing our copyright and license to file : ftl.c
+/**************************************************************************** + * + * Copyright 2017 Samsung Electronics All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * drivers/mtd/ftl.c *
spi_flash: remove back-compatible with caller function of S3Beta ROM
@@ -135,17 +135,12 @@ esp_err_t spi_flash_hal_common_command(spi_flash_host_inst_t *host, spi_flash_tr esp_flash_io_mode_t io_mode = ((spi_flash_hal_context_t*)host)->base_io_mode; uint16_t command; uint8_t dummy_bitlen; - if (trans->reserved != 0) { - // Back-compatible with caller functions of ESP32-S3 ROM - command = (uint8_t)trans->reserved; - dummy_bitlen = 0; - } else { + command = trans->command; dummy_bitlen = trans->dummy_bitlen; if ((trans->flags & SPI_FLASH_TRANS_FLAG_IGNORE_BASEIO) != 0) { io_mode = trans->io_mode; } - } host->driver->configure_host_io_mode(host, command, trans->address_bitlen, dummy_bitlen, io_mode);
examples/provisioning: add comment about linker errors If the user copies the BLE example to their own project without understanding the need to enable the BT stack or BTDM BLE settings in the SDK then their build will probably fail at this line due to linker errors. Closes Closes
@@ -271,6 +271,10 @@ void app_main(void) 0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf, 0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02, }; + + /* If your build fails with linker errors at this point, then you may have + * forgotten to enable the BT stack or BTDM BLE settings in the SDK (e.g. see + * the sdkconfig.defaults in the example project) */ wifi_prov_scheme_ble_set_service_uuid(custom_service_uuid); #endif /* CONFIG_EXAMPLE_PROV_TRANSPORT_BLE */
Reset CAN ign when the specific message is not seen anymore
@@ -195,24 +195,25 @@ void ignition_can_hook(CANPacket_t *to_push) { int addr = GET_ADDR(to_push); int len = GET_LEN(to_push); - ignition_can_cnt = 0U; // reset counter - if (bus == 0) { // GM exception if ((addr == 0x160) && (len == 5)) { // this message isn't all zeros when ignition is on ignition_can = GET_BYTES_04(to_push) != 0U; + ignition_can_cnt = 0U; } // Tesla exception if ((addr == 0x348) && (len == 8)) { // GTW_status ignition_can = (GET_BYTE(to_push, 0) & 0x1U) != 0U; + ignition_can_cnt = 0U; } // Mazda exception if ((addr == 0x9E) && (len == 8)) { ignition_can = (GET_BYTE(to_push, 0) >> 5) == 0x6U; + ignition_can_cnt = 0U; } }
Java Tutorials: Apply suggestions from code review See also:
## Introduction -When programming in Java it is possible to access the kdb database, changing values of existing keys or adding new ones and a few other things. It is also possible to write plugins for Elektra in Java but we will focus on using the Java +When programming in Java it is possible to access the key database, changing values of existing keys or adding new ones and a few other things. It is also possible to write plugins for Elektra in Java but we will focus on using the Java binding in this tutorial. ## First Steps -In order to use `kdb` you will need include the dependency in your project. [Here](../../src/bindings/jna/README.md) you can find a detailed tutorial on how to do that. +In order to use `kdb` you need to include the dependency in your project. [Here](../../src/bindings/jna/README.md) you can find a detailed tutorial on how to do that. -After that you can start loading an `KDB` object as follows: +After that you can start loading a `KDB` object as follows: ```java Key key = Key.create("user/kdbsession/javabinding"); @@ -20,13 +20,13 @@ try (KDB kdb = KDB.open(key)) { } ``` -Note that KDB implements `AutoClosable` which allows [try-with-resouces](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html). +Note that `KDB` implements `AutoClosable` which allows [try-with-resouces](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html). -You can also pass a `Key` object with an empty string on the first line. The passed key (`user/kdbsession/javabinding` in this case) is being used for the session and stores warnings and error informations. +You can also pass a `Key` object with an empty string on the first line. The passed key (`user/kdbsession/javabinding` in this case) is being used for the session and stores warnings and error information. ## Fetching keys -First I will show you how to get a key which was already saved in the database. The first thing we need to do is to create a `KeySet` in which our key(s) will be loaded. +First I will show you how you can retrieve a key which is already part of the database. The first thing we need to do is to create a `KeySet` in which our keys will be stored. ```java KeySet set = KeySet.create(); @@ -62,7 +62,7 @@ kdb.set(set, key); If you try to save a key without fetching it beforehand, a `KDBException` will be thrown, telling you to call get before set. The _user_ namespace is accessible without special rights, but if you try to write to _system_ you will need to have root -privileges. Check [this](/doc/TESTING.md) to see how to run as non-root user. This should only be done in testing +privileges. Take a look at [TESTING.md](/doc/TESTING.md) to see how to access the system namespace as non-root user. This should only be done in testing environments though as it is not intended for productive systems. ## Examples
clear nopaid share for each connection
@@ -955,6 +955,16 @@ static int precalculate_payments(uint64_t *hash, int confirmation_index, struct } pthread_mutex_unlock(&g_miners_mutex); + /* clear nopaid shares for each connection */ + pthread_mutex_lock(&g_descriptors_mutex); + connection_list_element *conn; + LL_FOREACH(g_connection_list_head, conn) + { + conn->connection_data.prev_diff = 0; + conn->connection_data.prev_diff_count = 0; + } + pthread_mutex_unlock(&g_descriptors_mutex); + if(data->sum > 0) { data->direct = data->balance * g_pool_direct; data->pay -= data->direct;
fixed git error - last commits are not uploaded correctly
@@ -3022,7 +3022,7 @@ while(channelscanlist[c] != 0) res = ioctl(fd_socket, SIOCSIWFREQ, &pwrq); if(res < 0) { - printf("warning: unable to set channel %d (%s) - removed this channel from scan list\n", channelscanlist[c], strerror(errno)); + printf("warning: failed to set channel %d (%s) - removed this channel from scan list\n", channelscanlist[c], strerror(errno)); remove_channel_from_scanlist(c); continue; } @@ -3033,7 +3033,7 @@ while(channelscanlist[c] != 0) res = ioctl(fd_socket, SIOCGIWFREQ, &pwrq); if(res < 0) { - printf("warning: unable to set channel %d (%s) - removed this channel from scan list\n", channelscanlist[c], strerror(errno)); + printf("warning: failed to set channel %d (%s) - removed this channel from scan list\n", channelscanlist[c], strerror(errno)); remove_channel_from_scanlist(c); continue; }
FreeBSD also uses these structs so do not hide them
@@ -183,7 +183,7 @@ typedef struct unw_tdep_save_loc } unw_tdep_save_loc_t; -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) /* On AArch64, we can directly use ucontext_t as the unwind context, * however, the __reserved struct is quite large: tune it down to only * the necessary used fields. */
Add comment link to github.com/cbor/test-vectors
@@ -25,6 +25,9 @@ package main // // The rfc7049-errata-corrected.txt file comes from // https://github.com/cbor/spec-with-errata-fixed +// +// In hindsight, it would have been easier to start from +// https://github.com/cbor/test-vectors import ( "bytes"
Docker: Fix `ronn` install in Debian buster image
@@ -10,9 +10,9 @@ RUN apt-get update && apt-get -y install \ RUN apt-get -y install \ doxygen \ graphviz \ + ronn \ ruby \ ruby-dev \ - ruby-ronn \ sloccount \ texlive-latex-base \ texlive-latex-recommended \
Start counting HTTP time from first line
@@ -603,6 +603,8 @@ static int http1_on_http_version(http1_parser_s *parser, char *version, size_t len) { http1_pr2handle(parser2http(parser)).version = fiobj_str_new(version, len); parser2http(parser)->header_size += len; + /* start counting - occurs on the first line of both requests and responses */ + http1_pr2handle(parser2http(parser)).received_at = fio_last_tick(); return 0; } /** called when a header is parsed. */
Add custom sig_info setting for RSA-PSS
@@ -785,6 +785,41 @@ static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, return 2; } +static int rsa_sig_info_set(X509_SIG_INFO *siginf, const X509_ALGOR *sigalg, + const ASN1_STRING *sig) +{ + int rv = 0; + int mdnid, saltlen; + uint32_t flags; + const EVP_MD *mgf1md = NULL, *md = NULL; + RSA_PSS_PARAMS *pss; + + /* Sanity check: make sure it is PSS */ + if (OBJ_obj2nid(sigalg->algorithm) != EVP_PKEY_RSA_PSS) + return 0; + /* Decode PSS parameters */ + pss = rsa_pss_decode(sigalg); + if (!rsa_pss_get_param(pss, &md, &mgf1md, &saltlen)) + goto err; + mdnid = EVP_MD_type(md); + /* + * For TLS need SHA256, SHA384 or SHA512, digest and MGF1 digest must + * match and salt length must equal digest size + */ + if ((mdnid == NID_sha256 || mdnid == NID_sha384 || mdnid == NID_sha512) + && mdnid == EVP_MD_type(mgf1md) && saltlen == EVP_MD_size(md)) + flags = X509_SIG_INFO_TLS; + else + flags = 0; + /* Note: security bits half number of digest bits */ + X509_SIG_INFO_set(siginf, mdnid, EVP_PKEY_RSA_PSS, EVP_MD_size(md) * 4, + flags); + rv = 1; + err: + RSA_PSS_PARAMS_free(pss); + return rv; +} + #ifndef OPENSSL_NO_CMS static RSA_OAEP_PARAMS *rsa_oaep_decode(const X509_ALGOR *alg) { @@ -972,7 +1007,9 @@ const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[2] = { old_rsa_priv_decode, old_rsa_priv_encode, rsa_item_verify, - rsa_item_sign}, + rsa_item_sign, + rsa_sig_info_set + }, { EVP_PKEY_RSA2,
doc: Trivial fixes Fix some issues in the documentation.
@@ -93,7 +93,7 @@ Memory We initially occupy a chunk of memory, "heap". We pass to the OS (Linux) a reservation of what we occupy (including stacks). -In the source file include/config.h we include a memory map. This is +In the source file include/mem-map.h we include a memory map. This is manually generated, not automatically generated. We use CCAN for a bunch of helper code, turning on things like DEBUG_LOCKS @@ -122,5 +122,5 @@ Skiboot log ----------- There is a circular log buffer that skiboot maintains. This can be -accessed either from the FSP or through /dev/mem or through a debugfs -patch that's currently floating around. +accessed either from the FSP or through /dev/mem or through the sysfs +file /sys/firmware/opal/msglog.
fix(kscan): Fix nibble demux scan errors on encoder row + Add a 1us sleep to let the column selection settle in order to avoid spurious keypresses when row capacitance is high (like on the encoder row)
@@ -113,6 +113,8 @@ struct kscan_gpio_item_config { &kscan_gpio_output_configs_##n(dev)[bit]; \ gpio_pin_set(out_dev, out_cfg->pin, state); \ } \ + /* Let the col settle before reading the rows */ \ + k_usleep(1); \ \ for (int i = 0; i < INST_MATRIX_INPUTS(n); i++) { \ /* Get the input device (port) */ \
SM5803: Add 2S battery inits Adding 2S battery inits from vendor, with check on platform ID to identify the 2S units. BRANCH=None TEST=make -j buildall
@@ -309,6 +309,40 @@ static void sm5803_init(int chgnum) rv |= chg_write8(chgnum, 0x7D, 0x67); rv |= chg_write8(chgnum, 0x7E, 0x04); + rv |= chg_write8(chgnum, 0x33, 0x3C); + } else if (platform_id >= 0x06 && platform_id <= 0x0D) { + /* 2S Battery inits */ + rv |= main_write8(chgnum, 0x30, 0xC0); + rv |= main_write8(chgnum, 0x80, 0x01); + rv |= main_write8(chgnum, 0x1A, 0x08); + + rv |= meas_write8(chgnum, 0x08, 0xC2); + + rv |= chg_write8(chgnum, 0x1D, 0x40); + + rv |= chg_write8(chgnum, 0x22, 0xB3); + + rv |= chg_write8(chgnum, 0x4F, 0xBF); + + rv |= chg_write8(chgnum, 0x52, 0x77); + rv |= chg_write8(chgnum, 0x53, 0xD2); + rv |= chg_write8(chgnum, 0x54, 0x02); + rv |= chg_write8(chgnum, 0x55, 0xD1); + rv |= chg_write8(chgnum, 0x56, 0x7F); + rv |= chg_write8(chgnum, 0x57, 0x02); + rv |= chg_write8(chgnum, 0x58, 0xD1); + rv |= chg_write8(chgnum, 0x59, 0x7F); + rv |= chg_write8(chgnum, 0x5A, 0x13); + rv |= chg_write8(chgnum, 0x5B, 0x50); + rv |= chg_write8(chgnum, 0x5D, 0xD0); + + rv |= chg_write8(chgnum, 0x60, 0x44); + rv |= chg_write8(chgnum, 0x65, 0x35); + rv |= chg_write8(chgnum, 0x66, 0x29); + + rv |= chg_write8(chgnum, 0x7D, 0x97); + rv |= chg_write8(chgnum, 0x7E, 0x07); + rv |= chg_write8(chgnum, 0x33, 0x3C); } }
whoismac: Tell if OUI is randomized and/or multicast!
@@ -339,6 +339,11 @@ static char *vendorptr; static unsigned long long int vendoroui; static char linein[LINEBUFFER]; static char vendorapname[256]; +#ifdef BIG_ENDIAN_HOST +int lsb = oui & 0xf; +#else +int lsb = (oui >> 16) & 0xf; +#endif if ((fhoui = fopen(ouiname, "r")) == NULL) { @@ -361,12 +366,15 @@ while((len = fgetline(fhoui, LINEBUFFER, linein)) != -1) if(vendorptr != NULL) { strncpy(vendorapname, vendorptr +1,255); + break; } } } } -fprintf(stdout, "\nVENDOR: %s\n\n", vendorapname); +fprintf(stdout, "\nVENDOR: %s (%s)%s\n\n", vendorapname, + oui == 0xffffff ? "broadcast" : lsb & 2 ? "LAA - likely randomized!" : "UAA", + oui == 0xffffff ? "" : lsb & 1 ? ", multicast" : ", unicast"); fclose(fhoui); return;
Update: example improvement
@@ -488,8 +488,8 @@ void NAR_Robot(long iterations) NAR_AddOperation(Narsese_AtomicTerm("^right"), NAR_Robot_Right); NAR_AddOperation(Narsese_AtomicTerm("^forward"), NAR_Robot_Forward); buildRooms(); - for(int i=0; i<23; i++) { spawnFood(false); } for(int i=0; i<23; i++) { spawnFood(true); } + for(int i=0; i<23; i++) { spawnFood(false); } long t=0; while(1) {
fix spelling errors for acrn-manager
@@ -33,7 +33,7 @@ acrn-crashlog-install: acrnlog-install: make -C $(T)/acrnlog OUT_DIR=$(OUT_DIR) install -arcn-manager-install: +acrn-manager-install: make -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) install acrntrace-install:
in_cpu: remove unused variables
@@ -159,7 +159,6 @@ static inline double proc_cpu_load(int cpus, struct cpu_stats *cstats) /* Retrieve CPU stats for a given PID */ static inline double proc_cpu_pid_load(pid_t pid, struct cpu_stats *cstats) { - int i; int ret; char *p; char line[255]; @@ -178,7 +177,6 @@ static inline double proc_cpu_pid_load(pid_t pid, struct cpu_stats *cstats) unsigned long ss_majflt; unsigned long ss_cmajflt; struct cpu_snapshot *s; - struct cpu_snapshot *snap_arr; /* Read the process stats */ snprintf(line, sizeof(line) - 1, "/proc/%d/stat", pid); @@ -208,6 +206,7 @@ static inline double proc_cpu_pid_load(pid_t pid, struct cpu_stats *cstats) p = line; while (*p != ')') p++; + errno = 0; ret = sscanf(p, fmt, &ss_state, @@ -225,6 +224,7 @@ static inline double proc_cpu_pid_load(pid_t pid, struct cpu_stats *cstats) &s->v_system); if (errno != 0) { flb_errno(); + flb_error("[in_cpu] pid sscanf failed ret=%i", ret); } fclose(f); @@ -419,7 +419,6 @@ static int cpu_collect_system(struct flb_input_instance *i_ins, static int cpu_collect_pid(struct flb_input_instance *i_ins, struct flb_config *config, void *in_context) { - int i; int ret; struct flb_in_cpu_config *ctx = in_context; struct cpu_stats *cstats = &ctx->cstats;
cdd_cue.c check sscanf's return value
@@ -42,7 +42,9 @@ static UINT32 getpos(const OEMCHAR *str) { UINT s; UINT f; - sscanf(str, "%2d:%2d:%2d", &m, &s, &f); + if (EOF == sscanf(str, "%2d:%2d:%2d", &m, &s, &f)) { + return 0; + } return((((m * 60) + s) * 75) + f); }
infer: fix typo on range check
@@ -2590,7 +2590,7 @@ checkrange(Node *n) sval = n->lit.intval; if (sval < svranges[t->type][0] || sval > svranges[t->type][1]) fatal(n, "literal value %lld out of range for type \"%s\"", sval, tystr(t)); - } else if ((t->type >= Tybyte && t->type <= Tyint64) || t->type == Tychar) { + } else if ((t->type >= Tybyte && t->type <= Tyuint64) || t->type == Tychar) { uval = n->lit.intval; if (uval < uvranges[t->type][0] || uval > uvranges[t->type][1]) fatal(n, "literal value %llu out of range for type \"%s\"", uval, tystr(t));
group-on-leave: soften de-path
[%remove g.i.entries m.i.entries] :: archive graph associated with group :: +=/ app-resource (de-path-soft:res app-path.m.i.entries) +?~ app-resource + loop(entries t.entries) ;< ~ bind:m %+ raw-poke [our.bowl %graph-store] :- %graph-update !> ^- update:gra - [%0 now.bowl [%archive-graph (de-path:res app-path.m.i.entries)]] + [%0 now.bowl [%archive-graph u.app-resource]] ;< ~ bind:m %+ raw-poke [our.bowl %graph-pull-hook] :- %pull-hook-action - !>([%remove (de-path:res app-path.m.i.entries)]) + !>([%remove u.app-resource]) loop(entries t.entries)
Fix MODULES for the CC2538 This commit fixes two bugs related to the usage of MODULES for CC2538-based platforms: * newlib is no longer under `lib/newlib` but under `os/lib/newlib`. * There is no such thing as `sys` under `arm/common`, so this module is removed.
@@ -76,7 +76,7 @@ CPU_STARTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES) CONTIKI_SOURCEFILES += $(USB_SOURCEFILES) -MODULES += lib/newlib arch/cpu/arm/common/sys +MODULES += os/lib/newlib .SECONDEXPANSION:
printer BUGFIX allow printing empty data trees As they often create a valid non-empty data file.
@@ -52,7 +52,7 @@ lyd_print_(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, i API LY_ERR lyd_print_all(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, int options) { - LY_CHECK_ARG_RET(NULL, out, root, !(options & LYD_PRINT_WITHSIBLINGS), LY_EINVAL); + LY_CHECK_ARG_RET(NULL, out, !(options & LYD_PRINT_WITHSIBLINGS), LY_EINVAL); /* reset the number of printed bytes */ out->func_printed = 0; @@ -74,7 +74,7 @@ lyd_print_all(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format API LY_ERR lyd_print_tree(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, int options) { - LY_CHECK_ARG_RET(NULL, out, root, !(options & LYD_PRINT_WITHSIBLINGS), LY_EINVAL); + LY_CHECK_ARG_RET(NULL, out, !(options & LYD_PRINT_WITHSIBLINGS), LY_EINVAL); /* reset the number of printed bytes */ out->func_printed = 0; @@ -91,7 +91,7 @@ lyd_print_mem(char **strp, const struct lyd_node *root, LYD_FORMAT format, int o LY_ERR ret; struct ly_out *out; - LY_CHECK_ARG_RET(NULL, strp, root, LY_EINVAL); + LY_CHECK_ARG_RET(NULL, strp, LY_EINVAL); /* init */ *strp = NULL; @@ -108,7 +108,7 @@ lyd_print_fd(int fd, const struct lyd_node *root, LYD_FORMAT format, int options LY_ERR ret; struct ly_out *out; - LY_CHECK_ARG_RET(NULL, fd != -1, root, LY_EINVAL); + LY_CHECK_ARG_RET(NULL, fd != -1, LY_EINVAL); LY_CHECK_RET(ly_out_new_fd(fd, &out)); ret = lyd_print_(out, root, format, options); @@ -122,7 +122,7 @@ lyd_print_file(FILE *f, const struct lyd_node *root, LYD_FORMAT format, int opti LY_ERR ret; struct ly_out *out; - LY_CHECK_ARG_RET(NULL, f, root, LY_EINVAL); + LY_CHECK_ARG_RET(NULL, f, LY_EINVAL); LY_CHECK_RET(ly_out_new_file(f, &out)); ret = lyd_print_(out, root, format, options); @@ -136,7 +136,7 @@ lyd_print_path(const char *path, const struct lyd_node *root, LYD_FORMAT format, LY_ERR ret; struct ly_out *out; - LY_CHECK_ARG_RET(NULL, path, root, LY_EINVAL); + LY_CHECK_ARG_RET(NULL, path, LY_EINVAL); LY_CHECK_RET(ly_out_new_filepath(path, &out)); ret = lyd_print_(out, root, format, options); @@ -151,7 +151,7 @@ lyd_print_clb(ssize_t (*writeclb)(void *arg, const void *buf, size_t count), voi LY_ERR ret; struct ly_out *out; - LY_CHECK_ARG_RET(NULL, writeclb, root, LY_EINVAL); + LY_CHECK_ARG_RET(NULL, writeclb, LY_EINVAL); LY_CHECK_RET(ly_out_new_clb(writeclb, arg, &out)); ret = lyd_print_(out, root, format, options);
Remove gcc unrecognized option '-msched-weight' when check msa
@@ -199,7 +199,7 @@ if (($architecture eq "mips") || ($architecture eq "mips64")) { } else { $tmpf = new File::Temp( SUFFIX => '.c' , UNLINK => 1 ); $code = '"addvi.b $w0, $w1, 1"'; - $msa_flags = "-mmsa -mfp64 -msched-weight -mload-store-pairs"; + $msa_flags = "-mmsa -mfp64 -mload-store-pairs"; print $tmpf "#include <msa.h>\n\n"; print $tmpf "void main(void){ __asm__ volatile($code); }\n";
fix(setup.sh): rename to Replaces BF0 (zero) with BFO. Refs: PR:
@@ -91,7 +91,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "NIBBLE" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!" "BF0-9000" "Helix") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "NIBBLE" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!" "BFO-9000" "Helix") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
mangle: use more 'Shrink's
@@ -782,21 +782,31 @@ static void mangle_Resize(run_t* run, bool printable) { input_setSize(run, (size_t)newsz); if (newsz > oldsz) { if (printable) { - memset(&run->dynfile->data[oldsz], 'A', newsz - oldsz); + memset(&run->dynfile->data[oldsz], ' ', newsz - oldsz); } } } void mangle_mangleContent(run_t* run, unsigned slow_factor) { static void (*const mangleFuncs[])(run_t * run, bool printable) = { + /* Every *Insert or Expand expands file, so add one Shrink for each */ + mangle_Shrink, + mangle_Shrink, + mangle_Shrink, + mangle_Shrink, + mangle_Shrink, + mangle_Shrink, + mangle_Shrink, + mangle_Shrink, + mangle_Shrink, + mangle_Shrink, + mangle_Expand, mangle_Bit, mangle_IncByte, mangle_DecByte, mangle_NegByte, mangle_AddSub, mangle_MemSet, - mangle_Expand, - mangle_Shrink, mangle_MemCopyOverwrite, mangle_MemCopyInsert, mangle_BytesOverwrite,
metadata-store: do not discard preview parameter
color color.m date-created date-created.m creator creator.m - preview %.n + preview preview.m :: module ?: =(module.m %$)
libusb: add STM32F765xx define
#endif #define usbd_hw usbd_otgfs -#elif defined(STM32F446xx) || defined(STM32F722xx) || defined (STM32F745xx) +#elif defined(STM32F446xx) || defined(STM32F722xx) || defined (STM32F745xx) || defined (STM32F765xx) #define USBD_STM32F446FS #define USBD_STM32F446HS
IAS clear ENROLL_RESPONSE and WRITE_CIE_ADDR in status change notify To don't let the machine get stuck in this state.
@@ -257,6 +257,8 @@ void DeRestPluginPrivate::handleIasZoneClusterIndication(const deCONZ::ApsDataIn const NodeValue::UpdateType updateType = NodeValue::UpdateByZclReport; processIasZoneStatus(sensor, zoneStatus, updateType); + R_ClearFlags(sensor->item(RConfigPending), R_PENDING_ENROLL_RESPONSE | R_PENDING_WRITE_CIE_ADDRESS); + sensor->updateStateTimestamp(); enqueueEvent(Event(RSensors, RStateLastUpdated, sensor->id())); updateEtag(sensor->etag);
freemodbus: fix memcmp result truncated to 1 byte Coverity ID: 291158
@@ -361,7 +361,7 @@ static esp_err_t mbc_serial_master_set_request(char* name, mb_param_mode_t mode, continue; // The length of strings is different then check next record in the table } // Compare the name of parameter with parameter key from table - uint8_t comp_result = memcmp((const char*)name, (const char*)reg_ptr->param_key, (size_t)param_key_len); + int comp_result = memcmp((const void*)name, (const void*)reg_ptr->param_key, (size_t)param_key_len); if (comp_result == 0) { // The correct line is found in the table and reg_ptr points to the found parameter description request->slave_addr = reg_ptr->mb_slave_addr;
Remove OLD_STR_TO_KEY compile option This flag was added in 1992 and only documented in the CHANGES file.
@@ -17,10 +17,6 @@ void DES_string_to_key(const char *str, DES_cblock *key) memset(key, 0, 8); length = strlen(str); -#ifdef OLD_STR_TO_KEY - for (i = 0; i < length; i++) - (*key)[i % 8] ^= (str[i] << 1); -#else /* MIT COMPATIBLE */ for (i = 0; i < length; i++) { register unsigned char j = str[i]; @@ -34,7 +30,6 @@ void DES_string_to_key(const char *str, DES_cblock *key) (*key)[7 - (i % 8)] ^= j; } } -#endif DES_set_odd_parity(key); DES_set_key_unchecked(key, &ks); DES_cbc_cksum((const unsigned char *)str, key, length, &ks, key); @@ -50,20 +45,6 @@ void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2) memset(key1, 0, 8); memset(key2, 0, 8); length = strlen(str); -#ifdef OLD_STR_TO_KEY - if (length <= 8) { - for (i = 0; i < length; i++) { - (*key2)[i] = (*key1)[i] = (str[i] << 1); - } - } else { - for (i = 0; i < length; i++) { - if ((i / 8) & 1) - (*key2)[i % 8] ^= (str[i] << 1); - else - (*key1)[i % 8] ^= (str[i] << 1); - } - } -#else /* MIT COMPATIBLE */ for (i = 0; i < length; i++) { register unsigned char j = str[i]; @@ -84,7 +65,6 @@ void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2) } if (length <= 8) memcpy(key2, key1, 8); -#endif DES_set_odd_parity(key1); DES_set_odd_parity(key2); DES_set_key_unchecked(key1, &ks);
runner: remove unused log helpers
@@ -120,8 +120,6 @@ void tcmur_handler_init(void); */ int tcmur_register_handler(struct tcmur_handler *handler); bool tcmur_unregister_handler(struct tcmur_handler *handler); -void dbgp(const char *fmt, ...); -void errp(const char *fmt, ...); #ifdef __cplusplus }
Fixing UDP bandwidth issue In the UDP probe module, packet length was set in the per thread initialization instead of global causing -B option to send at incorrect packet rate. Also default packet length was 1, so changed to the maximum to let it fail slower rather than faster.
@@ -226,6 +226,12 @@ int udp_global_initialize(struct state_conf *conf) MAX_UDP_PAYLOAD_LEN, udp_send_msg_len); udp_send_msg_len = MAX_UDP_PAYLOAD_LEN; } + + module_udp.packet_length = sizeof(struct ether_header) + + sizeof(struct ip) + sizeof(struct udphdr) + + udp_send_msg_len; + assert(module_udp.packet_length <= MAX_PACKET_SIZE); + free(args); return EXIT_SUCCESS; } @@ -264,10 +270,6 @@ int udp_init_perthread(void *buf, macaddr_t *src, macaddr_t *gw, char *payload = (char *)(&udp_header[1]); - module_udp.packet_length = sizeof(struct ether_header) + - sizeof(struct ip) + sizeof(struct udphdr) + - udp_send_msg_len; - assert(module_udp.packet_length <= MAX_PACKET_SIZE); memcpy(payload, udp_send_msg, udp_send_msg_len); // Seed our random number generator with the global generator @@ -874,7 +876,8 @@ static fielddef_t fields[] = { probe_module_t module_udp = { .name = "udp", - .packet_length = 1, + .packet_length = sizeof(struct ether_header) + sizeof(struct ip) + + sizeof(struct udphdr) + MAX_UDP_PAYLOAD_LEN, .pcap_filter = "udp || icmp", .pcap_snaplen = 1500, .port_args = 1,
jna: update Elektra to 0.9.6 in docs
@@ -69,7 +69,7 @@ Simply add libelektra as dependency using: <dependency> <groupId>org.libelektra</groupId> <artifactId>libelektra</artifactId> - <version>0.9.5</version> + <version>0.9.6</version> </dependency> ``` @@ -86,7 +86,7 @@ repositories { } dependencies { - implementation "org.libelektra:libelektra:0.9.5" + implementation "org.libelektra:libelektra:0.9.6" } ```
Shell ping command: print out delay
static struct uip_icmp6_echo_reply_notification echo_reply_notification; static shell_output_func *curr_ping_output_func = NULL; static struct process *curr_ping_process; +static uint8_t curr_ping_ttl; +static uint16_t curr_ping_datalen; /*---------------------------------------------------------------------------*/ static void echo_reply_handler(uip_ipaddr_t *source, uint8_t ttl, uint8_t *data, uint16_t datalen) { if(curr_ping_output_func != NULL) { - SHELL_OUTPUT(curr_ping_output_func, "Received ping reply from "); - shell_output_6addr(curr_ping_output_func, source); - SHELL_OUTPUT(curr_ping_output_func, ", ttl %u, len %u\n", ttl, datalen); curr_ping_output_func = NULL; + curr_ping_ttl = ttl; + curr_ping_datalen = datalen; process_poll(curr_ping_process); } } @@ -111,6 +112,11 @@ PT_THREAD(cmd_ping(struct pt *pt, shell_output_func output, char *args)) if(curr_ping_output_func != NULL) { SHELL_OUTPUT(output, "Timeout\n"); curr_ping_output_func = NULL; + } else { + SHELL_OUTPUT(output, "Received ping reply from "); + shell_output_6addr(output, &remote_addr); + SHELL_OUTPUT(output, ", len %u, ttl %u, delay %u ms\n", + curr_ping_datalen, curr_ping_ttl, (1000*(unsigned)(clock_time() - timeout_timer.timer.start))/CLOCK_SECOND); } PT_END(pt);
use rtlgenrandom by default on windows
@@ -167,8 +167,9 @@ If we cannot get good randomness, we fall back to weak randomness based on a tim #if defined(_WIN32) -#if !defined(MI_USE_RTLGENRANDOM) -// We prefer BCryptGenRandom over RtlGenRandom +#if defined(MI_USE_BCRYPTGENRANDOM) +// We would like to use BCryptGenRandom instead of RtlGenRandom but it can lead to a deadlock +// under the VS debugger when using dynamic overriding. #pragma comment (lib,"bcrypt.lib") #include <bcrypt.h> static bool os_random_buf(void* buf, size_t buf_len) {
os/tools/mkbinheader : Rename value name for readability XXX_S is difficult to understand as size. Let's rename value name for readability.
@@ -54,17 +54,16 @@ binary_ram_size = sys.argv[6] # This path is only for dbuild. tinyara_path = 'root/tizenrt/build/output/bin/tinyara' -START = 0 -HEADER_SIZE_S = 2 -BINARY_TYPE_S = 2 -BINARY_SIZE_S = 4 -BINARY_NAME_S = 16 -BINARY_VERSION_S = 16 -BINARY_RAM_SIZE_S = 4 -KERNEL_VERSION_S = 8 -JUMP_ADDRESS_S = 4 +SIZE_OF_HEADERSIZE = 2 +SIZE_OF_BINTYPE = 2 +SIZE_OF_BINSIZE = 4 +SIZE_OF_BINNAME = 16 +SIZE_OF_BINVER = 16 +SIZE_OF_BINRAMSIZE = 4 +SIZE_OF_KERNELVER = 8 +SIZE_OF_JUMPADDR = 4 -header_size = HEADER_SIZE_S + BINARY_TYPE_S + BINARY_SIZE_S + BINARY_NAME_S + BINARY_VERSION_S + KERNEL_VERSION_S + BINARY_RAM_SIZE_S + JUMP_ADDRESS_S +header_size = SIZE_OF_HEADERSIZE + SIZE_OF_BINTYPE + SIZE_OF_BINSIZE + SIZE_OF_BINNAME + SIZE_OF_BINVER + SIZE_OF_BINRAMSIZE + SIZE_OF_KERNELVER + SIZE_OF_JUMPADDR ELF = 1 BIN = 2 @@ -87,10 +86,10 @@ with open(file_path, 'rb') as fp: fp.write(struct.pack('h', bin_type)) fp.write(struct.pack('I', file_size)) - fp.write('{:{}{}.{}}'.format(binary_name, '<', BINARY_NAME_S, BINARY_NAME_S - 1).replace(' ','\0')) - fp.write('{:{}{}.{}}'.format(binary_ver, '<', BINARY_VERSION_S, BINARY_VERSION_S - 1).replace(' ','\0')) + fp.write('{:{}{}.{}}'.format(binary_name, '<', SIZE_OF_BINNAME, SIZE_OF_BINNAME - 1).replace(' ','\0')) + fp.write('{:{}{}.{}}'.format(binary_ver, '<', SIZE_OF_BINVER, SIZE_OF_BINVER - 1).replace(' ','\0')) fp.write(struct.pack('I', int(binary_ram_size))) - fp.write('{:{}{}.{}}'.format(kernel_ver, '<', KERNEL_VERSION_S, KERNEL_VERSION_S - 1).replace(' ','\0')) + fp.write('{:{}{}.{}}'.format(kernel_ver, '<', SIZE_OF_KERNELVER, SIZE_OF_KERNELVER - 1).replace(' ','\0')) # parsing _vector_start address from elf information. # _vector_start is only for ARM architecture. so it
options/linux-headers: Add missing constant to input-event-codes
#define EVIOCGVERSION _IOR('E', 0x01, int) #define EVIOCGID _IOR('E', 0x02, struct input_id) +#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) #define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len)
Fix formatting typo in samples readme.
Instructions on how to build these sample files: -Install a common set of build tools such as [Microsoft Visual Studio] -(https://visualstudio.microsoft.com/vs/community/). +Install a common set of build tools such as [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/community/). This will be used by Conan. [Install Conan](https://docs.conan.io/en/latest/installation.html).
turn on AOMP_BUILD_CUDA for standalone build. It will be off when doing the Integrated ROCm build
@@ -33,16 +33,25 @@ CUDABIN=${CUDABIN:-$CUDA/bin} AOMP_CMAKE=${AOMP_CMAKE:-cmake} AOMP_PROC=`uname -p` -if [ "$AOMP_PROC" == "aarch64" ] ; then - AOMP_BUILD_CUDA=0 -fi -# Default is to NOT build for nvptx -# Set AOMP_BUILD_CUDA to 1 to override default + +AOMP_STANDALONE_BUILD=${AOMP_STANDALONE_BUILD:-1} + +# The logic for turning on CUDA build is here +if [ $AOMP_STANDALONE_BUILD == 1 ] ; then + # Default is to build nvptx for STANDALONE build + AOMP_BUILD_CUDA=${AOMP_BUILD_CUDA:-1} +else + # Default is to NOT build nvptx for ROCm integrated build AOMP_BUILD_CUDA=${AOMP_BUILD_CUDA:-0} -# When default is changed to 1, still turn it off if no cuda installed +fi +# Regardless, turn off AOMP_BUILD_CUDA if CUDA not available if [ ! -d "$CUDABIN" ] ; then AOMP_BUILD_CUDA=0 fi +# Regardless, turn off AOMP_BUILD_CUDA for arm +if [ "$AOMP_PROC" == "aarch64" ] ; then + AOMP_BUILD_CUDA=0 +fi # Set list of default nvptx subarchitectures to build # Only Cuda 9 and above supports sm_70 @@ -156,7 +165,6 @@ fi # Here is where we define different behaviors for STANDALONE build # and the new ROCm integrated build. The default is STANDALONE build. -AOMP_STANDALONE_BUILD=${AOMP_STANDALONE_BUILD:-1} if [ $AOMP_STANDALONE_BUILD == 1 ] ; then # Standalone build gets ROCm components from the AOMP Installation. # As a result their is an order to component builds.
test-ipmi-hiomap: Add get-flash-info-malformed tests Cc: stable
@@ -1818,6 +1818,68 @@ static void test_hiomap_get_info_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_get_flash_info_malformed_small[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 5, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_get_flash_info_malformed_small(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_get_flash_info_malformed_small); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + +static const struct scenario_event +scenario_hiomap_get_flash_info_malformed_large[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 7, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_get_flash_info_malformed_large(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_get_flash_info_malformed_large); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1861,6 +1923,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_ack_malformed_large), TEST_CASE(test_hiomap_get_info_malformed_small), TEST_CASE(test_hiomap_get_info_malformed_large), + TEST_CASE(test_hiomap_get_flash_info_malformed_small), + TEST_CASE(test_hiomap_get_flash_info_malformed_large), { NULL, NULL }, };
libbarrelfish: heap: correctly determine number of page to allocate in internal morecore
@@ -150,7 +150,7 @@ union heap_header *heap_default_morecore(struct heap *heap, unsigned nu) BASE_PAGE_SIZE); // Allocate requested number of pages and insert freelist header - up = (union heap_header*)pages_alloc(nb / BASE_PAGE_SIZE); + up = (union heap_header*)pages_alloc(DIVIDE_ROUND_UP(nb, BASE_PAGE_SIZE)); up->s.size = nb / sizeof(union heap_header); // Add header to freelist
term: ensure spinner is drawn on the bottom line That's the one line we track. If it gets drawn anywhere else, we can't restore the overwritten contents.
@@ -1037,8 +1037,14 @@ _term_spin_step(u3_utty* uty_u) // One-time cursor backoff. // if ( c3n == tat_u->sun_u.diz_o ) { - c3_w i_w; + // if we know where the bottom line is, and the cursor is not on it, + // move it to the bottom left + // + if ( tat_u->siz.row_l && tat_u->mir.rus_w > 0 ) { + _term_it_send_csi(uty_u, 'H', 2, tat_u->siz.row_l, 0); + } + c3_w i_w; for ( i_w = bac_w; i_w < sol_w; i_w++ ) { if ( lef_u.len != write(fid_i, lef_u.base, lef_u.len) ) { return;
workflows: fix renamed perf-test call
@@ -13,7 +13,7 @@ jobs: pr-perf-test-run: # We only need to test this once as the rest are chained from it. if: contains(github.event.pull_request.labels.*.name, 'ok-to-performance-test') - uses: fluent/fluent-bit-ci/.github/workflows/call-run-test.yaml@main + uses: fluent/fluent-bit-ci/.github/workflows/call-run-performance-test.yaml@main with: vm-name: fb-perf-test-pr-${{ github.event.number }} git-branch: ${{ github.head_ref }}
h2olog: set up one of the tracer functions
@@ -26,8 +26,20 @@ struct req_line_t { char header_name[MAX_STR_LEN]; char header_value[MAX_STR_LEN]; }; +BPF_PERF_OUTPUT(reqbuf); int trace_receive_req(void *ctx) { + struct req_line_t line = {}; + uint64_t conn_id, req_id; + uint32_t http_version; + + bpf_usdt_readarg(1, ctx, &line.conn_id); + bpf_usdt_readarg(2, ctx, &line.req_id); + bpf_usdt_readarg(3, ctx, &line.http_version); + + if (reqbuf.perf_submit(ctx, &line, sizeof(line)) < 0) + bpf_trace_printk("failed to perf_submit\\n"); + return 0; } @@ -54,3 +66,10 @@ u.enable_probe(probe="receive_request", fn_name="trace_receive_req") u.enable_probe(probe="receive_request_header", fn_name="trace_receive_req_header") b = BPF(text=bpf, usdt_contexts=[u]) +b["reqbuf"].open_perf_buffer(None) + +while 1: + try: + b.perf_buffer_poll() + except KeyboardInterrupt: + exit()
[software] Add riscv unit test for LR/SC
@@ -22,8 +22,7 @@ rv32ui_snitch_sc_tests = \ # fence_i rv32ua_snitch_sc_tests = \ - amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoxor_w amoswap_w - # lrsc + amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoxor_w amoswap_w lrsc rv32um_snitch_sc_tests = \ div divu \
Fix buffer overflow and prevent recv() of 0 byte
@@ -540,10 +540,8 @@ static int proxy_backend_drive_machine(mcp_backend_t *be, int bread, char **rbuf if (r->status != MCMC_OK) { P_DEBUG("%s: mcmc_read failed [%d]\n", __func__, r->status); if (r->status == MCMC_WANT_READ) { - flags |= EV_READ; - be->state = mcp_backend_read; - stop = true; - break; + *rbuf = mcmc_read_prep(be->client, be->rbuf, READ_BUFFER_SIZE, toread); + return EV_READ; } else { flags = -1; stop = true; @@ -649,6 +647,7 @@ static int proxy_backend_drive_machine(mcp_backend_t *be, int bread, char **rbuf // if not, the stack is desynced and we lose it. r->status = mcmc_parse_buf(be->client, be->rbuf, bread, &tmp_resp); + bread = 0; P_DEBUG("%s [read_end]: r->status: %d, bread: %d resp.type:%d\n", __func__, r->status, bread, tmp_resp.type); if (r->status != MCMC_OK) { if (r->status == MCMC_WANT_READ) {