Hello,
Calling Rpc_<method>(args, ...) from Session_client causes segfault 11 when I try to pass anything other than a default datatype. I'm trying to pass an object of std::string, and it prints the string inside the <method> just fine, but when I make the call<Rpc_method>(st), it breaks.
I tried working around this by creating a char* pointer instead. Print inside this method works and the rpc to session_component method also reaches, but whatever pointer I receive in the session_component is garbage data. How do I fix the RPC calls?
Thanks, Aditya.
Hi Aditya,
passing non-POD objects such as connected lists, maps, etc. as RPC arguments is not supposed to work. The reason is that a pointer with a meaning in one address space is meaningless in another address space. Please refer to the Section 8.12 of the manual [1] and particularly Section 8.12.2 for more details about the RPC mechanism.
To transfer bulk data from one component to another, you may need to manually serialize your information to a shared memory buffer, to be picked up on the receiving side. See section 3.6 for the various approaches of inter-component communication.
[1] http://genode.org/files/53bcb8e33fe6602fed25edc3c7b922c5/manual-2015-04-27.p...
Cheers Norman
On 05/11/2015 10:49 PM, Aditya Kousik wrote:
Hello,
Calling Rpc_<method>(args, ...) from Session_client causes segfault 11 when I try to pass anything other than a default datatype. I'm trying to pass an object of std::string, and it prints the string inside the <method> just fine, but when I make the call<Rpc_method>(st), it breaks.
I tried working around this by creating a char* pointer instead. Print inside this method works and the rpc to session_component method also reaches, but whatever pointer I receive in the session_component is garbage data. How do I fix the RPC calls?
Thanks, Aditya.
Hello Norman,
This documentation is quite exquisite, I'm just laying my eyes on it. Are there any implementation examples to support the sequence diagrams? They'll help map the theory to the implementation.
Cheers, Aditya
On Mon, May 11, 2015 at 2:02 PM, Norman Feske <norman.feske@...1...> wrote:
Hi Aditya,
passing non-POD objects such as connected lists, maps, etc. as RPC arguments is not supposed to work. The reason is that a pointer with a meaning in one address space is meaningless in another address space. Please refer to the Section 8.12 of the manual [1] and particularly Section 8.12.2 for more details about the RPC mechanism.
To transfer bulk data from one component to another, you may need to manually serialize your information to a shared memory buffer, to be picked up on the receiving side. See section 3.6 for the various approaches of inter-component communication.
[1]
http://genode.org/files/53bcb8e33fe6602fed25edc3c7b922c5/manual-2015-04-27.p...
Cheers Norman
On 05/11/2015 10:49 PM, Aditya Kousik wrote:
Hello,
Calling Rpc_<method>(args, ...) from Session_client causes segfault 11 when I try to pass anything other than a default datatype. I'm trying to pass an object of std::string, and it prints the string inside the <method> just fine, but when I make the call<Rpc_method>(st), it breaks.
I tried working around this by creating a char* pointer instead. Print inside this method works and the rpc to session_component method also reaches, but whatever pointer I receive in the session_component is garbage data. How do I fix the RPC calls?
Thanks, Aditya.
-- Dr.-Ing. Norman Feske Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hello Dr. Norman,
I stumbled upon some useful examples in test/ds_ownership and general search showed me how to pull off shared memory. It's an interesting implementation.
What I did: Server: Ram_dataspace_capability ds = env()->ram_session()->alloc(SIZE); void* arg = env()->rm_session()->attach(ds);
I returned this ds through a getDataspace() RPC method on the server side to the invoking client. I'm able to effectively write bulk data between components. Thank you for directing me toward this.
I have a couple of spinoff questions though. 1. Initially I tried creating a Ram_connection ram1 and allocated as in the ds_ownership program
ram1.ref_account(env()->ram_session->cap()); env()->ram_session()->transfer_quota(ram1.cap(), 8*1024);
Then Ram_dataspace_capability ds = ram1.alloc(SIZE); and attached ds to RM session and sent back ds. But the client threw a C++ IPC error and called abort().
A) Is this because ram1 was local to the server?
B) Is the transfer quota mechanism is similar to the transfer_quota from the client during the creation of a session in the constructor?
2. I'm still trying to get my head around the concept of a capability. I tried going through the definition of a capability in base/capability.h, but I seemed to get nowhere. What can a user do with a capability - mechanisms such as attach and detach with the help of a capability etc.
I'm sure you've had similar questions asked before. Thank you taking the time to respond.
Regards, Aditya
On Mon, May 11, 2015 at 2:32 PM, Aditya Kousik <adit267.kousik@...9...> wrote:
Hello Norman,
This documentation is quite exquisite, I'm just laying my eyes on it. Are there any implementation examples to support the sequence diagrams? They'll help map the theory to the implementation.
Cheers, Aditya
On Mon, May 11, 2015 at 2:02 PM, Norman Feske < norman.feske@...1...> wrote:
Hi Aditya,
passing non-POD objects such as connected lists, maps, etc. as RPC arguments is not supposed to work. The reason is that a pointer with a meaning in one address space is meaningless in another address space. Please refer to the Section 8.12 of the manual [1] and particularly Section 8.12.2 for more details about the RPC mechanism.
To transfer bulk data from one component to another, you may need to manually serialize your information to a shared memory buffer, to be picked up on the receiving side. See section 3.6 for the various approaches of inter-component communication.
[1]
http://genode.org/files/53bcb8e33fe6602fed25edc3c7b922c5/manual-2015-04-27.p...
Cheers Norman
On 05/11/2015 10:49 PM, Aditya Kousik wrote:
Hello,
Calling Rpc_<method>(args, ...) from Session_client causes segfault 11 when I try to pass anything other than a default datatype. I'm trying to pass an object of std::string, and it prints the string inside the <method> just fine, but when I make the call<Rpc_method>(st), it breaks.
I tried working around this by creating a char* pointer instead. Print inside this method works and the rpc to session_component method also reaches, but whatever pointer I receive in the session_component is garbage data. How do I fix the RPC calls?
Thanks, Aditya.
-- Dr.-Ing. Norman Feske Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hi Aditya,
the manual refers to various communication techniques in the description of the individual session interfaces in Section 4.5. In my opinion, those session interfaces are best examples.
What I did: Server: Ram_dataspace_capability ds = env()->ram_session()->alloc(SIZE); void* arg = env()->rm_session()->attach(ds);
BTW, there is a convenience helper for performing this sequence (and the reverse) at os/include/os/attached_ram_dataspace.h.
I returned this ds through a getDataspace() RPC method on the server side to the invoking client. I'm able to effectively write bulk data between components. Thank you for directing me toward this.
I have a couple of spinoff questions though.
- Initially I tried creating a Ram_connection ram1 and allocated as in
the ds_ownership program
ram1.ref_account(env()->ram_session->cap()); env()->ram_session()->transfer_quota(ram1.cap(), 8*1024);
Then Ram_dataspace_capability ds = ram1.alloc(SIZE); and attached ds to RM session and sent back ds. But the client threw a C++ IPC error and called abort().
The general steps look good to me. If you shared you experiment as a branch at GitHub I could have a look, where the problem lies.
A) Is this because ram1 was local to the server?
No.
B) Is the transfer quota mechanism is similar to the transfer_quota from the client during the creation of a session in the constructor?
It is related but actually not very similar. Please have a look at Section 3.3 for a description. In short, the session quota is meant to be consumed by the respective server. The RAM server is like a bank where each RAM session corresponds to a bank account. The quota transferred to a RAM session is the balance on the account.
- I'm still trying to get my head around the concept of a capability. I
tried going through the definition of a capability in base/capability.h, but I seemed to get nowhere. What can a user do with a capability - mechanisms such as attach and detach with the help of a capability etc.
May I refer you to Chapter 3 of the manual?
I'm sure you've had similar questions asked before. Thank you taking the time to respond.
You are welcome.
Cheers Norman