Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-06 Thread Charlie Reinl
Am Mittwoch, den 06.11.2013, 10:28 +1030 schrieb Bruce: > Dear experts, > > Can anyone see what I'm doing wrong here. Source archive is attached, > but here is the entire code: > > -- > ' Gambas module file > > ' void uuid_gene

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Benoît Minisini
Le 06/11/2013 03:01, Bruce a écrit : > p.s. Just saw Benoît's wiki update notice. Did that page exist before? > I spent an hour this morning looking for something like that. > No, I just wrote it. I will complete it as new questions will have to be answered. -- Benoît Minisini ---

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Bruce
> On Wed, Nov 6, 2013 at 2:56 AM, Benoît Minisini < > gam...@users.sourceforge.net> wrote: > > > Now your code: > > > > -- > 8*< > > > OP must points at a 16 bytes allocation. So you failed! The > > library will erase the memo

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Jussi Lahtinen
Correct code: ' void uuid_generate(uuid_t out); Extern UUID_Gen(op As Pointer) In "libuuid:1" Exec "uuid_generate" ' void uuid_unparse(uuid_t uu, char *out) Extern UUID_ToStr(ip As Pointer, op As Pointer) In "libuuid:1" Exec "uuid_unparse" Public Sub Main() Dim OP As Pointer = Alloc(SizeOf(g

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Benoît Minisini
Le 06/11/2013 01:07, Benoît Minisini a écrit : > > What is the exact definition of 'uuid_t' ? > > Also, you can use valgrind to know when exactly the faulty memory > access occurs. This will give better clues. > typedef unsigned char uuid_t[16]; You get it in the '/usr/include/uuid.h', that you m

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Jussi Lahtinen
Not sure what is going on... too tired to focus properly. I'll look it later more closely. Instead of "= Alloc(IIf(sArch = "x86", 4, 8))", just write "SizeOf(gb.Pointer)". These functions doesn't return anything, so: Extern UUID_Gen(op As Pointer) As Pointer In "libuuid:1" Exec "uuid_generate"

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Bruce
On Wed, 2013-11-06 at 01:07 +0100, Benoît Minisini wrote: > What is the exact definition of 'uuid_t' ? > From http://linux.die.net/man/3/uuid_unparse The uuid_unparse function converts the supplied UUID uu from the binary representation into a 36-byte string (plus tailing '\0') of the form 1b4e

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Benoît Minisini
Le 06/11/2013 00:58, Bruce a écrit : > Dear experts, > > Can anyone see what I'm doing wrong here. Source archive is attached, > but here is the entire code: > > -- > ' Gambas module file > > ' void uuid_generate(uuid_t out); > Ex

[Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Bruce
Dear experts, Can anyone see what I'm doing wrong here. Source archive is attached, but here is the entire code: -- ' Gambas module file ' void uuid_generate(uuid_t out); Extern UUID_Gen(op As Pointer) As Pointer In "libuuid:1"