amlabel segmentation fault

2014-01-04 Thread Kervin L. Pierre
Hi,

This Segfault seems to occur occasionally and for different reasons.  It's 
possible that amlabel do not handle unknown devices gracefully.  But I'm still 
looking.  My tapedevice is "S3".

But I just built 3.3.5 on a Ubuntu desktop and now I get a segfault whenever I 
run amlabel...

$ perl -d /usr/local/sbin/amlabel --version

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

Signal SEGV at /usr/local/share/perl/5.14.2/Amanda/Device.pm line 12
require Amanda/Device.pm called at /usr/local/sbin/amlabel line 29
main::BEGIN() called at /usr/local/share/perl/5.14.2/Amanda/Device.pm 
line 0
eval {...} called at /usr/local/share/perl/5.14.2/Amanda/Device.pm line 0

Device.pm looks like
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

package Amanda::Device;
use base qw(Exporter);
use base qw(DynaLoader);
require Amanda::Header;
package Amanda::Devicec;
bootstrap Amanda::Device;
package Amanda::Device;
@EXPORT = qw();

With the "bootstrap Amanda" line being line 12.

Should that line read "package Amanda::Devicec;"?

Any idea what the issue could be?

Best regards,
Kervin

Web Services Design, Development and Maintenance
http://adevsoft.com/




Re: amlabel segmentation fault

2014-01-05 Thread Jean-Louis Martineau

Kevin,

run amlabel under gdb:

$  gdb perl
(gdb) run /usr/local/sbin/amlabel --version
(gdb) bt
(gdb) list

Jean-Louis

On 01/04/2014 11:01 PM, Kervin L. Pierre wrote:

Hi,

This Segfault seems to occur occasionally and for different reasons.  It's possible that 
amlabel do not handle unknown devices gracefully.  But I'm still looking.  My tapedevice 
is "S3".

But I just built 3.3.5 on a Ubuntu desktop and now I get a segfault whenever I 
run amlabel...

$ perl -d /usr/local/sbin/amlabel --version

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

Signal SEGV at /usr/local/share/perl/5.14.2/Amanda/Device.pm line 12
require Amanda/Device.pm called at /usr/local/sbin/amlabel line 29
main::BEGIN() called at /usr/local/share/perl/5.14.2/Amanda/Device.pm 
line 0
eval {...} called at /usr/local/share/perl/5.14.2/Amanda/Device.pm line 0

Device.pm looks like
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

package Amanda::Device;
use base qw(Exporter);
use base qw(DynaLoader);
require Amanda::Header;
package Amanda::Devicec;
bootstrap Amanda::Device;
package Amanda::Device;
@EXPORT = qw();

With the "bootstrap Amanda" line being line 12.

Should that line read "package Amanda::Devicec;"?

Any idea what the issue could be?

Best regards,
Kervin

Web Services Design, Development and Maintenance
http://adevsoft.com/






RE: amlabel segmentation fault

2014-01-05 Thread Kervin L. Pierre
Hi Jean-Louis,

Thanks for the response.  Is there a way to rebuild with '-g' for debugging 
support and to avoid stripping symbols? Would that help?

Here is the gdb output...

$ gdb --args perl /usr/local/sbin/amlabel --version
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/perl...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/perl /usr/local/sbin/amlabel --version
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x7489876d in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
(gdb) backtrace 
#0  0x7489876d in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
#1  0x748925ae in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
#2  0x7489004c in gcry_control () from 
/lib/x86_64-linux-gnu/libgcrypt.so.11
#3  0x70c75259 in device_api_init () at device.c:64
#4  0x70ebc1f2 in boot_Amanda__Device (my_perl=, 
cv=) at Amanda/Device.c:4676
#5  0x77b10591 in Perl_pp_entersub () from /usr/lib/libperl.so.5.14
#6  0x77b07d36 in Perl_runops_standard () from /usr/lib/libperl.so.5.14
#7  0x77aa43c0 in Perl_call_sv () from /usr/lib/libperl.so.5.14
#8  0x77aa51cc in Perl_call_list () from /usr/lib/libperl.so.5.14
#9  0x77a8faf1 in ?? () from /usr/lib/libperl.so.5.14
#10 0x77a9b7b3 in Perl_newATTRSUB () from /usr/lib/libperl.so.5.14
#11 0x77a9bfa2 in Perl_utilize () from /usr/lib/libperl.so.5.14
#12 0x77ac989e in Perl_yyparse () from /usr/lib/libperl.so.5.14
#13 0x77aa9b76 in perl_parse () from /usr/lib/libperl.so.5.14
#14 0x00400dae in main ()
(gdb) list
1   : No such file or directory.

