------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Swig-user mailing list
Swig...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Hi Rodriguez,
What are the type of the function arguments? Could it be because the function
expects a argument that points to allocated memory, but the argument you pass
points to not allocated memory, or a vector that is not long enough, or
something like that?
I've tried to configure and use valgrind and gdb to debug segfault in Python
extension, but currently I still find that the best method is to reduce the bugged
code to the smallest pieces of code and investigate it. I would be interessed to
know if people use gdb or valgrind to debug segfault in Python extension.
Best,
David
On Tue, 20 Mar 2012, David Froger wrote:
>>
>
>
> Hi Rodriguez,
>
> What are the type of the function arguments? Could it be because the function
> expects a argument that points to allocated memory, but the argument you pass
> points to not allocated memory, or a vector that is not long enough, or
> something like that?
Hi Roger,
The C code works properly.
The problem lives in the module swig generates.
Maybe i have to take some cautions for the code that i would to use with
swig?
Thamks.
M
Could you post the C function prototype you're wrapping and your Swig file? What
is the target language?
typedef struct
{
int speech_mode;
int speech_buflength; //not used
char* speech_datapath; //not used
int speech_options; //not used
int speech_synthrate;
int speech_synthvolume;
int speech_synthpitch;
int speech_synthrange;
int speech_synthpunctuation;
int speech_synthcapitals;
int speech_synthwordgap;
int speech_synthrelative;
bool speech_synthparamsinitialized;
bool speech_libinitialized;
speech_lang_t speech_lang;
char speech_outfilename[210]; //name of the mp3 file.;
char speech_author[200];
char speech_title[200];
} speech_options_t;
speech_options_t* speech_init(void);
bool speech_setlibespeak(speech_options_t* options, int mode);
//set the language of audio output.
bool speech_setlang(speech_options_t* options, speech_lang_t lang);
bool speech_setsynthrate(speech_options_t* options, int value);
bool speech_setsynthvolume(speech_options_t* options, int value);
bool speech_setsynthpitch(speech_options_t* options, int value);
bool speech_setsynthrange(speech_options_t* options, int value);
bool speech_setsynthpunctuation(speech_options_t* options, int value);
bool speech_setsynthcapitals(speech_options_t* options, int value);
bool speech_setsynthwordgap(speech_options_t* options, int value);
bool speech_setsynthcallback(int mode);
//end of swig interface
Here is the prototype of function that causes segfault:
int lame_init_params(GFP* gf);
The function allocates authomatically the memory for gfp*.
Regards.
M