message
stringlengths 6
474
| diff
stringlengths 8
5.22k
|
---|---|
odissey: INTERNALS.md: add cleanup details | @@ -126,13 +126,21 @@ wait for reply to compare passwords. In case of success send `AuthenticationOk`.
Depending on selected route storage type, do `local` (console) or `remote` (remote PostgreSQL server) processing.
-Following remote processing logic repeats until client sends `Terminate`, client or server disconnects during the process:
+Following remote processing logic repeats until client sends `Terminate`,
+client or server disconnects during the process:
* Read client request. Handle `Terminate`.
-* If client has no server attached, call Router to assign server from the server pool.
+* If client has no server attached, call Router to assign server from the server pool. New server connection registered and
+initiated by the client coroutine (relay thread). Maybe discard previous server settings and configure it using client parameters.
* Send client request to the server.
* Wait for server reply.
* Send reply to client.
* In case of `Transactional` pooling: if transaction completes, call Router to detach server from the client.
+* Repeat.
#### 6. Cleanup
+
+If server is not Ready (query still in-progress), initiate automatic `Cancel` procedure. If server is Ready and left in active transaction,
+initiate automatic `Rollback`. Return server back to server pool or disconnect.
+
+Free client context.
|
Add detection of tcc compiler to tool script | @@ -163,6 +163,8 @@ if cc_vers=$(echo -e '#ifndef __clang__\n#error Not found\n#endif\n__clang_major
fi
elif cc_vers=$(echo -e '#ifndef __GNUC__\n#error Not found\n#endif\n__GNUC__.__GNUC_MINOR__.__GNUC_PATCHLEVEL__' | "$cc_exe" -E -xc - 2>/dev/null | tail -n 1 | tr -d '\040'); then
cc_id=gcc
+elif cc_vers=$(echo -e '#ifndef __TINYC__\n#error Not found\n#endif\n__TINYC__' | "$cc_exe" -E -xc - 2>/dev/null | tail -n 1 | tr -d '\040'); then
+ cc_id=tcc
fi
if [[ -z $cc_id ]]; then
|
Now without memory leaks | @@ -59,19 +59,26 @@ void Scripting::HandleOverridenFunction(RED4ext::IScriptable* apContext, RED4ext
// Nasty way of popping all args
for (auto& pArg : apCookie->FunctionDefinition->params)
{
- char holder[1 << 12];
+ auto* pType = pArg->type;
+ auto* pAllocator = pType->GetAllocator();
+
+ auto* pInstance = pAllocator->Alloc(pType->GetSize()).memory;
+ pType->Init(pInstance);
RED4ext::CStackType arg;
arg.type = pArg->type;
- arg.value = holder;
+ arg.value = pInstance;
apFrame->unk30 = 0;
apFrame->unk38 = 0;
const auto opcode = *(apFrame->code++);
- GetScriptCallArray()[opcode](apFrame->context, apFrame, holder, nullptr);
+ GetScriptCallArray()[opcode](apFrame->context, apFrame, pInstance, nullptr);
apFrame->code++; // skip ParamEnd
args.push_back(ToLua(apCookie->pScripting->m_lua, arg));
+
+ pType->Destroy(pInstance);
+ pAllocator->Free(pInstance);
}
const auto result = apCookie->ScriptFunction(as_args(args), apCookie->Environment);
|
restore __TIC_MACOSX__ define | #define TIC_BUILD_WITH_WREN 1
#if defined(__APPLE__)
+// TODO: this disables macos config
# include "AvailabilityMacros.h"
# include "TargetConditionals.h"
-# ifndef TARGET_OS_IPHONE
+// # ifndef TARGET_OS_IPHONE
# undef __TIC_MACOSX__
# define __TIC_MACOSX__ 1
# if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
# error SDL for Mac OS X only supports deploying on 10.6 and above.
# endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */
-# endif /* TARGET_OS_IPHONE */
+// # endif /* TARGET_OS_IPHONE */
#endif /* defined(__APPLE__) */
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
DEPRECATED rename-command config in sentinel
Clients could use this config in sentinel only when they already add rename-command in the redis conf file,
but becuase in Redis instance, we already DEPRECATED rename-command config,
thus we should deprecate this in the sentinel part as well. | @@ -286,7 +286,9 @@ sentinel failover-timeout mymaster 180000
sentinel deny-scripts-reconfig yes
-# REDIS COMMANDS RENAMING
+# REDIS COMMANDS RENAMING (DEPRECATED)
+#
+# WARNING: avoid using this option if possible, instead use ACLs.
#
# Sometimes the Redis server has certain commands, that are needed for Sentinel
# to work correctly, renamed to unguessable strings. This is often the case
|
gpcloud: regress: update outputing syntax | @@ -38,7 +38,7 @@ INSERT INTO s3write_mixedfmt_write_txt2 (date, time, status, sample1, sample2, v
-- mixed formats, should fail
SELECT * FROM s3write_mixedfmt_read;
ERROR: missing data for column "time" (seg1 slice1 gpdb4dev:40001 pid=17945)
-DETAIL: External table s3write_mixedfmt_read, line 1 of s3://s3-us-west-2.amazonaws.com/s3write.pivotal.io/regress/s3write/20160824-BAJVJZel/mixedfmt/ config=/home/gpadmin/s3.conf: "2016-07-28 12:00:00 t 0.5 0.3 3"
+DETAIL: External table s3write_mixedfmt_read, line 1 of s3://s3-us-west-2.amazonaws.com/@write_prefix@/mixedfmt/ config=@config_file@: "2016-07-28 12:00:00 t 0.5 0.3 3"
DROP EXTERNAL TABLE IF EXISTS s3write_mixedfmt_read;
DROP EXTERNAL TABLE IF EXISTS s3write_mixedfmt_write_csv;
DROP EXTERNAL TABLE IF EXISTS s3write_mixedfmt_write_txt;
|
py/persistentcode: Ensure prelude_offset is always initialised. | @@ -337,7 +337,7 @@ STATIC mp_raw_code_t *load_raw_code(mp_reader_t *reader, qstr_window_t *qw) {
byte *ip2;
bytecode_prelude_t prelude = {0};
#if MICROPY_EMIT_MACHINE_CODE
- size_t prelude_offset;
+ size_t prelude_offset = 0;
mp_uint_t type_sig = 0;
size_t n_qstr_link = 0;
#endif
|
CLEANUP: added do_node_item_set_state() function. | @@ -132,8 +132,7 @@ static int compare_cont_item(const void *t1, const void *t2)
else return 0;
}
-static int gen_node_continuum(struct cont_item *continuum,
- const char *node_name, uint8_t slice_state)
+static int gen_node_continuum(struct cont_item *continuum, const char *node_name)
{
char buffer[MAX_NODE_NAME_LENGTH+1] = "";
int length;
@@ -151,7 +150,6 @@ static int gen_node_continuum(struct cont_item *continuum,
| ((uint32_t) (digest[1 + nn * NUM_PER_HASH] & 0xFF) << 8)
| ( (digest[0 + nn * NUM_PER_HASH] & 0xFF) );
/* continuum[pp].nindex : will be set later */
- continuum[pp].sstate = slice_state;
}
}
@@ -235,14 +233,23 @@ static void do_node_free_list_destroy(struct cluster_config *config)
}
}
+static void do_node_item_set_state(struct node_item *item,
+ uint8_t node_state, uint8_t slice_state)
+{
+ item->nstate = node_state;
+ for (int i = 0; i < NUM_NODE_HASHES; i++) {
+ item->hslice[i].sstate = slice_state;
+ }
+}
+
static void do_node_item_init(struct node_item *item, const char *node_name,
uint8_t node_state, uint8_t slice_state)
{
strncpy(item->ndname, node_name, MAX_NODE_NAME_LENGTH);
- item->nstate = node_state;
item->refcnt = 0;
- item->dup_hp = gen_node_continuum(item->hslice, item->ndname, slice_state);
+ item->dup_hp = gen_node_continuum(item->hslice, item->ndname);
item->flags = 0;
+ do_node_item_set_state(item, node_state, slice_state);
}
static void do_self_node_build(struct cluster_config *config, const char *node_name)
|
It's not an error if the socket was closed by the protocol
(Don't report a superfluous HTTP parser error). | @@ -554,7 +554,7 @@ static int http1_on_request(http1_parser_s *parser) {
if (p->request.method && !p->stop)
http_finish(&p->request);
h1_reset(p);
- return fio_is_closed(p->p.uuid);
+ return !p->close && fio_is_closed(p->p.uuid);
}
/** called when a response was received. */
static int http1_on_response(http1_parser_s *parser) {
@@ -563,7 +563,7 @@ static int http1_on_response(http1_parser_s *parser) {
if (p->request.status_str && !p->stop)
http_finish(&p->request);
h1_reset(p);
- return fio_is_closed(p->p.uuid);
+ return !p->close && fio_is_closed(p->p.uuid);
}
/** called when a request method is parsed. */
static int http1_on_method(http1_parser_s *parser, char *method,
@@ -666,8 +666,9 @@ static int http1_on_body_chunk(http1_parser_s *parser, char *data,
/** called when a protocol error occurred. */
static int http1_on_error(http1_parser_s *parser) {
- FIO_LOG_DEBUG("HTTP parser error at HTTP/1.1 buffer position %zu",
- parser->state.next - parser2http(parser)->buf);
+ FIO_LOG_DEBUG("HTTP parser error at HTTP/1.1 buffer position %zu/%zu",
+ parser->state.next - parser2http(parser)->buf,
+ parser2http(parser)->buf_len);
fio_close(parser2http(parser)->p.uuid);
return -1;
}
@@ -775,6 +776,7 @@ static void http1_on_data_first_time(intptr_t uuid, fio_protocol_s *protocol) {
/* ensure future reads skip this first time HTTP/2.0 test */
p->p.protocol.on_data = http1_on_data;
+ /* Test fot HTTP/2.0 pre-knowledge */
if (i >= 24 && !memcmp(p->buf, "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n", 24)) {
FIO_LOG_WARNING("client claimed unsupported HTTP/2 prior knowledge.");
fio_close(uuid);
|
remove old run stuff | @@ -27,22 +27,4 @@ clean:
cd examples ; make clean
rm -f runtime/closure_templates.h runtime/contgen image fs
-# file=image,if=none,id=virtio-disk0,format=raw,cache=none,aio=native
-
-# could really be nice if BOOT and STORAGE could be the same disk
-BOOT = -boot c -drive file=image,format=raw,if=ide
-STORAGE = -drive file=image,format=raw,if=virtio
-TAP = -netdev tap,id=n0,ifname=tap0,script=no,downscript=no
-NET = -device virtio-net,mac=7e:b8:7e:87:4a:ea,netdev=n0 $(TAP)
-KVM = -enable-kvm
-DISPLAY = -display none -serial stdio
-
-run-nokvm: image
- - qemu-system-x86_64 $(BOOT) $(DISPLAY) -m 2G -device isa-debug-exit $(STORAGE)
-
-run: image
- - qemu-system-x86_64 $(BOOT) $(DISPLAY) -m 2G -device isa-debug-exit $(STORAGE) $(NET) $(KVM)
-
-runnew: image image2
- - ~/qemu/x86_64-softmmu/qemu-system-x86_64 -hda image $(DISPLAY) -m 2G -device isa-debug-exit $(STORAGE) $(NET) $(KVM)
|
fixed essid_len in qsort | @@ -111,7 +111,7 @@ else if(memcmp(ia->mac_sta.addr, ib->mac_sta.addr, 6) < 0)
return -1;
if(memcmp(ia->essid, ib->essid, 32) > 0)
return 1;
-else if(memcmp(ia->essid, ib->essid, 6) < 0)
+else if(memcmp(ia->essid, ib->essid, 32) < 0)
return -1;
return 0;
}
|
drivers/video: fix typo
Wrong buf used | @@ -1276,7 +1276,7 @@ static int video_qbuf(FAR struct video_mng_s *vmng,
container->buf.length = get_bufsize(&type_inf->fmt[VIDEO_FMT_MAIN]);
container->buf.m.userptr = (unsigned long)(type_inf->bufheap +
- buf->length * buf->index);
+ container->buf.length * buf->index);
}
video_framebuff_queue_container(&type_inf->bufinf, container);
|
bench: some cleanups to netbench and allow multiple rounds of measurement | @@ -223,7 +223,7 @@ std::vector<double> PoissonWorker(rt::UdpConn *c, double req_rate,
return timings;
}
-void RunExperiment(double req_rate, double service_time) {
+std::vector<double> RunExperiment(double req_rate, double *reqs_per_sec) {
std::unique_ptr<rt::UdpConn> c(rt::UdpConn::Dial({0, 0}, raddr));
if (c == nullptr) panic("couldn't establish control connection");
@@ -298,9 +298,25 @@ void RunExperiment(double req_rate, double service_time) {
timings.insert(timings.end(), v.begin(), v.end());
}
- // Report statistics.
+ // Report results.
double elapsed = std::chrono::duration_cast<sec>(finish - start).count();
- double reqs_per_sec = static_cast<double>(total) / elapsed * 1000000;
+ *reqs_per_sec = static_cast<double>(total) / elapsed * 1000000;
+ return timings;
+}
+
+void DoExperiment(double req_rate) {
+ constexpr int kRounds = 1;
+ std::vector<double> timings;
+ double reqs_per_sec = 0;
+ for (int i = 0; i < kRounds; i++) {
+ double tmp;
+ auto t = RunExperiment(req_rate, &tmp);
+ timings.insert(timings.end(), t.begin(), t.end());
+ reqs_per_sec += tmp;
+ rt::Sleep(500 * rt::kMilliseconds);
+ }
+ reqs_per_sec /= kRounds;
+
std::sort(timings.begin(), timings.end());
double sum = std::accumulate(timings.begin(), timings.end(), 0.0);
double mean = sum / timings.size();
@@ -325,9 +341,8 @@ void RunExperiment(double req_rate, double service_time) {
}
void ClientHandler(void *arg) {
- for (double i = 10000; i <= 4000000; i += 10000) {
- RunExperiment(i, 10);
- }
+ for (double i = 10000; i <= 4000000; i += 10000)
+ DoExperiment(i);
}
int StringToAddr(const char *str, uint32_t *addr) {
|
include/hooks.h: Format with clang-format
BRANCH=none
TEST=none | @@ -352,10 +352,11 @@ int hook_call_deferred(const struct deferred_data *data, int us);
* order in which hooks are called.
*/
#define DECLARE_HOOK(hooktype, routine, priority) \
- const struct hook_data __keep __no_sanitize_address \
- CONCAT4(__hook_, hooktype, _, routine) \
- __attribute__((section(".rodata." STRINGIFY(hooktype)))) \
- = {routine, priority}
+ const struct hook_data __keep __no_sanitize_address CONCAT4( \
+ __hook_, hooktype, _, routine) \
+ __attribute__((section(".rodata." STRINGIFY(hooktype)))) = { \
+ routine, priority \
+ }
/**
* Register a deferred function call.
@@ -377,10 +378,9 @@ int hook_call_deferred(const struct deferred_data *data, int us);
* @param routine Function pointer, with prototype void routine(void)
*/
#define DECLARE_DEFERRED(routine) \
- const struct deferred_data __keep __no_sanitize_address \
- CONCAT2(routine, _data) \
- __attribute__((section(".rodata.deferred"))) \
- = {routine}
+ const struct deferred_data __keep __no_sanitize_address CONCAT2( \
+ routine, _data) \
+ __attribute__((section(".rodata.deferred"))) = { routine }
#else
/*
* Stub implementation in case hooks are disabled (neither
@@ -388,9 +388,15 @@ int hook_call_deferred(const struct deferred_data *data, int us);
*/
#define hook_call_deferred(unused1, unused2) -1
#define DECLARE_HOOK(t, func, p) \
- void CONCAT2(unused_hook_, func)(void) { func(); }
+ void CONCAT2(unused_hook_, func)(void) \
+ { \
+ func(); \
+ }
#define DECLARE_DEFERRED(func) \
- void CONCAT2(unused_deferred_, func)(void) { func(); }
+ void CONCAT2(unused_deferred_, func)(void) \
+ { \
+ func(); \
+ }
#endif
#endif /* __CROS_EC_HOOKS_H */
|
modinfo BUGFIX do not apply diff on enabled event
The current data actually have it applied since
it is only virtual diff.
Refs | @@ -1177,7 +1177,6 @@ sr_modinfo_get_filter(struct sr_mod_info_s *mod_info, const char *xpath, sr_sess
/* collect edit/diff to be applied based on the handled event */
switch (session->ev) {
case SR_SUB_EV_CHANGE:
- case SR_SUB_EV_ENABLED:
case SR_SUB_EV_UPDATE:
diff = session->dt[session->ds].diff;
if (session->ev != SR_SUB_EV_UPDATE) {
@@ -1187,6 +1186,7 @@ sr_modinfo_get_filter(struct sr_mod_info_s *mod_info, const char *xpath, sr_sess
case SR_SUB_EV_NONE:
edit = session->dt[session->ds].edit;
break;
+ case SR_SUB_EV_ENABLED:
case SR_SUB_EV_DONE:
case SR_SUB_EV_ABORT:
case SR_SUB_EV_OPER:
|
misc: allow second ':' in commit message
Type: fix
Fixes: | #/bin/env bash
KNOWN_FEATURES=$(cat MAINTAINERS | sed -ne 's/^I:[[:space:]]*//p')
-FEATURES=$(git show -s --format=%s --no-color | sed -e 's/\(.*\):.*/\1/')
+FEATURES=$(git show -s --format=%s --no-color | sed -e 's/\([a-z0-9 -]*\):.*/\1/')
KNOWN_TYPES="feature fix refactor style docs test make"
TYPE=$(git show -s --format=%b --no-color | sed -ne 's/^Type:[[:space:]]*//p')
ERR="=============================== ERROR ==============================="
|
Block scope | @@ -43,7 +43,7 @@ if (depth<1)return null;
function randObject(rec, depth) {
if (depth<1) return null;
var obj = {};
- for (i=0; i<rec; i++) {
+ for (let i=0; i<rec; i++) {
var k = randString();
obj[k] = randType(rec, depth-1);
}
|
Point to zasm for an assembler front-end | @@ -189,6 +189,10 @@ Unofficial but actively maintained bindings:
- [LuaJIT](https://github.com/Wiladams/lj2zydis)
- [Haskell](https://github.com/nerded1337/zydiskell)
+## asmjit-style C++ front-end
+
+If you're looking for an asmjit-style assembler front-end for the encoder, check out [zasm](https://github.com/ZehMatt/zasm)!
+
## Versions
### Scheme
|
hw/bus: Add support for device suspend/resume
Suspend will disable bus device while resume will enable it. | @@ -84,6 +84,47 @@ bus_dev_disable(struct bus_dev *bdev)
bdev->enabled = false;
}
+static int
+bus_dev_suspend_func(struct os_dev *odev, os_time_t suspend_at, int force)
+{
+ struct bus_dev *bdev = (struct bus_dev *)odev;
+ int rc;
+
+ /* To make things simple we just allow to suspend "now" */
+ if (OS_TIME_TICK_GT(suspend_at, os_time_get())) {
+ return OS_EINVAL;
+ }
+
+ rc = os_mutex_pend(&bdev->lock, OS_TIMEOUT_NEVER);
+ if (rc) {
+ return rc;
+ }
+
+ bus_dev_disable(bdev);
+
+ os_mutex_release(&bdev->lock);
+
+ return OS_OK;
+}
+
+static int
+bus_dev_resume_func(struct os_dev *odev)
+{
+ struct bus_dev *bdev = (struct bus_dev *)odev;
+ int rc;
+
+ rc = os_mutex_pend(&bdev->lock, OS_TIMEOUT_NEVER);
+ if (rc) {
+ return rc;
+ }
+
+ bus_dev_enable(bdev);
+
+ os_mutex_release(&bdev->lock);
+
+ return OS_OK;
+}
+
static int
bus_node_open_func(struct os_dev *odev, uint32_t wait, void *arg)
{
@@ -170,6 +211,9 @@ bus_dev_init_func(struct os_dev *odev, void *arg)
stats_name);
#endif
+ odev->od_handlers.od_suspend = bus_dev_suspend_func;
+ odev->od_handlers.od_resume = bus_dev_resume_func;
+
bus_dev_enable(bdev);
return 0;
|
Add an assert checking that same prio is not used by two different
tasks. | @@ -98,6 +98,7 @@ os_task_init(struct os_task *t, const char *name, os_task_func_t func,
{
struct os_sanity_check *sc;
int rc;
+ struct os_task *task;
memset(t, 0, sizeof(*t));
@@ -132,6 +133,10 @@ os_task_init(struct os_task *t, const char *name, os_task_func_t func,
t->t_stacktop = &stack_bottom[stack_size];
t->t_stacksize = stack_size;
+ STAILQ_FOREACH(task, &g_os_task_list, t_os_task_list) {
+ assert(t->t_prio != task->t_prio);
+ }
+
/* insert this task into the task list */
STAILQ_INSERT_TAIL(&g_os_task_list, t, t_os_task_list);
|
KDF: clean away old EVP_KDF declarations
They were left-overs from when we still had the legacy KDF implementation | @@ -169,15 +169,6 @@ struct evp_kdf_st {
OSSL_OP_kdf_set_ctx_params_fn *set_ctx_params;
};
-extern const EVP_KDF pbkdf2_kdf_meth;
-extern const EVP_KDF scrypt_kdf_meth;
-extern const EVP_KDF tls1_prf_kdf_meth;
-extern const EVP_KDF hkdf_kdf_meth;
-extern const EVP_KDF sshkdf_kdf_meth;
-extern const EVP_KDF ss_kdf_meth;
-extern const EVP_KDF x963_kdf_meth;
-extern const EVP_KDF x942_kdf_meth;
-
struct evp_md_st {
/* nid */
int type;
|
small fix on bank initialization (for bank switching mechanism) | @@ -463,6 +463,10 @@ void _start_entry()
// initialize "initialized variables"
memcpyU16(dst, FAR(src), len);
+ // reset banks as we messed them during init
+ len = 8;
+ while(--len) SYS_setBank(len, len);
+
// initialize random number generator
setRandomSeed(0xC427);
vtimer = 0;
|
fixes for infeas | @@ -172,16 +172,13 @@ static void update_best_iterate(ScsWork *w, ScsResiduals *r) {
static void populate_norms(scs_float *vec, scs_int len, scs_float * scale_vec,
scs_float scale, scs_float tau,
scs_float *l2_norm_ptr, scs_float *linf_norm_ptr) {
- scs_float l2_norm, linf_norm;
if (scale_vec) {
- l2_norm = SCS(inv_scaled_norm)(vec, len, scale_vec) / scale;
- linf_norm = SCS(inv_scaled_norm_inf)(vec, len, scale_vec) / scale;
+ *l2_norm_ptr = SCS(inv_scaled_norm)(vec, len, scale_vec) / scale;
+ *linf_norm_ptr = SCS(inv_scaled_norm_inf)(vec, len, scale_vec) / scale;
} else {
- l2_norm = SCS(norm)(vec, len) / scale;
- linf_norm = SCS(norm_inf)(vec, len) / scale;
+ *l2_norm_ptr = SCS(norm)(vec, len) / scale;
+ *linf_norm_ptr = SCS(norm_inf)(vec, len) / scale;
}
- *l2_norm_ptr = SAFEDIV_POS(l2_norm, tau);
- *linf_norm_ptr = SAFEDIV_POS(linf_norm, tau);
}
/* calculates un-normalized residual quantities */
@@ -236,6 +233,9 @@ static void populate_residuals(ScsWork *w, ScsResiduals *r, scs_int iter,
/* unnormalized here */
populate_norms(wrk_m, m, D, dual_scale, r->tau, &r->l2_norm_pri_resid, &r->linf_norm_pri_resid);
+ r->l2_norm_pri_resid = SAFEDIV_POS(r->l2_norm_pri_resid, r->tau);
+ r->linf_norm_pri_resid = SAFEDIV_POS(r->linf_norm_pri_resid, r->tau);
+
/**************** DUAL *********************/
memset(px, 0, n * sizeof(scs_float));
if (w->P) {
@@ -263,6 +263,9 @@ static void populate_residuals(ScsWork *w, ScsResiduals *r, scs_int iter,
/* unnormalized here */
populate_norms(wrk_n, n, E, primal_scale, r->tau, &r->l2_norm_dual_resid, &r->linf_norm_dual_resid);
+ r->l2_norm_dual_resid = SAFEDIV_POS(r->l2_norm_dual_resid, r->tau);
+ r->linf_norm_dual_resid = SAFEDIV_POS(r->linf_norm_dual_resid, r->tau);
+
r->bty_by_tau = SCS(dot)(y, w->b, m);
r->ctx_by_tau = SCS(dot)(x, w->c, n);
|
mmapstorage: use MAP_FIXED on Get operation | @@ -73,12 +73,12 @@ static int elektraMmapstorageStat (struct stat * sbuf, Key * parentKey, int errn
return 1;
}
-static char * elektraMmapstorageMapFile (void * addr, FILE * fp, size_t mmapSize, Key * parentKey, int errnosave)
+static char * elektraMmapstorageMapFile (void * addr, FILE * fp, size_t mmapSize, int mapOpts , Key * parentKey, int errnosave)
{
ELEKTRA_LOG ("mapping file %s", keyString (parentKey));
int fd = fileno (fp);
- char * mappedRegion = mmap (addr, mmapSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ char * mappedRegion = mmap (addr, mmapSize, PROT_READ | PROT_WRITE, mapOpts, fd, 0);
if (mappedRegion == MAP_FAILED) {
ELEKTRA_SET_ERROR_GET (parentKey);
errno = errnosave;
@@ -289,7 +289,7 @@ int elektraMmapstorageGet (Plugin * handle ELEKTRA_UNUSED, KeySet * returned, Ke
void * addr = mmapAddr (fp);
- char * mappedRegion = elektraMmapstorageMapFile (addr, fp, sbuf.st_size, parentKey, errnosave);
+ char * mappedRegion = elektraMmapstorageMapFile (addr, fp, sbuf.st_size, MAP_PRIVATE | MAP_FIXED, parentKey, errnosave);
if (mappedRegion == MAP_FAILED)
{
fclose (fp);
@@ -328,7 +328,7 @@ int elektraMmapstorageSet (Plugin * handle ELEKTRA_UNUSED, KeySet * returned, Ke
return -1;
}
- char * mappedRegion = elektraMmapstorageMapFile ((void *) 0, fp, mmapSize.mmapSize, parentKey, errnosave);
+ char * mappedRegion = elektraMmapstorageMapFile ((void *) 0, fp, mmapSize.mmapSize, MAP_SHARED, parentKey, errnosave);
ELEKTRA_LOG_WARNING ("mappedRegion ptr: %p", (void *) mappedRegion);
if (mappedRegion == MAP_FAILED)
{
|
Changelog note for
Merge from hardfalcon: Fix contrib/unbound.service.in,
Drop CAP_KILL, use + prefix for ExecReload= instead. | +26 September 2019: Wouter
+ - Merge #87 from hardfalcon: Fix contrib/unbound.service.in,
+ Drop CAP_KILL, use + prefix for ExecReload= instead.
+
25 September 2019: Wouter
- The unbound.conf includes are sorted ascending, for include
statements with a '*' from glob.
|
groups: prevent demoting yourself if only admin | @@ -353,9 +353,9 @@ function Participant(props: {
</StatelessAsyncAction>
)}
{role === 'admin' ? (
- <StatelessAsyncAction onClick={onDemote} bg="transparent">
+ group?.tags?.role?.admin?.size > 1 && (<StatelessAsyncAction onClick={onDemote} bg="transparent">
Demote from Admin
- </StatelessAsyncAction>
+ </StatelessAsyncAction>)
) : (
<>
{(contact.patp !== window.ship) && (<StatelessAsyncAction onClick={onKick} bg="transparent">
|
fixup! net/lwip : neighbor cache should be updated when lladdr option exists on RA | @@ -681,7 +681,6 @@ void nd6_input(struct pbuf *p, struct netif *inp)
offset += 8 * ((u16_t) buffer[1]);
}
- if (lladdr_opt != NULL) {
/* Get the matching default router entry. */
i = nd6_get_router(ip6_current_src_addr(), inp);
if (i < 0) {
@@ -719,6 +718,7 @@ void nd6_input(struct pbuf *p, struct netif *inp)
/* Update flags in local entry (incl. preference). */
default_router_list[i].flags = ND6H_RA_FLAG(ra_hdr);
+ if (lladdr_opt != NULL) {
if (default_router_list[i].neighbor_entry == NULL) {
/* default router table has been created but "no entry on neighbor cache" */
/* Create new neighbor cache */
|
just make it large enough to be future proof | @@ -32,7 +32,7 @@ enum discord_limits {
MAX_TOPIC_LEN = 1024,
MAX_DESCRIPTION_LEN = 1024,
MAX_USERNAME_LEN = 32,
- MAX_DISCRIMINATOR_LEN = 4,
+ MAX_DISCRIMINATOR_LEN = 10,
MAX_HASH_LEN = 1024,
MAX_LOCALE_LEN = 15,
MAX_EMAIL_LEN = 254,
|
eqlms/autotest: checking length property | @@ -167,7 +167,8 @@ void autotest_eqlms_config()
eqlms_cccf q = eqlms_cccf_create(NULL, h_len);
CONTEND_EQUALITY(LIQUID_OK, eqlms_cccf_print(q));
- // test getting/setting bandwidth
+ // test getting/setting properties
+ CONTEND_EQUALITY(eqlms_cccf_get_length(q), h_len);
float mu = 0.1f;
eqlms_cccf_set_bw(q, mu);
CONTEND_EQUALITY(eqlms_cccf_get_bw(q), mu);
|
Fix getCharBoundaries for last character on line | @@ -1181,13 +1181,22 @@ WString TextField::getHTMLText()
Rect TextField::getCharBoundaries(int inCharIndex)
{
+ if (mLinesDirty)
+ Layout();
+
if (inCharIndex>=0 && inCharIndex<mCharPos.size())
{
UserPoint p = mCharPos[ inCharIndex ];
Line &line = mLines[getLineFromChar(inCharIndex)];
int height = line.mMetrics.height;
int linePos = inCharIndex - line.mChar0;
- int width = line.mChars>linePos ? mCharPos[ inCharIndex+1 ].x - p.x : line.mMetrics.width - p.x;
+ double width = line.mChars>linePos+1 ? mCharPos[ inCharIndex+1 ].x - p.x : line.mMetrics.width - p.x;
+ if (width<0)
+ {
+ p.x += width;
+ width = 0;
+ }
+
return Rect(p.x, p.y, width, height);
}
|
Address Buffer extra overflow bug.
We should have a normal error instead of undefined behavior, wrap
around, or wait for realloc to fail. | @@ -91,7 +91,9 @@ void janet_buffer_extra(JanetBuffer *buffer, int32_t n) {
}
int32_t new_size = buffer->count + n;
if (new_size > buffer->capacity) {
- int32_t new_capacity = new_size * 2;
+ size_t new_capacity_sizet = (size_t) (new_size) * 2;
+ if (new_capacity_sizet > INT32_MAX) new_capacity_sizet = INT32_MAX;
+ int32_t new_capacity = (int32_t) new_capacity_sizet;
uint8_t *new_data = realloc(buffer->data, new_capacity * sizeof(uint8_t));
janet_gcpressure(new_capacity - buffer->capacity);
if (NULL == new_data) {
|
Enable SRAM1/2/3 early in startup code. | @@ -78,9 +78,9 @@ defined in linker script */
.type Reset_Handler, %function
Reset_Handler:
/* Enable ccm clock */
- ldr r0,=0x40023830
+ ldr r0,=0x580244dc
ldr r3,[r0]
- orr r3, r3, #1048576 /* 0x100000 */
+ orr r3, r3, #3758096384 /* 0xE0000000 */
str r3,[r0]
ldr sp, =_estack /* set stack pointer */
|
out_influxdb: use new http client api | @@ -324,7 +324,7 @@ void cb_influxdb_flush(void *data, size_t bytes,
/* Compose HTTP Client request */
c = flb_http_client(u_conn, FLB_HTTP_POST, ctx->uri,
- pack, bytes_out, NULL, 0, NULL);
+ pack, bytes_out, NULL, 0, NULL, 0);
flb_http_add_header(c, "User-Agent", 10, "Fluent-Bit", 10);
ret = flb_http_do(c, &b_sent);
|
Fix: Reset row count after adding edges between a pair of statements in the FCG | @@ -284,7 +284,7 @@ void fcg_add_pairwise_edges(Graph *fcg, int v1, int v2, PlutoProg *prog, int *co
/* conflictcst->val[row_offset+0][src_offset+i] = 0; */
}
}
- /* conflictcst->nrows = row_offset+2; */
+ conflictcst->nrows = row_offset+CST_WIDTH-1;
/* conflictcst->ncols = CST_WIDTH; */
/* conflictcst->val[row_offset][CST_WIDTH-1] = 0; */
/* conflictcst->val[row_offset+1][CST_WIDTH-1] = 0; */
@@ -532,7 +532,7 @@ Graph* build_fusion_conflict_graph(PlutoProg *prog, int *colour, int num_nodes,
(*conflicts)->val[nrows+i][i] = 1;
}
- pluto_constraints_cplex_print(stdout, *conflicts);
+ /* pluto_constraints_cplex_print(stdout, *conflicts); */
/* Add premutation preventing intra statement dependence edges in the FCG.
* These are self loops on vertices of the FCG. */
|
upstream: remove unnecessary errno message | @@ -323,6 +323,7 @@ int flb_upstream_conn_recycle(struct flb_upstream_conn *conn, int val)
struct flb_upstream_conn *flb_upstream_conn_get(struct flb_upstream *u)
{
+ int err;
struct mk_list *tmp;
struct mk_list *head;
struct flb_upstream_conn *conn = NULL;
@@ -358,10 +359,8 @@ struct flb_upstream_conn *flb_upstream_conn_get(struct flb_upstream *u)
/* Reset errno */
conn->net_error = -1;
- int err;
err = flb_socket_error(conn->fd);
if (!FLB_EINPROGRESS(err) && err != 0) {
- flb_errno();
flb_debug("[upstream] KA connection #%i is in a failed state "
"to: %s:%i, cleaning up",
conn->fd, u->tcp_host, u->tcp_port);
|
Fix links to examples
This patch fixes links to the examples | @@ -106,7 +106,7 @@ Then add the following line the project's `CMakeLists.txt`
## More Examples
-The examples folder includes code examples for a [telnet echo protocol](examples/telnet-echo.c), a [Simple Hello World server](examples/hello-world.c), an example for [Websocket pub/sub with (optional) Redis](examples/pubsub-chat.c) ,a [super fast DIY HTTP/1.1 server](examples/fast-http.c), etc'.
+The examples folder includes code examples for a [telnet echo protocol](examples/raw-echo.c), a [Simple Hello World server](examples/raw-http.c), an example for [Websocket pub/sub with (optional) Redis](examples/http-chat.c), etc'.
You can find more information on the [facil.io](http://facil.io) website
|
test(ethereum): Add InitEthWalletWithWrongGenMode | @@ -485,6 +485,26 @@ START_TEST(test_002InitWallet_0013InitEthWalletGenerationKey)
walletConfig.prikeyCtx_config.prikey_format = BOAT_WALLET_PRIKEY_TYPE_SECP256K1;
walletConfig.eip155_compatibility = BOAT_FALSE;
+ /* 1. execute unit test */
+ rtnVal = BoatEthWalletInit(&walletConfig, sizeof(BoatEthWalletConfig));
+ /* 2. verify test result */
+ /* 2-1. verify the return value */
+ ck_assert_ptr_null(rtnVal);
+
+ /* 2-2. verify the global variables that be affected */
+}
+END_TEST
+
+START_TEST(test_002InitWallet_0014InitEthWalletWithWrongGenMode)
+{
+ BoatEthWallet *rtnVal;
+ BoatEthWalletConfig walletConfig;
+
+ walletConfig.prikeyCtx_config.prikey_genMode = 3;
+ walletConfig.prikeyCtx_config.prikey_format = BOAT_WALLET_PRIKEY_FORMAT_NATIVE;
+ walletConfig.prikeyCtx_config.prikey_format = BOAT_WALLET_PRIKEY_TYPE_SECP256K1;
+ walletConfig.eip155_compatibility = BOAT_FALSE;
+
/* 1. execute unit test */
rtnVal = BoatEthWalletInit(&walletConfig, sizeof(BoatEthWalletConfig));
/* 2. verify test result */
@@ -548,6 +568,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_002InitWallet_0011InitEthWalletWithBiggerSize);
tcase_add_test(tc_wallet_api, test_002InitWallet_0012InitEthWalletSuccess);
tcase_add_test(tc_wallet_api, test_002InitWallet_0013InitEthWalletGenerationKey);
+ tcase_add_test(tc_wallet_api, test_002InitWallet_0014InitEthWalletWithWrongGenMode);
tcase_add_test(tc_wallet_api, test_003DeleteWallet_0001DeleteWalletFailureNullFleName);
tcase_add_test(tc_wallet_api, test_003DeleteWallet_0002DeleteWalletFailureNoExistingFile);
tcase_add_test(tc_wallet_api, test_003DeleteWallet_0003DeleteWalletSucessExistingFile);
|
DotNetTools: Fix trace handle leak | @@ -1512,6 +1512,8 @@ NTSTATUS UpdateDotNetTraceInfoThreadStart(
context->TraceResult = ProcessDotNetTrace(context);
ControlTrace(sessionHandle, NULL, properties, EVENT_TRACE_CONTROL_STOP);
+ CloseTrace(sessionHandle);
+
PhFree(properties);
return context->TraceResult;
|
Build, package: Make sure the sha256sum goes to a separate file (PR
Currently for windows sha256sum is added to the md5sum file.
This changes it to a separate file, like for linux. | @@ -86,7 +86,7 @@ if [[ ${OS} == "windows" ]]; then
for i in ${DISTNAME}-win64.zip ${DISTNAME}-win64-setup.exe ${DISTNAME}-win64-setup-unsigned.exe; do
if [[ -e ${i} ]]; then
md5sum ${i} >> ${i}.md5sum
- sha256sum ${i} >> ${i}.md5sum
+ sha256sum ${i} >> ${i}.sha256sum
else
echo "${i} doesn't exist"
fi
|
Fix InvalidAddress test on macOS | @@ -836,7 +836,8 @@ CxPlatSocketContextInitialize(
MappedAddress.Ipv6.sin6_family = AF_INET6;
}
- if (ForceIpv4) {
+ // If we're going to be connecting, we need to bind to the correct local address family.
+ if ((RemoteAddress && LocalAddress->Ip.sa_family == QUIC_ADDRESS_FAMILY_INET) || ForceIpv4) {
MappedAddress.Ipv4.sin_family = AF_INET;
MappedAddress.Ipv4.sin_port = Binding->LocalAddress.Ipv4.sin_port;
// For Wildcard address we only need to copy port.
|
Docs: removing broken xref | describe how to monitor the health of a Greenplum Database system and examine certain state
information for a Greenplum Database system.</p>
<ul>
- <li id="kj166984">
- <xref href="#topic4" type="topic" format="dita"/>
- </li>
<li id="kj167000">
<xref href="#topic12" type="topic" format="dita"/>
</li>
|
Enable position-independent code | @@ -24,6 +24,7 @@ PROJECT(hiredis VERSION "${VERSION}")
# Hiredis requires C99
SET(CMAKE_C_STANDARD 99)
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(ENABLE_EXAMPLES OFF CACHE BOOL "Enable building hiredis examples")
|
[mod_deflate] compat with zstd < v1.4.0
ZSTD_compressStream2() was an "advanced API" (experimental; unstable)
in v1.3.x | @@ -968,7 +968,11 @@ static int stream_zstd_init(handler_ctx *hctx) {
const plugin_data * const p = hctx->plugin_data;
if (p->conf.compression_level >= 0) { /* -1 is lighttpd default for "unset" */
int level = p->conf.compression_level;
+ #if ZSTD_VERSION_NUMBER >= 10000+400+0 /* v1.4.0 */
ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, level);
+ #else
+ ZSTD_initCStream(cctx, level);
+ #endif
}
return 0;
}
@@ -982,7 +986,11 @@ static int stream_zstd_compress(handler_ctx * const hctx, unsigned char * const
hctx->output->used = 0;
hctx->bytes_in += st_size;
while (zib.pos < zib.size) {
+ #if ZSTD_VERSION_NUMBER >= 10000+400+0 /* v1.4.0 */
const size_t rv = ZSTD_compressStream2(cctx,&zob,&zib,ZSTD_e_continue);
+ #else
+ const size_t rv = ZSTD_compressStream(cctx, &zob, &zib);
+ #endif
if (ZSTD_isError(rv)) return -1;
if (zib.pos == zib.size) break; /* defer flush */
hctx->bytes_out += (off_t)zob.pos;
@@ -996,14 +1004,22 @@ static int stream_zstd_compress(handler_ctx * const hctx, unsigned char * const
static int stream_zstd_flush(handler_ctx * const hctx, int end) {
ZSTD_CStream * const cctx = hctx->u.cctx;
+ #if ZSTD_VERSION_NUMBER >= 10000+400+0 /* v1.4.0 */
const ZSTD_EndDirective endOp = end ? ZSTD_e_end : ZSTD_e_flush;
ZSTD_inBuffer zib = { NULL, 0, 0 };
+ #endif
ZSTD_outBuffer zob = { hctx->output->ptr,
hctx->output->size,
hctx->output->used };
size_t rv;
do {
+ #if ZSTD_VERSION_NUMBER >= 10000+400+0 /* v1.4.0 */
rv = ZSTD_compressStream2(cctx, &zob, &zib, endOp);
+ #else
+ rv = end
+ ? ZSTD_endStream(cctx, &zob)
+ : ZSTD_flushStream(cctx, &zob);
+ #endif
if (ZSTD_isError(rv)) return -1;
hctx->bytes_out += (off_t)zob.pos;
if (0 != stream_http_chunk_append_mem(hctx, zob.dst, zob.pos))
|
stress: add AsmSqrtWorker. According to measurement, zig/zag has 3 sqrt units per core, but gcc only leverages one when compile the default SqrtWorker. | @@ -51,6 +51,31 @@ void SqrtWorker::Work(uint64_t n) {
}
}
+#define SQRT(src_var, dest_var, src_xmm, dest_xmm) \
+ asm volatile( \
+ "movq %1, %%" src_xmm "\n" \
+ "sqrtsd %%" src_xmm ", %%" dest_xmm "\n" \
+ "movq %%" dest_xmm ", %0 \n" \
+ : "=r"(dest_var) \
+ : "g"(src_var) \
+ : src_xmm, dest_xmm, "memory")
+
+void AsmSqrtWorker::Work(uint64_t n) {
+ constexpr double kNumber = 2350845.545;
+ double src_0, src_1, src_2, src_3;
+ double dest_0, dest_1, dest_2, dest_3;
+ for (uint64_t i = 0; i < n; i += 4) {
+ src_0 = i * kNumber;
+ src_1 = (i + 1) * kNumber;
+ src_2 = (i + 2) * kNumber;
+ src_3 = (i + 3) * kNumber;
+ SQRT(src_0, dest_0, "xmm0", "xmm1");
+ SQRT(src_1, dest_1, "xmm2", "xmm3");
+ SQRT(src_2, dest_2, "xmm4", "xmm5");
+ SQRT(src_3, dest_3, "xmm6", "xmm7");
+ }
+}
+
StridedMemtouchWorker *StridedMemtouchWorker::Create(std::size_t size,
std::size_t stride) {
char *buf = new char[size]();
@@ -181,6 +206,9 @@ SyntheticWorker *SyntheticWorkerFactory(std::string s) {
if (tokens[0] == "sqrt") {
if (tokens.size() != 1) return nullptr;
return new SqrtWorker();
+ } if (tokens[0] == "asmsqrt") {
+ if (tokens.size() != 1) return nullptr;
+ return new AsmSqrtWorker();
} else if (tokens[0] == "stridedmem") {
if (tokens.size() != 3) return nullptr;
unsigned long size = std::stoul(tokens[1], nullptr, 0);
|
Further improvements to the `ZydisInfo` tool | @@ -45,6 +45,7 @@ const char* ZydisFormatStatus(ZydisStatus status)
"SUCCESS",
"INVALID_PARAMETER",
"INVALID_OPERATION",
+ "INSUFFICIENT_BUFFER_SIZE",
"NO_MORE_DATA",
"DECODING_ERROR",
"INSTRUCTION_TOO_LONG",
@@ -465,14 +466,36 @@ int main(int argc, char** argv)
return ZYDIS_STATUS_INVALID_PARAMETER;
}
- uint8_t data[ZYDIS_MAX_INSTRUCTION_LENGTH] =
+ uint8_t data[ZYDIS_MAX_INSTRUCTION_LENGTH];
+ uint8_t length = 0;
+ for (uint8_t i = 0; i < argc - 2; ++i)
{
- 0x62, 0x22, 0xF9, 0x85, 0xA2, 0x64, 0x78, 0x5E, 0x24, 0x04, 0xCF, 0x7E, 0x23
- };
+ if (length == ZYDIS_MAX_INSTRUCTION_LENGTH)
+ {
+ fprintf(stderr, "Maximum number of %d bytes exceeded", ZYDIS_MAX_INSTRUCTION_LENGTH);
+ return ZYDIS_STATUS_INVALID_PARAMETER;
+ }
+ size_t len = strlen(argv[i + 2]);
+ if (len % 2)
+ {
+ fputs("Even number of hex nibbles expected", stderr);
+ return ZYDIS_STATUS_INVALID_PARAMETER;
+ }
+ for (uint8_t j = 0; j < len / 2; ++j)
+ {
+ unsigned value;
+ if (!sscanf(&argv[i + 2][j * 2], "%02x", &value))
+ {
+ fputs("Invalid hex value", stderr);
+ return ZYDIS_STATUS_INVALID_PARAMETER;
+ }
+ data[i + j] = (uint8_t)value;
+ ++length;
+ }
+ }
ZydisDecodedInstruction instruction;
- ZydisStatus status =
- ZydisDecoderDecodeBuffer(&decoder, &data, ZYDIS_MAX_INSTRUCTION_LENGTH, 0, &instruction);
+ ZydisStatus status = ZydisDecoderDecodeBuffer(&decoder, &data, length, 0, &instruction);
if (!ZYDIS_SUCCESS(status))
{
if (status >= ZYDIS_STATUS_USER)
@@ -488,8 +511,6 @@ int main(int argc, char** argv)
printInstruction(&instruction);
- getchar();
-
return ZYDIS_STATUS_SUCCESS;
}
|
ble_mesh: Init device name during proxy server init
Device name will be reset when deinit mesh stack. If not
initializing device name during the next mesh stack init,
it will fail to set the device name when using bluedroid. | @@ -109,7 +109,7 @@ static enum {
MESH_GATT_PROXY,
} gatt_svc = MESH_GATT_NONE;
-static char device_name[DEVICE_NAME_SIZE + 1] = "ESP-BLE-MESH";
+static char device_name[DEVICE_NAME_SIZE + 1];
int bt_mesh_set_device_name(const char *name)
{
@@ -1416,6 +1416,7 @@ int bt_mesh_proxy_init(void)
bt_mesh_gatts_conn_cb_register(&conn_callbacks);
+ strncpy(device_name, "ESP-BLE-MESH", DEVICE_NAME_SIZE);
return bt_mesh_gatts_set_local_device_name(device_name);
}
|
Disable ASAN memory leak at exit checks. | @@ -22,6 +22,8 @@ jobs:
- name: make
run: make
- name: test
+ env:
+ ASAN_OPTIONS: leak_check_at_exit=false
run: make test
- name: clang static analyzer
run: cd pappl && make CC=clang "GHA_ERROR=::error::" clang
|
Fix fifo overflow correction. | @@ -342,7 +342,7 @@ static uint16_t backward_pointer(tu_fifo_t* f, uint16_t p, uint16_t offset)
// We limit the index space of p such that a correct wrap around happens
// Check for a wrap around or if we are in unused index space - This has to be checked first!!
// We are exploiting the wrap around to the correct index
- if ((p < p - offset) || (p - offset > f->max_pointer_idx))
+ if ((p < (uint16_t)(p - offset)) || ((uint16_t)(p - offset) > f->max_pointer_idx))
{
p = (p - offset) - f->non_used_index_space;
}
|
extmod/Matrix: implement rmul for scalar | @@ -606,7 +606,15 @@ STATIC mp_obj_t robotics_Matrix_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp
return robotics_Matrix__add(lhs_in, rhs_in, false);
case MP_BINARY_OP_MULTIPLY:
case MP_BINARY_OP_INPLACE_MULTIPLY:
+ // If right of the operands is a number, just scale.
+ if (mp_obj_is_float(rhs_in) || mp_obj_is_int(rhs_in)) {
+ return robotics_Matrix__scale(lhs_in, mp_obj_get_float_to_f(rhs_in));
+ }
+ // Otherwise we have to do full multiplication.
return robotics_Matrix__mul(lhs_in, rhs_in);
+ case MP_BINARY_OP_REVERSE_MULTIPLY:
+ // This gets called for c*A, so scale A by c (rhs/lhs is meaningless here)
+ return robotics_Matrix__scale(lhs_in, mp_obj_get_float_to_f(rhs_in));
default:
// Other operations not supported
return MP_OBJ_NULL;
|
move DRAMSim2 makefrag rules | @@ -156,10 +156,14 @@ $(output_dir)/tracegen.result: $(output_dir)/tracegen.out $(AXE)
tracegen: $(output_dir)/tracegen.result
+.PHONY: tracegen
+
+#######################################
+# Rules for building DRAMSim2 library #
+#######################################
+
dramsim_dir = $(base_dir)/tools/DRAMSim2
dramsim_lib = $(dramsim_dir)/libdramsim.a
$(dramsim_lib):
$(MAKE) -C $(dramsim_dir) $(notdir $@)
-
-.PHONY: tracegen
|
vlib: fix access before check issue in foreach_vlib_main macro
Type: fix | @@ -237,16 +237,24 @@ typedef enum
void vlib_worker_thread_fork_fixup (vlib_fork_fixup_t which);
+always_inline int
+__foreach_vlib_main_helper (vlib_main_t *ii, vlib_main_t **p)
+{
+ vlib_main_t *vm;
+ u32 index = ii - (vlib_main_t *) 0;
+
+ if (index >= vec_len (vlib_global_main.vlib_mains))
+ return 0;
+
+ *p = vm = vlib_global_main.vlib_mains[index];
+ ASSERT (index == 0 || vm->parked_at_barrier == 1);
+ return 1;
+}
+
#define foreach_vlib_main() \
- for (vlib_main_t *ii = 0, *this_vlib_main = vlib_global_main.vlib_mains[0]; \
- (ii - (vlib_main_t *) 0) < vec_len (vlib_global_main.vlib_mains); \
- ii++, this_vlib_main = \
- vlib_global_main.vlib_mains[ii - (vlib_main_t *) 0]) \
- if (CLIB_ASSERT_ENABLE && \
- !(ii == 0 || \
- (this_vlib_main && this_vlib_main->parked_at_barrier == 1))) \
- ASSERT (0); \
- else if (this_vlib_main)
+ for (vlib_main_t *ii = 0, *this_vlib_main; \
+ __foreach_vlib_main_helper (ii, &this_vlib_main); ii++) \
+ if (this_vlib_main)
#define foreach_sched_policy \
_(SCHED_OTHER, OTHER, "other") \
|
Added support for old version of cmake | @@ -88,7 +88,11 @@ project(ccl)
include_directories(${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIRS})
# Builds swig python module in place
+ if(${CMAKE_VERSION} VERSION_LESS "3.8.0")
+ swig_add_module(ccllib python pyccl/ccl.i)
+ else()
swig_add_library(ccllib TYPE SHARED LANGUAGE python SOURCES pyccl/ccl.i)
+ endif()
swig_link_libraries(ccllib ${PYTHON_LIBRARIES} ccl)
# Forces build of swig executable if not found
if(NOT SWIG_FOUND)
|
Fix compile issue on Linux. | @@ -210,7 +210,7 @@ _papplPrinterRunUSB(
papplLogPrinter(printer, PAPPL_LOGLEVEL_DEBUG, "Read %d bytes from USB port.", (int)bytes);
if (printer->usb_cb)
{
- if ((bytes = (printer->usb_cb)(printer, device, buffer, sizeof(bufsize), (size_t)bytes, printer->usb_cbdata)) > 0)
+ if ((bytes = (printer->usb_cb)(printer, device, buffer, sizeof(buffer), (size_t)bytes, printer->usb_cbdata)) > 0)
{
data[0].revents = 0; // Don't try reading back from printer
|
Missed commit. Fix compile errors | @@ -1621,7 +1621,7 @@ bool colour_scc_cluster_greedy(int scc_id, int *colour, int current_colour, Plut
Scc *sccs;
int i,v,max_dim, num_convex_successors, num_parallel_dims;
bool* parallel_dims;
- int *convex_successors, *common_dims;
+ int *convex_successors, *common_dims, colouring_dim;
ddg = prog->ddg;
fcg = prog->fcg;
@@ -1637,7 +1637,7 @@ bool colour_scc_cluster_greedy(int scc_id, int *colour, int current_colour, Plut
num_parallel_dims = 0;
for(i=0; i<max_dim; i++) {
- if (colour[v+i]==0 !fcg->adj->val[v+i][v+i] && !par_preventing_adj_mat->val[v+i][v+i]
+ if (colour[v+i]==0 && !fcg->adj->val[v+i][v+i] && !par_preventing_adj_mat->val[v+i][v+i]
&& is_valid_colour(v+i, current_colour, fcg, colour)) {
parallel_dims[i] = true;
num_parallel_dims ++;
@@ -1663,7 +1663,7 @@ bool colour_scc_cluster_greedy(int scc_id, int *colour, int current_colour, Plut
}
common_dims = get_common_parallel_dims(scc_id, convex_successors, num_convex_successors, colour, current_colour, parallel_dims, prog);
- colouring_dim = choose_colouring_dim(common_dims,max_dim);
+ colouring_dim = get_colouring_dim(common_dims,max_dim);
if (colouring_dim == -1) {
for (i=0; i<max_dim; i++) {
if (parallel_dims[i]) {
|
dm-hook: reload agents on dm-hook state change
This fixes the %notify bug that prevented dms from coming through. | ::
+$ state-0 [%0 base-state-0]
+$ state-1 [%1 base-state-0]
++$ state-2 [%2 base-state-0]
+$ versioned-state
$% state-0
state-1
+ state-2
==
+$ card card:agent:gall
+$ nodes (map index:store node:store)
++ orm orm:store
--
::
-=| state-1
+=| state-2
=* state -
%- agent:dbug
^- agent:gall
::
++ on-save !>(state)
++ on-load
- |= =vase
+ |= =old=vase
^- (quip card _this)
- =+ !<(old=versioned-state vase)
- ?: ?=(%1 -.old) `this(state old)
- :_ this(state [%1 +.old])
- (poke-self:pass noun+!>(%reinit))^~
+ =+ !<(old=versioned-state old-vase)
+ =| cards=(list card)
+ |-
+ ?- -.old
+ %0
+ %_($ -.old %1)
+ %1
+ %_ $
+ -.old %2
+ cards (weld cards (poke-our:pass %goad noun+!>(%force))^~)
+ ==
+ %2
+ :_ this(state old)
+ (weld cards (poke-self:pass noun+!>(%reinit))^~)
+ ==
::
++ on-poke
|= [=mark =vase]
|
[Makefile] Remove Halide's dependency on toolchain | @@ -36,10 +36,10 @@ CXX = g++-8.2.0
endif
# Default target
-all: halide
+all: toolchain riscv-isa-sim halide
# Halide
-halide: toolchain
+halide:
mkdir -p $(HALIDE_INSTALL_DIR)
cd toolchain/halide && mkdir -p build && cd build; \
$(CMAKE) \
@@ -68,7 +68,7 @@ tc-llvm:
-DCMAKE_C_COMPILER=$(CC) \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_TARGETS_TO_BUILD="RISCV;host" \
- -DLLVM_BUILD_DOCS="1" \
+ -DLLVM_BUILD_DOCS="0" \
-DLLVM_ENABLE_TERMINFO="0" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=Release \
|
NULL check before calling session_handshake | @@ -61,7 +61,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
libssh2_session_set_blocking(session, 1);
}
- if(libssh2_session_handshake(session, socket_fds[0])) {
+ if(session && libssh2_session_handshake(session, socket_fds[0])) {
goto EXIT_LABEL;
}
|
Some review nits from George | @@ -601,12 +601,12 @@ struct config_file {
/** number of slabs for dnscrypt nonces cache */
size_t dnscrypt_nonce_cache_slabs;
- /** EDNS padding according to FC7830 and RFC8467 */
+ /** EDNS padding according to RFC7830 and RFC8467 */
/** true to enable padding of responses (default: on) */
int pad_responses;
/** block size with which to pad encrypted responses (default: 468) */
size_t pad_responses_block_size;
- /** true to enable padding of queries (default: off) */
+ /** true to enable padding of queries (default: on) */
int pad_queries;
/** block size with which to pad encrypted queries (default: 128) */
size_t pad_queries_block_size;
|
Fixes for pg_dump.c regarding multiranges
This commit fixes two wrong version number checks and one wrong check for null. | @@ -4541,7 +4541,7 @@ binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
*/
if (include_multirange_type)
{
- if (fout->remoteVersion >= 130000)
+ if (fout->remoteVersion >= 140000)
{
appendPQExpBuffer(upgrade_query,
"SELECT t.oid, t.typarray "
@@ -8402,7 +8402,7 @@ getCasts(Archive *fout, int *numCasts)
int i_castcontext;
int i_castmethod;
- if (fout->remoteVersion >= 130000)
+ if (fout->remoteVersion >= 140000)
{
appendPQExpBufferStr(query, "SELECT tableoid, oid, "
"castsource, casttarget, castfunc, castcontext, "
@@ -10709,7 +10709,7 @@ dumpRangeType(Archive *fout, TypeInfo *tyinfo)
appendPQExpBuffer(q, "\n subtype = %s",
PQgetvalue(res, 0, PQfnumber(res, "rngsubtype")));
- if (PQgetvalue(res, 0, PQfnumber(res, "rngmultitype")))
+ if (!PQgetisnull(res, 0, PQfnumber(res, "rngmultitype")))
appendPQExpBuffer(q, ",\n multirange_type_name = %s",
PQgetvalue(res, 0, PQfnumber(res, "rngmultitype")));
|
fix generation of the checkpoint config file | @@ -702,7 +702,7 @@ nextslot:
fprintf(f, "number of cores: %u\n", ncores);
fprintf(f, "memory size: 0x%zx\n", guest_size);
fprintf(f, "checkpoint number: %u\n", no_checkpoint);
- fprintf(f, "entry point: 0x%zx", elf_entry);
+ fprintf(f, "entry point: 0x%zx\n", elf_entry);
if (full_checkpoint)
fprintf(f, "full checkpoint: 1");
else
|
UART: Add return in uart_wait_tx_done
uart_wait_tx_done quit due to timeout but without return ESP_ERR_TIMEOUT. | @@ -1024,6 +1024,7 @@ esp_err_t uart_wait_tx_done(uart_port_t uart_num, TickType_t ticks_to_wait)
uart_hal_disable_intr_mask(&(uart_context[uart_num].hal), UART_INTR_TX_DONE);
UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock));
xSemaphoreGive(p_uart_obj[uart_num]->tx_mux);
+ return ESP_ERR_TIMEOUT;
}
xSemaphoreGive(p_uart_obj[uart_num]->tx_mux);
return ESP_OK;
|
add empty method to array_ref.pxd | +from libcpp cimport bool as bool_t
+
cdef extern from "util/generic/array_ref.h" nogil:
cdef cppclass TArrayRef[T]:
@@ -5,6 +7,7 @@ cdef extern from "util/generic/array_ref.h" nogil:
T& operator[](size_t)
+ bool_t empty()
T* data() except +
size_t size() except +
T* begin() except +
@@ -15,6 +18,7 @@ cdef extern from "util/generic/array_ref.h" nogil:
const T& operator[](size_t)
+ bool_t empty()
const T* data() except +
size_t size() except +
const T* begin() except +
|
bail %exit in _cj_site_lock if axis is not in core | @@ -1443,7 +1443,7 @@ _cj_site_lock(u3_noun loc, u3_noun cor, u3j_site* sit_u)
(c3y == u3r_sing(sit_u->bat, u3h(cor))) ) {
return;
}
- sit_u->pog_p = _cj_prog(loc, u3r_at(sit_u->axe, cor));
+ sit_u->pog_p = _cj_prog(loc, u3x_at(sit_u->axe, cor));
if ( u3_none != sit_u->bat ) {
u3z(sit_u->bat);
}
|
http3client: do not abort when resolving name error
Issues | @@ -212,15 +212,16 @@ static void call_proceed_req(struct st_h2o_http3client_req_t *req, const char *e
req->proceed_req.cb(&req->super, errstr);
}
-static void destroy_connection(struct st_h2o_httpclient__h3_conn_t *conn)
+static void error_destroy_connection(struct st_h2o_httpclient__h3_conn_t *conn, const char *errstr)
{
+ assert(errstr != NULL);
if (h2o_linklist_is_linked(&conn->link))
h2o_linklist_unlink(&conn->link);
while (!h2o_linklist_is_empty(&conn->pending_requests)) {
struct st_h2o_http3client_req_t *req =
H2O_STRUCT_FROM_MEMBER(struct st_h2o_http3client_req_t, link, conn->pending_requests.next);
h2o_linklist_unlink(&req->link);
- req->super._cb.on_connect(&req->super, h2o_socket_error_conn_fail, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ req->super._cb.on_connect(&req->super, errstr, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
destroy_request(req);
}
assert(h2o_linklist_is_empty(&conn->pending_requests));
@@ -234,10 +235,15 @@ static void destroy_connection(struct st_h2o_httpclient__h3_conn_t *conn)
free(conn);
}
+static void destroy_connection(struct st_h2o_httpclient__h3_conn_t *conn)
+{
+ error_destroy_connection(conn, h2o_socket_error_conn_fail);
+}
+
static void on_connect_timeout(h2o_timer_t *timeout)
{
struct st_h2o_httpclient__h3_conn_t *conn = H2O_STRUCT_FROM_MEMBER(struct st_h2o_httpclient__h3_conn_t, timeout, timeout);
- destroy_connection(conn);
+ error_destroy_connection(conn, h2o_httpclient_error_connect_timeout);
}
static void start_connect(struct st_h2o_httpclient__h3_conn_t *conn, struct sockaddr *sa)
@@ -277,7 +283,7 @@ static void start_connect(struct st_h2o_httpclient__h3_conn_t *conn, struct sock
return;
Fail:
free(address_token.base);
- destroy_connection(conn);
+ error_destroy_connection(conn, h2o_httpclient_error_internal);
}
static void on_getaddr(h2o_hostinfo_getaddr_req_t *getaddr_req, const char *errstr, struct addrinfo *res, void *_conn)
@@ -288,8 +294,8 @@ static void on_getaddr(h2o_hostinfo_getaddr_req_t *getaddr_req, const char *errs
conn->getaddr_req = NULL;
if (errstr != NULL) {
- /* TODO reconnect */
- abort();
+ error_destroy_connection(conn, errstr);
+ return;
}
struct addrinfo *selected = h2o_hostinfo_select_one(res);
|
Check for SOCK_CLOEXEC.
Not available on all platforms. | @@ -103,10 +103,19 @@ typedef struct {
#define JPollStruct struct pollfd
#define JSock int
#define JReadInt ssize_t
+#ifdef SOCK_CLOEXEC
#define JSOCKFLAGS SOCK_CLOEXEC
+#else
+#define JSOCKFLAGS 0
+#endif
static JanetStream *make_stream(int fd, int flags) {
JanetStream *stream = janet_abstract(&StreamAT, sizeof(JanetStream));
- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
+#ifndef SOCK_CLOEXEC
+ int extra = O_CLOEXEC;
+#else
+ int extra = 0;
+#endif
+ fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK | extra);
stream->fd = fd;
stream->flags = flags;
return stream;
|
hslua-module-system: update copyright notices, it's 2021 | -Copyright (c) 2019 Albert Krewinkel
+Copyright (c) 2019-2021 Albert Krewinkel
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
VERSION bump to version 2.0.70 | @@ -58,7 +58,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# set version of the project
set(LIBYANG_MAJOR_VERSION 2)
set(LIBYANG_MINOR_VERSION 0)
-set(LIBYANG_MICRO_VERSION 69)
+set(LIBYANG_MICRO_VERSION 70)
set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_MICRO_VERSION})
# set version of the library
set(LIBYANG_MAJOR_SOVERSION 2)
|
Install PostgresVersion.pm
A lamentable oversight on my part meant that when PostgresVersion.pm was
added in commit provision to install it was not added to the
Makefile, so it was not installed along with the other perl modules. | @@ -23,11 +23,13 @@ install: all installdirs
$(INSTALL_DATA) $(srcdir)/SimpleTee.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/SimpleTee.pm'
$(INSTALL_DATA) $(srcdir)/RecursiveCopy.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/RecursiveCopy.pm'
$(INSTALL_DATA) $(srcdir)/PostgresNode.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresNode.pm'
+ $(INSTALL_DATA) $(srcdir)/PostgresVersion.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresVersion.pm'
uninstall:
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/TestLib.pm'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/SimpleTee.pm'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/RecursiveCopy.pm'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresNode.pm'
+ rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresVersion.pm'
endif
|
Fix occasional luac.cross crash
A block of memory is accessed after having been freed. This was obscured by the fact that 'oBuf' is a pointer into the middle of the block 'dynamicTables', so when dynamicTables is freed, oBuf is pointing to freed memory. Occasionally, luac.cross would crash because of this. | @@ -568,7 +568,6 @@ int uzlib_compress (uchar **dest, uint *destLen, const uchar *src, uint srcLen)
status = UZLIB_OK;
}
- FREE(dynamicTables);
for (i=0; i<20;i++) DBG_PRINT("count %u = %u\n",i,debugCounts[i]);
if (status == UZLIB_OK) {
@@ -581,5 +580,7 @@ int uzlib_compress (uchar **dest, uint *destLen, const uchar *src, uint srcLen)
FREE(oBuf->buffer);
}
+ FREE(dynamicTables);
+
return status;
}
|
web ui: add name to release notes | @@ -107,28 +107,28 @@ Try it out now on: http://webdemo.libelektra.org/
1.5 changelog:
-- search completely reworked - it does not act as a filter on already opened keys anymore, and instead searches the whole key database - feedback from the search was also greatly improved (pulsating while searching, glowing blue when done)
-- added "abort" buttons to dialogs to revert actions
-- added "create array" button to easily create arrays
-- removed confirmation dialog before deletion (undo can be used instead)
-- created a docker image: `elektra/web`
-- implemented auto-deployment of webdemo.libelektra.org
-- small fixes:
- - updated visibility levels
- - removed "done" button in main view
- - fixed issues with the opener click area
- - remove metakeys when they are set to the default value or empty/0
- - improved keyboard support
- - fixed many small issues (#2037)
+- search completely reworked - it does not act as a filter on already opened keys anymore, and instead searches the whole key database - feedback from the search was also greatly improved (pulsating while searching, glowing blue when done) *(Daniel Bugl)*
+- added "abort" buttons to dialogs to revert actions *(Daniel Bugl)*
+- added "create array" button to easily create arrays *(Daniel Bugl)*
+- removed confirmation dialog before deletion (undo can be used instead) *(Daniel Bugl)*
+- created a docker image: `elektra/web` *(Daniel Bugl)*
+- implemented auto-deployment of webdemo.libelektra.org *(Daniel Bugl)*
+- small fixes: *(Daniel Bugl)*
+ - updated visibility levels *(Daniel Bugl)*
+ - removed "done" button in main view *(Daniel Bugl)*
+ - fixed issues with the opener click area *(Daniel Bugl)*
+ - remove metakeys when they are set to the default value or empty/0 *(Daniel Bugl)*
+ - improved keyboard support *(Daniel Bugl)*
+ - fixed many small issues (#2037) *(Daniel Bugl)*
1.6 changelog:
-- fixed bugs related to arrays (#2103)
-- improved performance of search for many results
-- added 404 page for invalid instance ids
-- implement drag & copy by holding the Ctrl or Alt key
-- add button to show error details
-- allow deleting all keys in a namespace
+- fixed bugs related to arrays (#2103) *(Daniel Bugl)*
+- improved performance of search for many results *(Daniel Bugl)*
+- added 404 page for invalid instance ids *(Daniel Bugl)*
+- implement drag & copy by holding the Ctrl or Alt key *(Daniel Bugl)*
+- add button to show error details *(Daniel Bugl)*
+- allow deleting all keys in a namespace *(Daniel Bugl)*
## Plugins
|
[Cita][#1193]add recipient_str check | @@ -120,6 +120,24 @@ BOAT_RESULT BoatCitaTxInit(BoatCitaWallet *wallet_ptr,
// Set synchronous transaction flag
tx_ptr->is_sync_tx = is_sync_tx;
+ if (!UtilityStringIsHex(recipient_str))
+ {
+ BoatLog(BOAT_LOG_CRITICAL, "The format of recipient is incorrect");
+ return BOAT_ERROR_COMMON_INVALID_ARGUMENT;
+ }
+
+ if (UtilityStringLenCheck(recipient_str) != BOAT_SUCCESS)
+ {
+ BoatLog(BOAT_LOG_CRITICAL, "The length of string recipient_str is incorrect");
+ return BOAT_ERROR_COMMON_INVALID_ARGUMENT;
+ }
+
+ if (strlen(recipient_str) != 42)
+ {
+ BoatLog(BOAT_LOG_CRITICAL, "The length of string recipient_str is incorrect");
+ return BOAT_ERROR_COMMON_INVALID_ARGUMENT;
+ }
+
// Initialize recipient
BUINT32 converted_len;
BUINT8 recipient[BOAT_CITA_ADDRESS_SIZE];
|
Fix typos in operatorcmds.c
Author: Kyotaro Horiguchi, Justin Pryzby
Discussion: | @@ -265,7 +265,7 @@ DefineOperator(List *names, List *parameters)
}
/*
- * Look up a restriction estimator function ny name, and verify that it has
+ * Look up a restriction estimator function by name, and verify that it has
* the correct signature and we have the permissions to attach it to an
* operator.
*/
@@ -300,7 +300,7 @@ ValidateRestrictionEstimator(List *restrictionName)
}
/*
- * Look up a join estimator function ny name, and verify that it has the
+ * Look up a join estimator function by name, and verify that it has the
* correct signature and we have the permissions to attach it to an
* operator.
*/
|
{AH} add htslib conda dependencies explicitely. | @@ -26,7 +26,7 @@ bash Miniconda3.sh -b
# Create a new conda environment with the target python version
~/miniconda3/bin/conda install conda-build -y
-~/miniconda3/bin/conda create -q -y --name testenv python=$CONDA_PY cython numpy pytest psutil pip
+~/miniconda3/bin/conda create -q -y --name testenv python=$CONDA_PY cython numpy pytest psutil pip xz curl bzip2
# activate testenv environment
source ~/miniconda3/bin/activate testenv
|
DM: virtio-gpio: use virtio_base as the first member of virtio_gpio
For virtio-based device, it needs to use virtio_base as the first member
otherwise, virtio_linkup will fail.
Acked-by: Yu Wang | @@ -186,8 +186,8 @@ struct native_gpio_chip {
};
struct virtio_gpio {
- pthread_mutex_t mtx;
struct virtio_base base;
+ pthread_mutex_t mtx;
struct virtio_vq_info queues[VIRTIO_GPIO_MAXQ];
struct native_gpio_chip chips[VIRTIO_GPIO_MAX_CHIPS];
uint32_t nchip;
|
jni: rephrase docu | Allows you to write plugins in Java.
-Needs Java 8 or later. While the plugin internally uses JNI, the Java
+This plugin needs the JNA bindings to work.
+Furthermore, it requires Java 8 or later.
+
+While the plugin internally uses JNI (thus the name), the Java
binding for your Java plugin may use something different, e.g. JNA.
The requirements for the Java bindings are:
@@ -32,7 +35,13 @@ The Java plugin itself needs to have the following methods:
### Java prerequisites on Debian 9
-openjdk-8 and 9 does not work reliable: jvm crashes without usable backtrace.
+openjdk-8 and 9 do not work reliable: jvm crashes without usable backtrace.
+
+When using non-standard paths, you have to set JAVA_HOME before invoking cmake.
+(For example when you unpack Oracle Java to `/usr/local` or `/opt`.)
+For example:
+
+ JAVA_HOME=/usr/local/jdk-9.0.1
|
reduce pcapng file size | @@ -2868,10 +2868,12 @@ for(zeiger = aplist; zeiger < aplist +MACLIST_MAX -1; zeiger++)
}
if((zeiger->count %zeiger->dpv) == 0)
{
- if(zeiger->status < NET_M3)
+ if((zeiger->status & NET_PMKID) == NET_PMKID) return;
+ if((zeiger->status & NET_M3) == NET_M3) return;
{
if((attackstatus &DISABLE_AP_ATTACKS) != DISABLE_AP_ATTACKS) send_deauthentication_broadcast(macfrx->addr2, WLAN_REASON_UNSPECIFIED);
}
+ zeiger->dpv += 1;
}
return;
}
@@ -2941,7 +2943,8 @@ for(zeiger = aplist; zeiger < aplist +MACLIST_MAX -1; zeiger++)
}
if((zeiger->count %zeiger->dpv) == 0)
{
- if(zeiger->status < NET_M3)
+ if((zeiger->status & NET_PMKID) == NET_PMKID) return;
+ if((zeiger->status & NET_M3) == NET_M3) return;
{
if((attackstatus &DISABLE_AP_ATTACKS) != DISABLE_AP_ATTACKS) send_deauthentication_broadcast(macfrx->addr2, WLAN_REASON_UNSPECIFIED);
}
|
osiris: Remove unused gpio define
Remove GPIO73 input define
BRANCH=none
TEST=HW team confirmed IO voltage as expected | @@ -74,7 +74,6 @@ GPIO(LED_1_L, PIN(C, 4), GPIO_OUT_HIGH)
GPIO(LED_2_L, PIN(C, 3), GPIO_OUT_HIGH)
GPIO(KYBL_EN, PIN(A, 7), GPIO_OUT_LOW)
GPIO(AMP_PWR_EN, PIN(5, 7), GPIO_OUT_LOW)
-GPIO(EC_FAN_TACH_2, PIN(7, 3), GPIO_INPUT)
GPIO(RGB_KB_INT, PIN(5, 6), GPIO_INPUT)
/* UART alternate functions */
|
out_http: fix SIGSEGV on uninitialized json buffer
We mistakenly allowed msgpack_to_json() to work on an uninitialized
buffer, by deferring the check of the return code from the json
converter function. | @@ -126,6 +126,10 @@ static char *msgpack_to_json(struct flb_out_http *ctx, char *data, uint64_t byte
/* Format to JSON */
ret = flb_msgpack_raw_to_json_str(tmp_sbuf.data, tmp_sbuf.size,
&json_buf, &json_size);
+ if (ret != 0) {
+ msgpack_sbuffer_destroy(&tmp_sbuf);
+ return NULL;
+ }
/* Optionally convert to JSON stream from JSON array */
if ((ctx->out_format == FLB_HTTP_OUT_JSON_STREAM) ||
@@ -161,9 +165,6 @@ static char *msgpack_to_json(struct flb_out_http *ctx, char *data, uint64_t byte
}
msgpack_sbuffer_destroy(&tmp_sbuf);
- if (ret != 0) {
- return NULL;
- }
*out_size = json_size;
return json_buf;
|
docs - removed gpperfmon.conf parameter ignore_qexec_packet | @@ -210,15 +210,6 @@ host all gpmon ::1/128 <b>password</b></codeblock></p>
from the <codeph>gpperfmon</codeph> external (<codeph>_tail</codeph>) tables to their
corresponding history files. The default is 120. The minimum value is 30. </stentry>
</strow>
- <strow>
- <stentry>ignore_qexec_packet</stentry>
- <stentry>(Deprecated) When set to true, data collection agents do not collect performance
- data in the <codeph>gpperfmon</codeph> database <codeph>queries_*</codeph> tables:
- <codeph>rows_out</codeph>, <codeph>cpu_elapsed</codeph>, <codeph>cpu_currpct</codeph>,
- <codeph>skew_cpu</codeph>, and <codeph>skew_rows</codeph>. The default setting, true,
- reduces the amount of memory consumed by the <codeph>gpmmon</codeph> process. Set this
- parameter to false if you require this additional performance data.</stentry>
- </strow>
<strow>
<stentry>smdw_aliases</stentry>
<stentry>This parameter allows you to specify additional host names for the standby
|
Fix comments for PR 14534.
Fix some comments format for PR | @@ -1659,7 +1659,7 @@ CreateExtensionInternal(char *extensionName,
/*
* On the QD and the QE's updateVersions list is calculated
* and this lists are the same. Thus ApplyExtensionUpdates
- * call for must be forbidden at QE. (It would be dispatchered
+ * call must be forbidden at QE. (It would be dispatchered
* from QD a bit later)
*/
if (Gp_role != GP_ROLE_EXECUTE)
|
[core] fix crash after specific err in config file | @@ -384,7 +384,8 @@ static int gw_proc_sockaddr_init(gw_host * const host, gw_proc * const proc, log
errno = EINVAL;
return -1;
}
- else {
+ else if (host->host->size) {
+ /*(skip if constant string set in gw_set_defaults_backend())*/
/* overwrite host->host buffer with IP addr string so that
* any further use of gw_host does not block on DNS lookup */
buffer *h;
@@ -1532,7 +1533,7 @@ int gw_set_defaults_backend(server *srv, gw_plugin_data *p, const array *a, gw_p
}
if (buffer_string_is_empty(host->host)) {
- static const buffer lhost = {CONST_STR_LEN("127.0.0.1"), 0};
+ static const buffer lhost ={CONST_STR_LEN("127.0.0.1")+1,0};
host->host = &lhost;
}
|
runtime: allow benign timer race condition
this prevents a deadlock when a kthread is preempted while
holding the timer lock | @@ -151,15 +151,12 @@ uint64_t timer_earliest_deadline()
struct kthread *k = myk();
uint64_t deadline_us;
- spin_lock(&k->timer_lock);
-
+ /* deliberate race condition */
if (k->timern == 0)
deadline_us = 0;
else
deadline_us = k->timers[0].deadline_us;
- spin_unlock(&k->timer_lock);
-
return deadline_us;
}
|
Check for nullptr surface spritesheet | @@ -113,6 +113,7 @@ namespace blit {
* \param[in] transform to apply
*/
void Surface::sprite(uint16_t sprite, const Point &position, uint8_t transform) {
+ if(sprites == nullptr) return;
blit_sprite(
sprites->sprite_bounds(sprite),
position,
@@ -127,6 +128,7 @@ namespace blit {
* \param[in] transform to apply
*/
void Surface::sprite(const Point &sprite, const Point &position, uint8_t transform) {
+ if(sprites == nullptr) return;
blit_sprite(
sprites->sprite_bounds(sprite),
position,
@@ -141,6 +143,7 @@ namespace blit {
* \param[in] transform to apply
*/
void Surface::sprite(const Rect &sprite, const Point &position, uint8_t transform) {
+ if(sprites == nullptr) return;
blit_sprite(
sprites->sprite_bounds(sprite),
position,
@@ -197,6 +200,8 @@ namespace blit {
* \param[in] transform to apply
*/
void Surface::sprite(uint16_t sprite, const Point &position, const Point &origin, const Vec2 &scale, uint8_t transform) {
+ if(sprites == nullptr) return;
+
Rect dest_rect(
roundf(position.x - float(origin.x * scale.x)),
roundf(position.y - float(origin.y * scale.y)),
@@ -220,6 +225,8 @@ namespace blit {
* \param[in] transform to apply
*/
void Surface::sprite(const Point &sprite, const Point &position, const Point &origin, const Vec2 &scale, uint8_t transform) {
+ if(sprites == nullptr) return;
+
Rect dest_rect(
roundf(position.x - float(origin.x * scale.x)),
roundf(position.y - float(origin.y * scale.y)),
@@ -243,6 +250,8 @@ namespace blit {
* \param[in] transform to apply
*/
void Surface::sprite(const Rect &sprite, const Point &position, const Point &origin, const Vec2 &scale, uint8_t transform) {
+ if(sprites == nullptr) return;
+
Rect dest_rect(
roundf(position.x - float(origin.x * scale.x)),
roundf(position.y - float(origin.y * scale.y)),
|
haskell-build-fixes: update dependencies | @@ -19,7 +19,7 @@ if (HASKELL_FOUND)
set (BINDING_HASKELL_NAME "${BINDING_HASKELL_NAME}${GHC_DYNAMIC_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (CABAL_OPTS "--enable-shared")
if (BUILD_SHARED)
- set (ELEKTRA_DEPENDENCY "elektra;elektra-kdb;elektra-ease;")
+ set (ELEKTRA_DEPENDENCY "elektra;elektra-kdb;elektra-ease;elektra-invoke;elektra-pluginprocess")
elseif (BUILD_FULL)
set (ELEKTRA_DEPENDENCY "elektra-full;")
endif ()
|
test-ipmi-hiomap: Dump unexpected IPMI messages
These indicate an implementation bug or broken scenario. Either way it's
helpful to know what arrived given it wasn't expected.
Cc: stable | @@ -146,6 +146,9 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg)
assert(ctx->cursor->p->type == scenario_cmd);
cmd = &ctx->cursor->p->c;
} else {
+ printf("Got unexpected request:\n");
+ for (ssize_t i = 0; i < msg->req_size; i++)
+ printf("msg->data[%zd]: 0x%02x\n", i, msg->data[i]);
assert(false);
}
|
Fixes BAS list 'Error: Break at: end of program' error. | @@ -731,11 +731,6 @@ struct Value *Program_list(struct Program *this, int dev, int watchIntr,
{
return Value_new_ERROR(value, IOERROR, FS_errmsg);
}
-
- if (watchIntr)
- {
- return Value_new_ERROR(value, BREAK);
- }
}
String_destroy(&s);
|
Fix --os overriding the target OS. | context.addFilter(self, "_ACTION", _ACTION)
context.addFilter(self, "action", _ACTION)
- self.system = self.system or p.action.current().targetos or os.target()
+ self.system = self.system or os.target()
context.addFilter(self, "system", os.getSystemTags(self.system))
-- Add command line options to the filtering options
-- Now filter on the current system and architecture, allowing the
-- values that might already in the context to override my defaults.
- self.system = self.system or p.action.current().targetos or os.target()
+ self.system = self.system or os.target()
context.addFilter(self, "system", os.getSystemTags(self.system))
context.addFilter(self, "architecture", self.architecture)
context.addFilter(self, "tags", self.tags)
-- More than a convenience; this is required to work properly with
-- external Visual Studio project files.
- local system = p.action.current().targetos or os.target()
+ local system = os.target()
local architecture = nil
local toolset = p.action.current().toolset
|
fixed wording in help: not all wlan interfaces are suitable | @@ -3980,7 +3980,7 @@ printf("%s %s (C) %s ZeroBeat\n"
"-A <digit> : ap attack interval\n"
" default: %d (every %d beacons)\n"
" the target beacon interval is used as trigger\n"
- "-I : show suitable wlan interfaces and quit\n"
+ "-I : show wlan interfaces and quit\n"
"-h : show this help\n"
"-v : show version\n"
"\n"
|
examples: Set LSM6DSOX INT pin mode and pull. | @@ -16,7 +16,7 @@ def imu_int_handler(pin):
INT_FLAG = True
if (INT_MODE == True):
- int_pin = Pin(24)
+ int_pin = Pin(24, mode=Pin.IN, pull=Pin.PULL_UP)
int_pin.irq(handler=imu_int_handler, trigger=Pin.IRQ_RISING)
i2c = I2C(0, scl=Pin(13), sda=Pin(12))
|
proc: fix leaks | @@ -657,6 +657,7 @@ static void process_exec(thread_t *current, process_spawn_t *spawn)
if (spawn->parent == NULL) {
/* if execing without vfork */
hal_spinlockDestroy(&spawn->sl);
+ vm_objectPut(spawn->object);
}
else {
hal_spinlockSet(&spawn->sl);
@@ -725,6 +726,7 @@ int proc_spawn(vm_object_t *object, offs_t offset, size_t size, const char *path
}
hal_spinlockDestroy(&spawn.sl);
+ vm_objectPut(spawn.object);
return spawn.state < 0 ? spawn.state : pid;
}
@@ -885,6 +887,7 @@ int proc_vfork(void)
if (isparent) {
hal_spinlockDestroy(&spawn->sl);
+ vm_objectPut(spawn->object);
ret = spawn->state;
vm_kfree(spawn);
return ret < 0 ? ret : pid;
@@ -1052,11 +1055,19 @@ int proc_execve(const char *path, char **argv, char **envp)
return -ENOMEM;
}
- if ((err = proc_lookup(path, NULL, &oid)) < 0)
+ if ((err = proc_lookup(path, NULL, &oid)) < 0) {
+ vm_kfree(kpath);
+ vm_kfree(argv);
+ vm_kfree(envp);
return err;
+ }
- if ((err = vm_objectGet(&object, oid)) < 0)
+ if ((err = vm_objectGet(&object, oid)) < 0) {
+ vm_kfree(kpath);
+ vm_kfree(argv);
+ vm_kfree(envp);
return err;
+ }
if ((spawn = current->execdata) == NULL) {
spawn = current->execdata = &sspawn;
@@ -1074,6 +1085,8 @@ int proc_execve(const char *path, char **argv, char **envp)
spawn->size = object->size;
vm_kfree(current->process->path);
+ vm_kfree(current->process->envp);
+ vm_kfree(current->process->argv);
current->process->path = kpath;
|
Avoid using previous data if fragments are missing. | @@ -418,6 +418,11 @@ copy_frags2uip(int context)
/* Copy from the fragment context info buffer first */
memcpy((uint8_t *)UIP_IP_BUF, (uint8_t *)frag_info[context].first_frag,
frag_info[context].first_frag_len);
+
+ /* Ensure that no previous data is used for reassembly in case of missing fragments. */
+ memset((uint8_t *)UIP_IP_BUF + frag_info[context].first_frag_len, 0,
+ frag_info[context].len - frag_info[context].first_frag_len);
+
for(i = 0; i < SICSLOWPAN_FRAGMENT_BUFFERS; i++) {
/* And also copy all matching fragments */
if(frag_buf[i].len > 0 && frag_buf[i].index == context) {
|
opmphm: simplify allocator | @@ -520,16 +520,7 @@ void opmphmGraphDel (OpmphmGraph * graph)
*/
Opmphm * opmphmNew (void)
{
- Opmphm * out = elektraCalloc (sizeof (Opmphm));
- if (!out)
- {
- return NULL;
- }
- out->size = 0;
- out->rUniPar = 0;
- out->componentSize = 0;
- out->flags = 0;
- return out;
+ return elektraCalloc (sizeof (Opmphm));
}
/**
|
Correct the version comparison function in build_visit. | @@ -59,6 +59,7 @@ enhancements and bug-fixes that were added to this release.</p>
<li>Updated build_visit scripts for macOS 10.15</li>
<li>Removed FastBit and FastQuery from VisIt.</li>
<li>Added notarization capability to the masonry macOS build scripts.</li>
+ <li>Updated a version comparison function in build_visit so that it worked on Manjaro Linux, an Arch Linux derivative.</li>
</ul>
<p>Click the following link to view the release notes for the previous version
|
Add clap_fd_flags for consistency | @@ -17,17 +17,19 @@ typedef int clap_fd;
#endif
enum {
+ // IO events
CLAP_FD_READ = 1 << 0,
CLAP_FD_WRITE = 1 << 1,
CLAP_FD_ERROR = 1 << 2,
};
+typedef uint32_t clap_fd_flags;
typedef struct clap_plugin_event_loop {
// [main-thread]
void (*on_timer)(const clap_plugin *plugin, clap_id timer_id);
// [main-thread]
- void (*on_fd)(const clap_plugin *plugin, clap_fd fd, uint32_t flags);
+ void (*on_fd)(const clap_plugin *plugin, clap_fd fd, clap_fd_flags flags);
} clap_plugin_event_loop;
typedef struct clap_host_event_loop {
@@ -41,10 +43,10 @@ typedef struct clap_host_event_loop {
bool (*unregister_timer)(const clap_host *host, clap_id timer_id);
// [main-thread]
- bool (*register_fd)(const clap_host *host, clap_fd fd, uint32_t flags);
+ bool (*register_fd)(const clap_host *host, clap_fd fd, clap_fd_flags flags);
// [main-thread]
- bool (*modify_fd)(const clap_host *host, clap_fd fd, uint32_t flags);
+ bool (*modify_fd)(const clap_host *host, clap_fd fd, clap_fd_flags flags);
// [main-thread]
bool (*unregister_fd)(const clap_host *host, clap_fd fd);
|
lv_cong_templ.h: disable lv_app_wifi/gsm/ethetnet | #define LV_APP_FILES_CHUNK_MAX_SIZE 1024 /*Max chunk size when the user sets it*/
#endif /*USE_LV_APP_FILES != 0*/
-
/*Benchmark*/
#define USE_LV_APP_BENCHMARK 1
#if USE_LV_APP_BENCHMARK != 0
#endif
/*WiFi*/
-#define USE_LV_APP_WIFI 1
+#define USE_LV_APP_WIFI 0
#if USE_LV_APP_WIFI != 0
#define LV_APP_WIFI_CONF_PATH "S:/wifi_conf.txt" /*Save config. here. Comment to use def. value*/
#ifndef LV_APP_WIFI_CONF_PATH
#endif /*USE_LV_APP_WIFI != 0*/
/*GSM*/
-#define USE_LV_APP_GSM 1
+#define USE_LV_APP_GSM 0
#if USE_LV_APP_GSM != 0
#define LV_APP_GSM_CONF_PATH "S:/gsm_conf.txt" /*Save config. here. Comment to use def. value*/
#ifndef LV_APP_GSM_CONF_PATH
#endif /*USE_LV_APP_GSM != 0*/
/*Ethernet*/
-#define USE_LV_APP_ETHERNET 1
+#define USE_LV_APP_ETHERNET 0
#if USE_LV_APP_ETHERNET != 0
/*No settings*/
#endif /*USE_LV_APP_ETHERNET != 0*/
|
doc/release notes: added short description | @@ -255,6 +255,8 @@ you up-to-date with the multi-language support provided by Elektra.
- <<TODO>>
- Add readme-file [Iterators](/doc/dev/iterators.md) about cm2022s project showcasing usage in various programming languages _(Florian Lindner @flo91 and @Milangs)_
- Remove usage of internal iterators from the examples
+- Add readme-file about cm2022s project (/doc/dev/iterators.md) _(Florian Lindner @flo91)_
+- Updated elektra-web installation manual (doc/tutorials/install-webui.md) _(Leonard Guelmino @leothetryhard, Lukas Hartl @lukashartl)_
- <<TODO>>
- <<TODO>>
- Improve jna documentation _(Burkhard Hampl @bhampl)_
|
Add documentation to find_ecdsa_private_key() | @@ -823,12 +823,29 @@ static int pk_ecdsa_sig_asn1_from_psa( unsigned char *sig, size_t *sig_len,
return( 0 );
}
+/* Locate an ECDSA privateKey in a RFC 5915, or SEC1 Appendix C.4 ASN.1 buffer
+ *
+ * [in/out] buf: ASN.1 buffer start as input - ECDSA privateKey start as output
+ * [in] end: ASN.1 buffer end
+ * [out] key_len: the ECDSA privateKey length in bytes
+ */
static int find_ecdsa_private_key( unsigned char **buf, unsigned char *end,
size_t *key_len )
{
size_t len;
int ret;
+ /*
+ * RFC 5915, or SEC1 Appendix C.4
+ *
+ * ECPrivateKey ::= SEQUENCE {
+ * version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
+ * privateKey OCTET STRING,
+ * parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
+ * publicKey [1] BIT STRING OPTIONAL
+ * }
+ */
+
if( ( ret = mbedtls_asn1_get_tag( buf, end, &len,
MBEDTLS_ASN1_CONSTRUCTED |
MBEDTLS_ASN1_SEQUENCE ) ) != 0 )
|
load all yml files while assigning tests | """
Command line tool to assign unit tests to CI test jobs.
"""
-
+import os
import re
import argparse
@@ -145,15 +145,33 @@ class UnitTestAssignTest(CIAssignTest.AssignTest):
The unit test cases is stored in a yaml file which is created in job build-idf-test.
"""
+ def find_by_suffix(suffix, path):
+ res = []
+ for root, _, files in os.walk(path):
+ for file in files:
+ if file.endswith(suffix):
+ res.append(os.path.join(root, file))
+ return res
+
+ def get_test_cases_from_yml(yml_file):
try:
- with open(test_case_path, "r") as f:
- raw_data = yaml.load(f, Loader=Loader)
- test_cases = raw_data["test cases"]
- for case in test_cases:
- case["tags"] = set(case["tags"])
- except IOError:
- print("Test case path is invalid. Should only happen when use @bot to skip unit test.")
+ with open(yml_file) as fr:
+ raw_data = yaml.load(fr, Loader=Loader)
+ test_cases = raw_data['test cases']
+ except (IOError, KeyError):
+ return []
+ else:
+ return test_cases
+
test_cases = []
+ if os.path.isdir(test_case_path):
+ for yml_file in find_by_suffix('.yml', test_case_path):
+ test_cases.extend(get_test_cases_from_yml(yml_file))
+ elif os.path.isfile(test_case_path):
+ test_cases.extend(get_test_cases_from_yml(test_case_path))
+ else:
+ print("Test case path is invalid. Should only happen when use @bot to skip unit test.")
+
# filter keys are lower case. Do map lower case keys with original keys.
try:
key_mapping = {x.lower(): x for x in test_cases[0].keys()}
|
landscape: channel.js, address requested changes | @@ -207,14 +207,12 @@ class Channel {
} else if (obj.response == "subscribe" ||
(obj.response == "poke" && !!subFuncs)) {
let funcs = subFuncs;
- // on a response to a subscribe, we only notify the caller on err
- //
+
if (obj.hasOwnProperty("err")) {
funcs["err"](obj.err);
this.outstandingSubscriptions.delete(obj.id);
} else if (obj.hasOwnProperty("ok")) {
funcs["subAck"](obj);
- this.outstandingSubscriptions.delete(obj.id);
}
} else if (obj.response == "diff") {
let funcs = subFuncs;
|
Fix checking the return value of getentropy()
GH: | @@ -249,7 +249,7 @@ int syscall_random(void *buf, size_t buflen)
*/
p_getentropy.p = DSO_global_lookup("getentropy");
if (p_getentropy.p != NULL)
- return p_getentropy.f(buf, buflen);
+ return p_getentropy.f(buf, buflen) == 0 ? buflen : 0;
/* Linux supports this since version 3.17 */
# if defined(__linux) && defined(SYS_getrandom)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.