Best regards,
Kervin


Web Services Design, Development and Maintenance
http://adevsoft.com/


-Original Message-
From: Jean-Louis Martineau [mailto:martin...@zmanda.com] 
Sent: Sunday, January 5, 2014 9:19 AM
To: Kervin L. Pierre
Cc: amanda-users@amanda.org
Subject: Re: amlabel segmentation fault

Kevin,

run amlabel under gdb:

$  gdb perl
(gdb) run /usr/local/sbin/amlabel --version
(gdb) bt
(gdb) list

Jean-Louis

On 01/04/2014 11:01 PM, Kervin L. Pierre wrote:
> Hi,
>
> This Segfault seems to occur occasionally and for different reasons.  It's 
> possible that amlabel do not handle unknown devices gracefully.  But I'm 
> still looking.  My tapedevice is "S3".
>
> But I just built 3.3.5 on a Ubuntu desktop and now I get a segfault whenever 
> I run amlabel...
>
> $ perl -d /usr/local/sbin/amlabel --version
>
> Loading DB routines from perl5db.pl version 1.33 Editor support 
> available.
>
> Enter h or `h h' for help, or `man perldebug' for more help.
>
> Signal SEGV at /usr/local/share/perl/5.14.2/Amanda/Device.pm line 12
>   require Amanda/Device.pm called at /usr/local/sbin/amlabel line 29
>   main::BEGIN() called at /usr/local/share/perl/5.14.2/Amanda/Device.pm 
> line 0
>   eval {...} called at /usr/local/share/perl/5.14.2/Amanda/Device.pm 
> line 0
>
> Device.pm looks like
> # This file was automatically generated by SWIG (http://www.swig.org).
> # Version 2.0.4
> #
> # Do not make changes to this file unless you know what you are 
> doing--modify # the SWIG interface file instead.
>
> package Amanda::Device;
> use base qw(Exporter);
> use base qw(DynaLoader);
> require Amanda::Header;
> package Amanda::Devicec;
> bootstrap Amanda::Device;
> package Amanda::Device;
> @EXPORT = qw();
>
> With the "bootstrap Amanda" line being line 12.
>
> Should that line read "package Amanda::Devicec;"?
>
> Any idea what the issue could be?
>
> Best regards,
> Kervin
>
> Web Services Design, Development and Maintenance http://adevsoft.com/
>
>




Re: amlabel segmentation fault

2014-01-06 Thread Jean-Louis Martineau

Kervin,

Looks like there is a bug if libcurl use GNUTLS.

Can you try the attached patch?

Jean-Louis

On 01/05/2014 12:10 PM, Kervin L. Pierre wrote:

Hi Jean-Louis,

Thanks for the response.  Is there a way to rebuild with '-g' for debugging 
support and to avoid stripping symbols? Would that help?

Here is the gdb output...

$ gdb --args perl /usr/local/sbin/amlabel --version
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/perl...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/perl /usr/local/sbin/amlabel --version
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x7489876d in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
(gdb) backtrace
#0  0x7489876d in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
#1  0x748925ae in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
#2  0x7489004c in gcry_control () from 
/lib/x86_64-linux-gnu/libgcrypt.so.11
#3  0x70c75259 in device_api_init () at device.c:64
#4  0x70ebc1f2 in boot_Amanda__Device (my_perl=, 
cv=) at Amanda/Device.c:4676
#5  0x77b10591 in Perl_pp_entersub () from /usr/lib/libperl.so.5.14
#6  0x77b07d36 in Perl_runops_standard () from /usr/lib/libperl.so.5.14
#7  0x77aa43c0 in Perl_call_sv () from /usr/lib/libperl.so.5.14
#8  0x77aa51cc in Perl_call_list () from /usr/lib/libperl.so.5.14
#9  0x77a8faf1 in ?? () from /usr/lib/libperl.so.5.14
#10 0x77a9b7b3 in Perl_newATTRSUB () from /usr/lib/libperl.so.5.14
#11 0x77a9bfa2 in Perl_utilize () from /usr/lib/libperl.so.5.14
#12 0x77ac989e in Perl_yyparse () from /usr/lib/libperl.so.5.14
#13 0x77aa9b76 in perl_parse () from /usr/lib/libperl.so.5.14
#14 0x00400dae in main ()
(gdb) list
1   : No such file or directory.

