Displaying 16 results from an estimated 16 matches for "pread_wrapp".
Did you mean:
pread_wrapper
2017 Jan 27
2
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...0;
> +}
Actually OCaml is a real compiled language, and the call from C to
OCaml code (via caml_callback_exn) is a short piece of asm which
preserves errno.
However you'll need to save errno around caml_enter_blocking_section
since that unblocks and processes signals.
IOW:
static int
pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset)
{
CAMLparam0 ();
CAMLlocal3 (rv, strv, offsetv);
+ int saved_errno;
...
rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv);
+ saved_errno = errno;
if (Is_exception_result (rv)) {
nbdkit_error ("%s&...
2019 Apr 23
0
[PATCH nbdkit v2 1/2] ocaml: Change pread method to avoid leaking heap memory.
...-
plugins/ocaml/NBDKit.mli | 2 +-
tests/test_ocaml_plugin.ml | 8 +++++---
4 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c
index d854f48..39704e2 100644
--- a/plugins/ocaml/ocaml.c
+++ b/plugins/ocaml/ocaml.c
@@ -439,15 +439,16 @@ pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset,
uint32_t flags)
{
CAMLparam0 ();
- CAMLlocal4 (rv, strv, offsetv, flagsv);
+ CAMLlocal4 (rv, countv, offsetv, flagsv);
+ mlsize_t len;
caml_leave_blocking_section ();
- strv = caml_alloc_string (count);
+ countv...
2020 Apr 10
3
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
Sorry Dan, but I really do dislike golang with a passion :-)
Here is a patch that allows you to write nbdkit plugins in golang. As
with C, OCaml and Rust, you can write a plugin in Go which compiles
directly to a .so file that can be loaded into golang, so in that
sense it works completely differently from scripting language plugins
like Perl and Python where there's an
2020 Apr 15
2
Re: [PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
...lugin.close = (*[0]byte)(C.close_wrapper)
for _, feature := range features {
switch feature {
case NBDKitFeatureGetSize:
plugin.get_size = (*[0]byte)(C.get_size_wrapper)
case NBDKitFeaturePread:
plugin.pread = (*[0]byte)(C.pread_wrapper)
}
}
}
....all the methods like C.pread_wrapper/C.get_size_wrapper
need to invoke pluginImpl methods....
// This type implements all methods in NBDKitPlugin, with
// no-op impls. This means that people implementing plugins
// don't need to implement e...
2009 Oct 15
3
1.2.6 Spurious pread()/stream errors/index corruption
Hi,
We're currently testing 1.2.x with a move from 1.1.x in mind however with
the current 1.2 series we are encountering some serious problems. simply
editing the main conf and restarting dovecot gives these errors seemingly
randomly:
(some previous posts indicated this might be todo with 64bit file offsets
so we've played around with disable-largefile and setting _FILE_OFFSET_BITS
2019 Apr 23
4
[PATCH nbdkit 0/2] Be careful not to leak heap memory to the client.
This bug was found by Eric Blake.
In the .pread method we allocate a buffer in the server and pass it to
the plugin. The plugin is supposed to fill it with data. The buffer
was uninitialized so initially contained random heap data, but that's
OK provided the plugin fully overwrote it with data. All correctly
written plugins ought to do this, however there is the possibility of
an
2017 Jan 27
0
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...#39;m guessing that
also means that OCaml comes with easy ways to directly set errno so that
it will be visible from C.
>
> However you'll need to save errno around caml_enter_blocking_section
> since that unblocks and processes signals.
>
> IOW:
>
> static int
> pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset)
> {
> CAMLparam0 ();
> CAMLlocal3 (rv, strv, offsetv);
> + int saved_errno;
> ...
> rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv);
> + saved_errno = errno;
> if (Is_exception_resu...
2019 Apr 23
0
[PATCH nbdkit 1/2] ocaml: Initialize pread buffer with zeroes to avoid leaking heap memory.
...the array with zeroes.
Credit: Eric Blake for finding the bug.
---
plugins/ocaml/ocaml.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c
index d854f48..7193842 100644
--- a/plugins/ocaml/ocaml.c
+++ b/plugins/ocaml/ocaml.c
@@ -444,6 +444,10 @@ pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset,
caml_leave_blocking_section ();
strv = caml_alloc_string (count);
+ /* Initialize the buffer with zeroes in case the plugin does not
+ * fill it completely.
+ */
+ memset (String_val (strv), 0, count);
offsetv = caml_copy_int6...
2020 Apr 10
0
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
...INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+extern void *open_wrapper (int readonly);
+extern void close_wrapper (void *handle);
+extern int64_t get_size_wrapper (void *handle);
+extern int pread_wrapper (void *handle, void *buf,
+ uint32_t count, uint64_t offset, uint32_t flags);
+extern int pwrite_wrapper (void *handle, const void *buf,
+ uint32_t count, uint64_t offset, uint32_t flags);
+// XXX ALL WRAPPERS
diff --git a/plugins/golang/config-t...
2019 Apr 23
4
[PATCH nbdkit v2 0/2] Be careful not to leak server heap memory to the client.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2019-April/msg00144.html
Version 2 makes a couple of much larger changes:
The OCaml patch changes the API of the pread method so it matches what
other language bindings are already doing, ie. get the language plugin
to return a newly allocated buffer, check it is long enough, copy out
the data.
The server patch implements a
2006 Sep 06
3
dovecot ignoring config file contents -- istream.c problem?
Hello!
This is my first time trying to run dovecot so maybe I've overlooked
something, but I'm having a hard time running dovecot.
First of all, it's worth noting that I'm trying to run dovecot on an
embedded platform: the target architecture is mipsel; I have patches
for the 2.4.18 kernel with special support for the board so I'm still
using the 2.4.18 kernel. My C library
2004 Oct 21
3
1.0-test51
http://dovecot.org/test/
This release is built with autoconf 2.59 and libtool 1.9. We'll see how
it works out :) The required changes were done by Matthias Andree.
- The last fix for connection hanging made IDLE use 100% CPU
- We don't use Maildir/.INBOX/ directory anymore, indexes are stored
in Maildir-root
- Don't crash with FETCH BODY[n.MIME]
- Changed %p (protocol)
2020 Apr 21
2
[PATCH nbdkit v2] Add the ability to write plugins in golang.
...THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+extern int config_wrapper (const char *key, const char *value);
+extern int config_complete_wrapper (void);
+extern void *open_wrapper (int readonly);
+extern void close_wrapper (void *handle);
+extern int64_t get_size_wrapper (void *handle);
+extern int pread_wrapper (void *handle, void *buf,
+ uint32_t count, uint64_t offset, uint32_t flags);
diff --git a/plugins/golang/config-test.go b/plugins/golang/config-test.go
new file mode 100644
index 00000000..0f5cfe6b
--- /dev/null
+++ b/plugins/golang/config-test.go
@@ -0,0 +1,38 @@
+/* Go...
2019 Jan 11
4
Solr -> Xapian ?
...625427 +0100
--- compat.h.joan 2019-01-11 20:14:41.729109919 +0100
*************** struct iovec;
*** 202,207 ****
--- 202,211 ----
ssize_t i_my_writev(int fd, const struct iovec *iov, int iov_len);
#endif
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
#if !defined(HAVE_PREAD) || defined(PREAD_WRAPPERS) ||
defined(PREAD_BROKEN)
# ifndef IN_COMPAT_C
# define pread i_my_pread
*************** ssize_t i_my_pread(int fd, void *buf, si
*** 211,216 ****
--- 215,225 ----
ssize_t i_my_pwrite(int fd, const void *buf, size_t count, off_t
offset);
#endif
+ #ifdef __cplusplus
+ }
+ #endif
+
+
#ifndef HA...
2019 Jan 11
2
Solr -> Xapian ?
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
I would recommend making this a standalone plugin for now instead of trying to keep it in core fts.
</div>
<div>
<br>
</div>
<div>
Aki
</div>
<blockquote type="cite">
<div>
On 11
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
This cleans up the existing code base with regards to implicit
use of errno from language bindings, then rebases the previous
work in python on top of that.
I'm still playing with the perl bindings, but got further after
reading 'perldoc perlembed'.
Eric Blake (4):
plugins: Don't use bogus errno from non-C plugins
plugins: Add new nbdkit_set_error() utility function
python: