Sorry I have been so long following this up. The example driver in SVN works for me, if you are still having issues can you try that and see if you have the same issue.

Toby

2008/4/29 AnÝbal <hannibalevivo@gmail.com>:
I put it in the first message, this is the gdb output:


$ gdb ./client
...
(gdb) run
Starting program: /home/robotica/player/testing_player/example_driver/client
[Thread debugging using libthread_db enabled]
[New Thread -1223178512 (LWP 13654)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1223178512 (LWP 13654)]
0xb7d3434c in memcpy () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7d3434c in memcpy () from /lib/tls/i686/cmov/libc.so.6
#1  0xb7fbff0a in PlayerCc::OpaqueProxy::SendReq (this=0xbfefecb0, aRequest=0xbfefecd4) at opaqueproxy.cc:97
#2  0x08048cb8 in main ()

line number 97 of opaqueproxy.cc file is:
memcpy(mDevice->data, aReply->data, aReply->data_count);

Thanks in advance

2008/4/29 Toby Collett <tcollett+player@plan9.net.nz>:

try running your client in gdb and posting a backtrace



On 29/04/2008, AnÝbal <hannibalevivo@gmail.com> wrote:
I send all the structure (always 132bytes), not a string:

   opaque_data.data = (uint8_t*) &test_data;
   opaque_data.data_count = sizeof(test_data); // 132bytes

The driver receives the request correctly but the client fails when I call SendReq(&opaque_data).
the process in both cases (client and driver) is the same



2008/4/28 Toby Collett <tcollett+player@plan9.net.nz>:

if you are sending strings over opaque, you need to send strlen+1 for the null terminator

2008/4/28 AnÝbal <hannibalevivo@gmail.com>:
Hi!
I've written an opaque plugin driver and a small client (player version: 2.1.0rc2).

The shared structure is defined as follows:
struct test_data_t {
   uint16_t id;
   uint8_t buffer[128];
   uint16_t buffer_length;
};

The client sends a request to Player.
The driver prints correctly the information received from the client. Then, the driver sends the reply but the client fails:
segmentation fault (core dumped)

I've used the gdb with the client program, this is the output:

$ gdb ./client
...
(gdb) run
Starting program: /home/robotica/player/testing_player/example_driver/client
[Thread debugging using libthread_db enabled]
[New Thread -1223178512 (LWP 13654)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1223178512 (LWP 13654)]
0xb7d3434c in memcpy () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7d3434c in memcpy () from /lib/tls/i686/cmov/libc.so.6
#1  0xb7fbff0a in PlayerCc::OpaqueProxy::SendReq (this=0xbfefecb0, aRequest=0xbfefecd4) at opaqueproxy.cc:97
#2  0x08048cb8 in main ()

line number 97 of opaqueproxy.cc file is:
memcpy(mDevice->data, aReply->data, aReply->data_count);

And finally the client code:

int main(int argc, char* argv[]) {

   test_data_t test_data; // user-defined shared structure
   player_opaque_data_t opaque_data; // opaque data

   PlayerClient client("localhost");
   OpaqueProxy proxy(&client,0);

   opaque_data.data = (uint8_t*) &test_data;
   opaque_data.data_count = sizeof(test_data);

   for(unsigned int i=0; i<10; i++) {
      test_data.id = i;
      sprintf((char*)test_data.buffer, "good morning!");
      test_data.buffer_length = strlen("good morning!");

      proxy.SendReq(&opaque_data); // <----- here the client fails
   }
}

I don't know if i'm doing something wrong or not.
Thanks in advance






-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users




--
This email is intended for the addressee only and may contain privileged and/or confidential information
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users




--
This email is intended for the addressee only and may contain privileged and/or confidential information

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users




--
This email is intended for the addressee only and may contain privileged and/or confidential information