Best regards,
Kervin


Web Services Design, Development and Maintenance
http://adevsoft.com/


-Original Message-
From: Jean-Louis Martineau [mailto:martin...@zmanda.com]
Sent: Sunday, January 5, 2014 9:19 AM
To: Kervin L. Pierre
Cc: amanda-users@amanda.org
Subject: Re: amlabel segmentation fault

Kevin,

run amlabel under gdb:

$  gdb perl
(gdb) run /usr/local/sbin/amlabel --version
(gdb) bt
(gdb) list

Jean-Louis

On 01/04/2014 11:01 PM, Kervin L. Pierre wrote:

Hi,

This Segfault seems to occur occasionally and for different reasons.  It's possible that 
amlabel do not handle unknown devices gracefully.  But I'm still looking.  My tapedevice 
is "S3".

But I just built 3.3.5 on a Ubuntu desktop and now I get a segfault whenever I 
run amlabel...

$ perl -d /usr/local/sbin/amlabel --version

Loading DB routines from perl5db.pl version 1.33 Editor support
available.

Enter h or `h h' for help, or `man perldebug' for more help.

Signal SEGV at /usr/local/share/perl/5.14.2/Amanda/Device.pm line 12
require Amanda/Device.pm called at /usr/local/sbin/amlabel line 29
main::BEGIN() called at /usr/local/share/perl/5.14.2/Amanda/Device.pm 
line 0
eval {...} called at /usr/local/share/perl/5.14.2/Amanda/Device.pm
line 0

Device.pm looks like
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are
doing--modify # the SWIG interface file instead.

package Amanda::Device;
use base qw(Exporter);
use base qw(DynaLoader);
require Amanda::Header;
package Amanda::Devicec;
bootstrap Amanda::Device;
package Amanda::Device;
@EXPORT = qw();

With the "bootstrap Amanda" line being line 12.

Should that line read "package Amanda::Devicec;"?

Any idea what the issue could be?

Best regards,
Kervin

Web Services Design, Development and Maintenance http://adevsoft.com/




diff --git a/common-src/glib-util.c b/common-src/glib-util.c
index 713f0fc..905d518 100644
--- a/common-src/glib-util.c
+++ b/common-src/glib-util.c
@@ -27,6 +27,7 @@
 
 #include "amanda.h"
 #include "glib-util.h"
+#include "pthread.h"
 #include "conffile.h" /* For find_multiplier. */
 
 #ifdef HAVE_LIBCURL
@@ -71,7 +72,13 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 static void
 init_ssl(void)
 {
-gcry_control(GCRYCTL_SET_THREAD_CBS);
+gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+
+if (!gcry_check_version (GCRYPT_VERSION)) {
+	g_critical("libgcrypt version mismatch");
+}
+
+gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 }
 
 #else	/* LIBCURL_USE_GNUTLS  */


Re: amlabel segmentation fault

2014-01-10 Thread Jean-Louis Martineau

Kervin,

Did you try the patch?

Jean-Louis

On 01/06/2014 09:13 AM, Jean-Louis Martineau wrote:

Kervin,

Looks like there is a bug if libcurl use GNUTLS.

Can you try the attached patch?

Jean-Louis

On 01/05/2014 12:10 PM, Kervin L. Pierre wrote:

Hi Jean-Louis,

Thanks for the response.  Is there a way to rebuild with '-g' for 
debugging support and to avoid stripping symbols? Would that help?


Here is the gdb output...

$ gdb --args perl /usr/local/sbin/amlabel --version
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show 
copying"

and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/perl...(no debugging symbols 
found)...done.

(gdb) run
Starting program: /usr/bin/perl /usr/local/sbin/amlabel --version
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".


