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

Bruce bbruen at ...2308...
Wed Nov 6 01:30:25 CET 2013


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
1b4e28ba-2fa1-11d2-883f-0016d3cca427 and stores this value in the
character string pointed to by out. The case of the hex digits returned
by uuid_unparse may be upper or lower case, and is dependent on the
system-dependent local default. 

i.e. it is the 16byte UUID returned by uuid_generate 

>From http://linux.die.net/man/3/uuid_generate 

The UUID is 16 bytes (128 bits) long, which gives approximately
3.4x10^38 unique values (there are approximately 10^80 elementary
particles in the universe according to Carl Sagan's Cosmos).

> Also, you can use valgrind to know when exactly the faulty memory access 
> occurs. This will give better clues.

Could, if I knew how to... :-)

The thing is, the extern calls work, it is only when the module exits
that the Segfault occurs. So it even looks (to me) like the Free()s
work.  I have tried using the routine as a function and it works, the
problem only happens when the Main() method exits. 

rgds
Bruce






More information about the User mailing list