tracking segfault upon invocation of perl script (mytop tool and similar)
on my gentoo machine, mytop 1.9.1 quits upon invocation with the following output:
# mytop
Useless use of private variable in void context at /usr/bin/mytop line 1001.
"my" variable $data masks earlier declaration in same scope at /usr/bin/mytop line 1035.
Errore di segmentazione
as far as I can understand, mytop is a Perl script (the tool is effectively readable via command vi /usr/bin/mytop), so I tried to update all perl subdependencies (as stated on https://wiki.gentoo.org/wiki/Perl), but that didn't solve the problem.
Then I also tried:
- downgrading to mytop 1.6-r4 (which is reported as stable on portage), same result: segmentation fault
- installing innotop 1.12.0 (which is a similar tool), same result: segmentation fault
Since the same problem pops out with two different tools, being suggested in comments to use a specific tool, I ran perl via gdb, then launched mytop backtracing the output with bt, here's the output:
# gdb /usr/bin/perl
GNU gdb (Gentoo 8.1 p1) 8.1
Copyright (C) 2018 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 "i686-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/perl...(no debugging symbols found)...done.
(gdb) run /usr/bin/mytop
Starting program: /usr/bin/perl /usr/bin/mytop
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Useless use of private variable in void context at /usr/bin/mytop line 1001.
"my" variable $data masks earlier declaration in same scope at /usr/bin/mytop line 1035.
Program received signal SIGSEGV, Segmentation fault.
0xb731511c in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
(gdb) bt
#0 0xb731511c in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
#1 0xb75563f6 in my_aes_decrypt () from /usr/lib/libmysqlclient.so.18
#2 0xb75521eb in ?? () from /usr/lib/libmysqlclient.so.18
#3 0xb75527c4 in ?? () from /usr/lib/libmysqlclient.so.18
#4 0xb75529ec in my_search_option_files () from /usr/lib/libmysqlclient.so.18
#5 0xb7553406 in my_load_defaults () from /usr/lib/libmysqlclient.so.18
#6 0xb7512e14 in mysql_read_default_options () from /usr/lib/libmysqlclient.so.18
#7 0xb751a56d in mysql_real_connect () from /usr/lib/libmysqlclient.so.18
#8 0xb78a013c in mysql_dr_connect () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#9 0xb78a25ea in ?? () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#10 0xb78a26c7 in mysql_db_login () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#11 0xb78ade8c in ?? () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#12 0xb7e92b04 in Perl_pp_entersub () from /usr/lib/libperl.so.5.24
#13 0xb7e8b043 in Perl_runops_standard () from /usr/lib/libperl.so.5.24
#14 0xb7e12a02 in Perl_call_sv () from /usr/lib/libperl.so.5.24
#15 0xb78cfd13 in XS_DBI_dispatch () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBI/DBI.so
#16 0xb7e92b04 in Perl_pp_entersub () from /usr/lib/libperl.so.5.24
#17 0xb7e8b043 in Perl_runops_standard () from /usr/lib/libperl.so.5.24
#18 0xb7e1a6cb in perl_run () from /usr/lib/libperl.so.5.24
#19 0x00400a67 in main ()
(gdb)
Almost the exact output comes when debugging innotop the same way, so upon suggestion from a friend in gentoo forum, I tried to rebuild from scratch perl, mysql and openssl (which all seemed to be involved in the segfault somehow), but that didn't help neither.
I think debugging via gdb's output might be resolutive, but I really don't know how to proceed (never had to deal with it before)
perl gentoo gdb segmentation-fault
add a comment |
on my gentoo machine, mytop 1.9.1 quits upon invocation with the following output:
# mytop
Useless use of private variable in void context at /usr/bin/mytop line 1001.
"my" variable $data masks earlier declaration in same scope at /usr/bin/mytop line 1035.
Errore di segmentazione
as far as I can understand, mytop is a Perl script (the tool is effectively readable via command vi /usr/bin/mytop), so I tried to update all perl subdependencies (as stated on https://wiki.gentoo.org/wiki/Perl), but that didn't solve the problem.
Then I also tried:
- downgrading to mytop 1.6-r4 (which is reported as stable on portage), same result: segmentation fault
- installing innotop 1.12.0 (which is a similar tool), same result: segmentation fault
Since the same problem pops out with two different tools, being suggested in comments to use a specific tool, I ran perl via gdb, then launched mytop backtracing the output with bt, here's the output:
# gdb /usr/bin/perl
GNU gdb (Gentoo 8.1 p1) 8.1
Copyright (C) 2018 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 "i686-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/perl...(no debugging symbols found)...done.
(gdb) run /usr/bin/mytop
Starting program: /usr/bin/perl /usr/bin/mytop
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Useless use of private variable in void context at /usr/bin/mytop line 1001.
"my" variable $data masks earlier declaration in same scope at /usr/bin/mytop line 1035.
Program received signal SIGSEGV, Segmentation fault.
0xb731511c in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
(gdb) bt
#0 0xb731511c in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
#1 0xb75563f6 in my_aes_decrypt () from /usr/lib/libmysqlclient.so.18
#2 0xb75521eb in ?? () from /usr/lib/libmysqlclient.so.18
#3 0xb75527c4 in ?? () from /usr/lib/libmysqlclient.so.18
#4 0xb75529ec in my_search_option_files () from /usr/lib/libmysqlclient.so.18
#5 0xb7553406 in my_load_defaults () from /usr/lib/libmysqlclient.so.18
#6 0xb7512e14 in mysql_read_default_options () from /usr/lib/libmysqlclient.so.18
#7 0xb751a56d in mysql_real_connect () from /usr/lib/libmysqlclient.so.18
#8 0xb78a013c in mysql_dr_connect () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#9 0xb78a25ea in ?? () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#10 0xb78a26c7 in mysql_db_login () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#11 0xb78ade8c in ?? () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#12 0xb7e92b04 in Perl_pp_entersub () from /usr/lib/libperl.so.5.24
#13 0xb7e8b043 in Perl_runops_standard () from /usr/lib/libperl.so.5.24
#14 0xb7e12a02 in Perl_call_sv () from /usr/lib/libperl.so.5.24
#15 0xb78cfd13 in XS_DBI_dispatch () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBI/DBI.so
#16 0xb7e92b04 in Perl_pp_entersub () from /usr/lib/libperl.so.5.24
#17 0xb7e8b043 in Perl_runops_standard () from /usr/lib/libperl.so.5.24
#18 0xb7e1a6cb in perl_run () from /usr/lib/libperl.so.5.24
#19 0x00400a67 in main ()
(gdb)
Almost the exact output comes when debugging innotop the same way, so upon suggestion from a friend in gentoo forum, I tried to rebuild from scratch perl, mysql and openssl (which all seemed to be involved in the segfault somehow), but that didn't help neither.
I think debugging via gdb's output might be resolutive, but I really don't know how to proceed (never had to deal with it before)
perl gentoo gdb segmentation-fault
Try running it understrace -f
to see who is segfaulting. Also, the last few messages indmesg
might also tell you which binary is segfaulting (probably easier to do this than usingstrace
if you haven't installed it yet, but you'll get less information).
– binki
Dec 17 at 14:15
add a comment |
on my gentoo machine, mytop 1.9.1 quits upon invocation with the following output:
# mytop
Useless use of private variable in void context at /usr/bin/mytop line 1001.
"my" variable $data masks earlier declaration in same scope at /usr/bin/mytop line 1035.
Errore di segmentazione
as far as I can understand, mytop is a Perl script (the tool is effectively readable via command vi /usr/bin/mytop), so I tried to update all perl subdependencies (as stated on https://wiki.gentoo.org/wiki/Perl), but that didn't solve the problem.
Then I also tried:
- downgrading to mytop 1.6-r4 (which is reported as stable on portage), same result: segmentation fault
- installing innotop 1.12.0 (which is a similar tool), same result: segmentation fault
Since the same problem pops out with two different tools, being suggested in comments to use a specific tool, I ran perl via gdb, then launched mytop backtracing the output with bt, here's the output:
# gdb /usr/bin/perl
GNU gdb (Gentoo 8.1 p1) 8.1
Copyright (C) 2018 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 "i686-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/perl...(no debugging symbols found)...done.
(gdb) run /usr/bin/mytop
Starting program: /usr/bin/perl /usr/bin/mytop
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Useless use of private variable in void context at /usr/bin/mytop line 1001.
"my" variable $data masks earlier declaration in same scope at /usr/bin/mytop line 1035.
Program received signal SIGSEGV, Segmentation fault.
0xb731511c in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
(gdb) bt
#0 0xb731511c in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
#1 0xb75563f6 in my_aes_decrypt () from /usr/lib/libmysqlclient.so.18
#2 0xb75521eb in ?? () from /usr/lib/libmysqlclient.so.18
#3 0xb75527c4 in ?? () from /usr/lib/libmysqlclient.so.18
#4 0xb75529ec in my_search_option_files () from /usr/lib/libmysqlclient.so.18
#5 0xb7553406 in my_load_defaults () from /usr/lib/libmysqlclient.so.18
#6 0xb7512e14 in mysql_read_default_options () from /usr/lib/libmysqlclient.so.18
#7 0xb751a56d in mysql_real_connect () from /usr/lib/libmysqlclient.so.18
#8 0xb78a013c in mysql_dr_connect () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#9 0xb78a25ea in ?? () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#10 0xb78a26c7 in mysql_db_login () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#11 0xb78ade8c in ?? () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#12 0xb7e92b04 in Perl_pp_entersub () from /usr/lib/libperl.so.5.24
#13 0xb7e8b043 in Perl_runops_standard () from /usr/lib/libperl.so.5.24
#14 0xb7e12a02 in Perl_call_sv () from /usr/lib/libperl.so.5.24
#15 0xb78cfd13 in XS_DBI_dispatch () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBI/DBI.so
#16 0xb7e92b04 in Perl_pp_entersub () from /usr/lib/libperl.so.5.24
#17 0xb7e8b043 in Perl_runops_standard () from /usr/lib/libperl.so.5.24
#18 0xb7e1a6cb in perl_run () from /usr/lib/libperl.so.5.24
#19 0x00400a67 in main ()
(gdb)
Almost the exact output comes when debugging innotop the same way, so upon suggestion from a friend in gentoo forum, I tried to rebuild from scratch perl, mysql and openssl (which all seemed to be involved in the segfault somehow), but that didn't help neither.
I think debugging via gdb's output might be resolutive, but I really don't know how to proceed (never had to deal with it before)
perl gentoo gdb segmentation-fault
on my gentoo machine, mytop 1.9.1 quits upon invocation with the following output:
# mytop
Useless use of private variable in void context at /usr/bin/mytop line 1001.
"my" variable $data masks earlier declaration in same scope at /usr/bin/mytop line 1035.
Errore di segmentazione
as far as I can understand, mytop is a Perl script (the tool is effectively readable via command vi /usr/bin/mytop), so I tried to update all perl subdependencies (as stated on https://wiki.gentoo.org/wiki/Perl), but that didn't solve the problem.
Then I also tried:
- downgrading to mytop 1.6-r4 (which is reported as stable on portage), same result: segmentation fault
- installing innotop 1.12.0 (which is a similar tool), same result: segmentation fault
Since the same problem pops out with two different tools, being suggested in comments to use a specific tool, I ran perl via gdb, then launched mytop backtracing the output with bt, here's the output:
# gdb /usr/bin/perl
GNU gdb (Gentoo 8.1 p1) 8.1
Copyright (C) 2018 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 "i686-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/perl...(no debugging symbols found)...done.
(gdb) run /usr/bin/mytop
Starting program: /usr/bin/perl /usr/bin/mytop
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Useless use of private variable in void context at /usr/bin/mytop line 1001.
"my" variable $data masks earlier declaration in same scope at /usr/bin/mytop line 1035.
Program received signal SIGSEGV, Segmentation fault.
0xb731511c in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
(gdb) bt
#0 0xb731511c in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
#1 0xb75563f6 in my_aes_decrypt () from /usr/lib/libmysqlclient.so.18
#2 0xb75521eb in ?? () from /usr/lib/libmysqlclient.so.18
#3 0xb75527c4 in ?? () from /usr/lib/libmysqlclient.so.18
#4 0xb75529ec in my_search_option_files () from /usr/lib/libmysqlclient.so.18
#5 0xb7553406 in my_load_defaults () from /usr/lib/libmysqlclient.so.18
#6 0xb7512e14 in mysql_read_default_options () from /usr/lib/libmysqlclient.so.18
#7 0xb751a56d in mysql_real_connect () from /usr/lib/libmysqlclient.so.18
#8 0xb78a013c in mysql_dr_connect () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#9 0xb78a25ea in ?? () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#10 0xb78a26c7 in mysql_db_login () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#11 0xb78ade8c in ?? () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBD/mysql/mysql.so
#12 0xb7e92b04 in Perl_pp_entersub () from /usr/lib/libperl.so.5.24
#13 0xb7e8b043 in Perl_runops_standard () from /usr/lib/libperl.so.5.24
#14 0xb7e12a02 in Perl_call_sv () from /usr/lib/libperl.so.5.24
#15 0xb78cfd13 in XS_DBI_dispatch () from /usr/lib/perl5/vendor_perl/5.24.3/i686-linux/auto/DBI/DBI.so
#16 0xb7e92b04 in Perl_pp_entersub () from /usr/lib/libperl.so.5.24
#17 0xb7e8b043 in Perl_runops_standard () from /usr/lib/libperl.so.5.24
#18 0xb7e1a6cb in perl_run () from /usr/lib/libperl.so.5.24
#19 0x00400a67 in main ()
(gdb)
Almost the exact output comes when debugging innotop the same way, so upon suggestion from a friend in gentoo forum, I tried to rebuild from scratch perl, mysql and openssl (which all seemed to be involved in the segfault somehow), but that didn't help neither.
I think debugging via gdb's output might be resolutive, but I really don't know how to proceed (never had to deal with it before)
perl gentoo gdb segmentation-fault
perl gentoo gdb segmentation-fault
edited Dec 20 at 11:27
asked Dec 17 at 12:26
funkoolow
458
458
Try running it understrace -f
to see who is segfaulting. Also, the last few messages indmesg
might also tell you which binary is segfaulting (probably easier to do this than usingstrace
if you haven't installed it yet, but you'll get less information).
– binki
Dec 17 at 14:15
add a comment |
Try running it understrace -f
to see who is segfaulting. Also, the last few messages indmesg
might also tell you which binary is segfaulting (probably easier to do this than usingstrace
if you haven't installed it yet, but you'll get less information).
– binki
Dec 17 at 14:15
Try running it under
strace -f
to see who is segfaulting. Also, the last few messages in dmesg
might also tell you which binary is segfaulting (probably easier to do this than using strace
if you haven't installed it yet, but you'll get less information).– binki
Dec 17 at 14:15
Try running it under
strace -f
to see who is segfaulting. Also, the last few messages in dmesg
might also tell you which binary is segfaulting (probably easier to do this than using strace
if you haven't installed it yet, but you'll get less information).– binki
Dec 17 at 14:15
add a comment |
1 Answer
1
active
oldest
votes
If I download the source code for mytop, unpack the tarball and test it for compilability and perl warnings ...
perl -cw mytop
I get:
Useless use of private variable in void context at mytop line 994.
"my" variable $data masks earlier declaration in same scope at mytop line 1028.
mytop syntax OK
Examination of the source code confirms these warnings. At line 994 we have:
994 print GREEN() if ($Ratio_now => 80.0);
The fat arrow operator ('=>') should be the numerical equality comparison operator ('==').
There are two declarations of $data within the same scope:
1020 my($data) = Hashes('show global variables like "read_only"');
...
1028 my($data) = Hashes('SHOW SLAVE STATUS');
So the source code is sub-optimal Perl 5 code.
I do not have Gentoo, but, given the line numbers, I suspect that the Gentoo package failed to correct these problems. (I have Ubuntu; the Debian/Ubuntu version of mytop does not throw those warnings and has a big diff from the source code.)
Notwithstanding the warnings, the source code does compile. Hence, the warnings which the source version throws may not explain the segfaults you are seeing. But I think you need to raise this problem with whoever maintains mytop for Gentoo.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489466%2ftracking-segfault-upon-invocation-of-perl-script-mytop-tool-and-similar%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If I download the source code for mytop, unpack the tarball and test it for compilability and perl warnings ...
perl -cw mytop
I get:
Useless use of private variable in void context at mytop line 994.
"my" variable $data masks earlier declaration in same scope at mytop line 1028.
mytop syntax OK
Examination of the source code confirms these warnings. At line 994 we have:
994 print GREEN() if ($Ratio_now => 80.0);
The fat arrow operator ('=>') should be the numerical equality comparison operator ('==').
There are two declarations of $data within the same scope:
1020 my($data) = Hashes('show global variables like "read_only"');
...
1028 my($data) = Hashes('SHOW SLAVE STATUS');
So the source code is sub-optimal Perl 5 code.
I do not have Gentoo, but, given the line numbers, I suspect that the Gentoo package failed to correct these problems. (I have Ubuntu; the Debian/Ubuntu version of mytop does not throw those warnings and has a big diff from the source code.)
Notwithstanding the warnings, the source code does compile. Hence, the warnings which the source version throws may not explain the segfaults you are seeing. But I think you need to raise this problem with whoever maintains mytop for Gentoo.
add a comment |
If I download the source code for mytop, unpack the tarball and test it for compilability and perl warnings ...
perl -cw mytop
I get:
Useless use of private variable in void context at mytop line 994.
"my" variable $data masks earlier declaration in same scope at mytop line 1028.
mytop syntax OK
Examination of the source code confirms these warnings. At line 994 we have:
994 print GREEN() if ($Ratio_now => 80.0);
The fat arrow operator ('=>') should be the numerical equality comparison operator ('==').
There are two declarations of $data within the same scope:
1020 my($data) = Hashes('show global variables like "read_only"');
...
1028 my($data) = Hashes('SHOW SLAVE STATUS');
So the source code is sub-optimal Perl 5 code.
I do not have Gentoo, but, given the line numbers, I suspect that the Gentoo package failed to correct these problems. (I have Ubuntu; the Debian/Ubuntu version of mytop does not throw those warnings and has a big diff from the source code.)
Notwithstanding the warnings, the source code does compile. Hence, the warnings which the source version throws may not explain the segfaults you are seeing. But I think you need to raise this problem with whoever maintains mytop for Gentoo.
add a comment |
If I download the source code for mytop, unpack the tarball and test it for compilability and perl warnings ...
perl -cw mytop
I get:
Useless use of private variable in void context at mytop line 994.
"my" variable $data masks earlier declaration in same scope at mytop line 1028.
mytop syntax OK
Examination of the source code confirms these warnings. At line 994 we have:
994 print GREEN() if ($Ratio_now => 80.0);
The fat arrow operator ('=>') should be the numerical equality comparison operator ('==').
There are two declarations of $data within the same scope:
1020 my($data) = Hashes('show global variables like "read_only"');
...
1028 my($data) = Hashes('SHOW SLAVE STATUS');
So the source code is sub-optimal Perl 5 code.
I do not have Gentoo, but, given the line numbers, I suspect that the Gentoo package failed to correct these problems. (I have Ubuntu; the Debian/Ubuntu version of mytop does not throw those warnings and has a big diff from the source code.)
Notwithstanding the warnings, the source code does compile. Hence, the warnings which the source version throws may not explain the segfaults you are seeing. But I think you need to raise this problem with whoever maintains mytop for Gentoo.
If I download the source code for mytop, unpack the tarball and test it for compilability and perl warnings ...
perl -cw mytop
I get:
Useless use of private variable in void context at mytop line 994.
"my" variable $data masks earlier declaration in same scope at mytop line 1028.
mytop syntax OK
Examination of the source code confirms these warnings. At line 994 we have:
994 print GREEN() if ($Ratio_now => 80.0);
The fat arrow operator ('=>') should be the numerical equality comparison operator ('==').
There are two declarations of $data within the same scope:
1020 my($data) = Hashes('show global variables like "read_only"');
...
1028 my($data) = Hashes('SHOW SLAVE STATUS');
So the source code is sub-optimal Perl 5 code.
I do not have Gentoo, but, given the line numbers, I suspect that the Gentoo package failed to correct these problems. (I have Ubuntu; the Debian/Ubuntu version of mytop does not throw those warnings and has a big diff from the source code.)
Notwithstanding the warnings, the source code does compile. Hence, the warnings which the source version throws may not explain the segfaults you are seeing. But I think you need to raise this problem with whoever maintains mytop for Gentoo.
answered Dec 23 at 0:12
James E Keenan
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489466%2ftracking-segfault-upon-invocation-of-perl-script-mytop-tool-and-similar%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try running it under
strace -f
to see who is segfaulting. Also, the last few messages indmesg
might also tell you which binary is segfaulting (probably easier to do this than usingstrace
if you haven't installed it yet, but you'll get less information).– binki
Dec 17 at 14:15