Program received signal SIGSEGV, Segmentation fault.
0x7489876d in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
(gdb) backtrace
#0  0x7489876d in ?? () from 
/lib/x86_64-linux-gnu/libgcrypt.so.11
#1  0x748925ae in ?? () from 
/lib/x86_64-linux-gnu/libgcrypt.so.11
#2  0x7489004c in gcry_control () from 
/lib/x86_64-linux-gnu/libgcrypt.so.11

#3  0x70c75259 in device_api_init () at device.c:64
#4  0x70ebc1f2 in boot_Amanda__Device (my_perl=out>, cv=) at Amanda/Device.c:4676
#5  0x77b10591 in Perl_pp_entersub () from 
/usr/lib/libperl.so.5.14
#6  0x77b07d36 in Perl_runops_standard () from 
/usr/lib/libperl.so.5.14

#7  0x77aa43c0 in Perl_call_sv () from /usr/lib/libperl.so.5.14
#8  0x77aa51cc in Perl_call_list () from 
/usr/lib/libperl.so.5.14

#9  0x77a8faf1 in ?? () from /usr/lib/libperl.so.5.14
#10 0x77a9b7b3 in Perl_newATTRSUB () from 
/usr/lib/libperl.so.5.14

#11 0x77a9bfa2 in Perl_utilize () from /usr/lib/libperl.so.5.14
#12 0x77ac989e in Perl_yyparse () from /usr/lib/libperl.so.5.14
#13 0x77aa9b76 in perl_parse () from /usr/lib/libperl.so.5.14
#14 0x00400dae in main ()
(gdb) list
1: No such file or directory.

Best regards,
Kervin


Web Services Design, Development and Maintenance
http://adevsoft.com/


-Original Message-
From: Jean-Louis Martineau [mailto:martin...@zmanda.com]
Sent: Sunday, January 5, 2014 9:19 AM
To: Kervin L. Pierre
Cc: amanda-users@amanda.org
Subject: Re: amlabel segmentation fault

Kevin,

run amlabel under gdb:

$  gdb perl
(gdb) run /usr/local/sbin/amlabel --version
(gdb) bt
(gdb) list

Jean-Louis

On 01/04/2014 11:01 PM, Kervin L. Pierre wrote:

Hi,

This Segfault seems to occur occasionally and for different 
reasons.  It's possible that amlabel do not handle unknown devices 
gracefully.  But I'm still looking.  My tapedevice is "S3".


But I just built 3.3.5 on a Ubuntu desktop and now I get a segfault 
whenever I run amlabel...


$ perl -d /usr/local/sbin/amlabel --version

Loading DB routines from perl5db.pl version 1.33 Editor support
available.

Enter h or `h h' for help, or `man perldebug' for more help.

Signal SEGV at /usr/local/share/perl/5.14.2/Amanda/Device.pm line 12
require Amanda/Device.pm called at /usr/local/sbin/amlabel line 29
main::BEGIN() called at 
/usr/local/share/perl/5.14.2/Amanda/Device.pm line 0

eval {...} called at /usr/local/share/perl/5.14.2/Amanda/Device.pm
line 0

Device.pm looks like
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are
doing--modify # the SWIG interface file instead.

package Amanda::Device;
use base qw(Exporter);
use base qw(DynaLoader);
require Amanda::Header;
package Amanda::Devicec;
bootstrap Amanda::Device;
package Amanda::Device;
@EXPORT = qw();

With the "bootstrap Amanda" line being line 12.

Should that line read "package Amanda::Devicec;"?

Any idea what the issue could be?

Best regards,
Kervin

Web Services Design, Development and Maintenance http://adevsoft.com/








RE: amlabel segmentation fault

2014-01-10 Thread Kervin L. Pierre
Hi Jean-Louis,

Sorry for the delay.  I had to remove a binary install and get the source build 
back up again.

But it all works now with your patch.  Thanks!

Best regards,
Kervin



Web Services Design, Development and Maintenance
http://adevsoft.com/


-Original Message-
From: Jean-Louis Martineau [mailto:martin...@zmanda.com] 
Sent: Friday, January 10, 2014 8:35 AM
To: Kervin L. Pierre
Cc: amanda-users@amanda.org
Subject: Re: amlabel segmentation fault

Kervin,

Did you try the patch?

Jean-Louis

On 01/06/2014 09:13 AM, Jean-Louis Martineau wrote:
> Kervin,
>
> Looks like there is a bug if libcurl use GNUTLS.
>
> Can you try the attached patch?
>
> Jean-Louis
>
> On 01/05/2014 12:10 PM, Kervin L. Pierre wrote:
>> Hi Jean-Louis,
>>
>> Thanks for the response.  Is there a way to rebuild with '-g' for 
>> debugging support and to avoid stripping symbols? Would that help?
>>
>> Here is the gdb output...
>>
>> $ gdb --args perl /usr/local/sbin/amlabel --version GNU gdb (GDB) 
>> 7.6.1-ubuntu Copyright (C) 2013 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later 
>> <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.  Type "show 
>> copying"
>> and "show warranty" for details.
>> This GDB was configured as "x86_64-linux-gnu".
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/gdb/bugs/>...
>> Reading symbols from /usr/bin/perl...(no debugging symbols 
>> found)...done.
>> (gdb) run
>> Starting program: /usr/bin/perl /usr/local/sbin/amlabel --version 
>> [Thread debugging using libthread_db enabled] Using host libthread_db 
>> library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x7489876d in ?? () from 
>> /lib/x86_64-linux-gnu/libgcrypt.so.11
>> (gdb) backtrace
>> #0  0x7489876d in ?? () from
>> /lib/x86_64-linux-gnu/libgcrypt.so.11
>> #1  0x748925ae in ?? () from
>> /lib/x86_64-linux-gnu/libgcrypt.so.11
>> #2  0x7489004c in gcry_control () from
>> /lib/x86_64-linux-gnu/libgcrypt.so.11
>> #3  0x70c75259 in device_api_init () at device.c:64
>> #4  0x70ebc1f2 in boot_Amanda__Device (my_perl=> out>, cv=) at Amanda/Device.c:4676
>> #5  0x77b10591 in Perl_pp_entersub () from
>> /usr/lib/libperl.so.5.14
>> #6  0x77b07d36 in Perl_runops_standard () from
>> /usr/lib/libperl.so.5.14
>> #7  0x77aa43c0 in Perl_call_sv () from 
>> /usr/lib/libperl.so.5.14
>> #8  0x77aa51cc in Perl_call_list () from
>> /usr/lib/libperl.so.5.14
>> #9  0x77a8faf1 in ?? () from /usr/lib/libperl.so.5.14
>> #10 0x77a9b7b3 in Perl_newATTRSUB () from
>> /usr/lib/libperl.so.5.14
>> #11 0x77a9bfa2 in Perl_utilize () from 
>> /usr/lib/libperl.so.5.14
>> #12 0x77ac989e in Perl_yyparse () from 
>> /usr/lib/libperl.so.5.14
>> #13 0x77aa9b76 in perl_parse () from /usr/lib/libperl.so.5.14
>> #14 0x000000400dae in main ()
>> (gdb) list
>> 1: No such file or directory.
>>
>> Best regards,
>> Kervin
>>
>>
>> Web Services Design, Development and Maintenance http://adevsoft.com/
>>
>>
>> -Original Message-
>> From: Jean-Louis Martineau [mailto:martin...@zmanda.com]
>> Sent: Sunday, January 5, 2014 9:19 AM
>> To: Kervin L. Pierre
>> Cc: amanda-users@amanda.org
>> Subject: Re: amlabel segmentation fault
>>
>> Kevin,
>>
>> run amlabel under gdb:
>>
>> $  gdb perl
>> (gdb) run /usr/local/sbin/amlabel --version
>> (gdb) bt
>> (gdb) list
>>
>> Jean-Louis
>>
>> On 01/04/2014 11:01 PM, Kervin L. Pierre wrote:
>>> Hi,
>>>
>>> This Segfault seems to occur occasionally and for different 
>>> reasons.  It's possible that amlabel do not handle unknown devices 
>>> gracefully.  But I'm still looking.  My tapedevice is "S3".
>>>
>>> But I just built 3.3.5 on a Ubuntu desktop and now I get a segfault 
>>> whenever I run amlabel...
>>>
>>> $ perl -d /usr/local/sbin/amlabel --version
>>>
>>> Loading DB routines from perl5db.pl version 1.33 Editor support
>>> available.
>>>
>>> Enter h or `h h' for help, or `man perldebug' for more help.
>>>
>>>