luca31 has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, today I had some runtime problem with perl, I don't remember exactly the message/warning anyway I searched a bit and I discover it was caused by a version mismath between perl and his compiled libraries, it was certainly feasible because my os was upgrade and I had installed some libraries with CPAN. Anyway I searched a bit on internet and without deeping further I tried to recompile the dynamic libraries with cpan -r It had compiled against a lot of libraries (I discover after launching the command it was reading @INC to evaluate all the libraries) I run the command as a normal user (not in the wheel group and without posix capabilities set) I'm wondering if the impacted libraries was written only in my home directories ~/perl5/lib*. Now I'm experiencing some random crash of perl process. Is there a way to revert the recompilation? Is it enough to drop the libraries in my home directories? Is there any tracks of the cpan recompilation process (some log/history)? Regards Luca

Replies are listed 'Best First'.
Re: dynamic module recompilation
by marto (Cardinal) on Sep 28, 2018 at 13:22 UTC

    It'd be a great help if you could let us see what one of these random crashes generates. Which OS do you use? Did you run cpan -r as a user with permissions to write to the system perl? If you are actually using the system perl it's best to use your OS package manager to install perl modules, OS upgrades will maintain this for you.

      Hi again, find below part of the apport report with the crash details:
      ProblemType: Crash Architecture: amd64 CurrentDesktop: XFCE Date: Fri Sep 28 12:09:52 2018 DistroRelease: Ubuntu 18.04 ExecutablePath: /usr/bin/perl ExecutableTimestamp: 1531923663 ProcCmdline: /usr/bin/perl -Mblib -I. -MStorable=dclone -emy\ $t;\ $Storable::recu +rsion_limit\ =\ -1;\ $t=[$t]\ for\ 1..65000;dclone($t);\ print\ qq/ok / ProcCwd: /home/fusillator/.cpan/build/Storable-3.11-0 SegvAnalysis: Segfault happened at: 0x7f06465da3dc <store+44>: callq 0x7f064 +65cd990 <Perl_ptr_table_fetch@plt> PC (0x7f06465da3dc) ok source "0x7f06465cd990" (0x7f06465cd990) ok destination "(%rsp)" (0x7ffe58591ff0) not located in a known VMA regi +on (needed writable region)! Stack memory exhausted (SP below stack segment) SegvReason: writing unknown VMA SourcePackage: perl Stacktrace: #0 0x00007f06465da3dc in store (my_perl=my_perl@entry=0x561207a79260 +, cxt=cxt@entry=0x561207c28500, sv=sv@entry=0x5612081808f0) at Storab +le.xs:4357 svh = <optimized out> ret = <optimized out> type = <optimized out> pseen = 0x561207c98ef0 #1 0x00007f06465db7fb in store_ref (my_perl=0x561207a79260, cxt=0x56 +1207c28500, sv=0x5612081808f0) at Storable.xs:2375 retval = <optimized out> is_weak = 0 #2 0x00007f06465da519 in store (my_perl=my_perl@entry=0x561207a79260 +, cxt=cxt@entry=0x561207c28500, sv=0x561208180938) at Storable.xs:446 +6 svh = <optimized out> ret = <optimized out> type = <optimized out> pseen = 0x561207c98ef0 ... #1998 0x00007f06465da519 in store (my_perl=my_perl@entry=0x561207a792 +60, cxt=cxt@entry=0x561207c28500, sv=0x56120818f718) at Storable.xs:4 +466 svh = <optimized out> ret = <optimized out> type = <optimized out> pseen = 0x561207c98ef0 #1999 0x00007f06465db11b in store_array (my_perl=0x561207a79260, cxt= +0x561207c28500, av=0x56120818f700) at Storable.xs:2700 sav = <optimized out> len = 1 i = 0 ret = <optimized out> Title: perl crashed with SIGSEGV in store() UnreportableReason: You have some obsolete package versions installed. Please upgrade the + following packages and check if the problem still occurs: gcc-8-base, libgcc1 UpgradeStatus: Upgraded to bionic on 2018-08-18 (40 days ago) _MarkForUpload: True
      I run cpan with a user without the permission to write on the system lib directories, apart those in his home:
      $ ls -ld $(perl -e 'print join("\n",@INC)') ls: cannot access '/usr/local/lib/x86_64-linux-gnu/perl/5.26.1': No su +ch file or directory ls: cannot access '/usr/local/share/perl/5.26.1': No such file or dire +ctory ls: cannot access '/usr/local/lib/site_perl': No such file or director +y drwxr-xr-x 1 root root 20 ago 18 18:44 /etc/perl drwxrwxr-x 11 fusillator fusillator 4096 lug 24 16:20 /home/fusillator +/perl5/lib/perl5 drwxrwxr-x 26 fusillator fusillator 4096 set 28 12:10 /home/fusillator +/perl5/lib/perl5/x86_64-linux-gnu-thread-multi lrwxrwxrwx 1 root root 6 lug 18 16:21 /usr/lib/x86_64- +linux-gnu/perl/5.26 -> 5.26.1 drwxr-xr-x 1 root root 272 ago 18 18:51 /usr/lib/x86_64- +linux-gnu/perl5/5.26 drwxr-xr-x 1 root root 844 ago 18 18:32 /usr/lib/x86_64- +linux-gnu/perl-base drwxr-xr-x 1 root root 510 ago 18 18:51 /usr/share/perl5 lrwxrwxrwx 1 root root 6 lug 18 16:21 /usr/share/perl/ +5.26 -> 5.26.1 $ ls -ld /usr/share/perl/5.26.1/ drwxr-xr-x 1 root root 2670 ago 18 18:32 /usr/share/perl/5.26.1/
      here's my cpan configuration (a default one):
      $CPAN::Config = { 'applypatch' => q[/usr/bin/applypatch], 'auto_commit' => q[0], 'build_cache' => q[100], 'build_dir' => q[/home/fusillator/.cpan/build], 'build_dir_reuse' => q[0], 'build_requires_install_policy' => q[yes], 'bzip2' => q[/bin/bzip2], 'cache_metadata' => q[1], 'check_sigs' => q[0], 'colorize_output' => q[0], 'commandnumber_in_prompt' => q[1], 'connect_to_internet_ok' => q[1], 'cpan_home' => q[/home/fusillator/.cpan], 'ftp_passive' => q[1], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gpg' => q[/usr/bin/gpg], 'gzip' => q[/bin/gzip], 'halt_on_failure' => q[0], 'histfile' => q[/home/fusillator/.cpan/histfile], 'histsize' => q[100], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[/home/fusillator/.cpan/sources], 'load_module_verbosity' => q[none], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'make_install_make_command' => q[/usr/bin/make], 'makepl_arg' => q[INSTALLDIRS=site], 'mbuild_arg' => q[], 'mbuild_install_arg' => q[], 'mbuild_install_build_command' => q[./Build], 'mbuildpl_arg' => q[--installdirs site], 'no_proxy' => q[], 'pager' => q[/usr/bin/less], 'patch' => q[/usr/bin/patch], 'perl5lib_verbosity' => q[none], 'plugin_list' => [], 'prefer_external_tar' => q[1], 'prefer_installer' => q[MB], 'prefs_dir' => q[/home/fusillator/.cpan/prefs], 'prerequisites_policy' => q[follow], 'recommends_policy' => q[1], 'scan_cache' => q[atstart], 'shell' => q[/bin/bash], 'show_unparsable_versions' => q[0], 'show_upload_date' => q[0], 'show_zero_versions' => q[0], 'suggests_policy' => q[0], 'tar' => q[/bin/tar], 'tar_verbosity' => q[none], 'term_is_latin' => q[1], 'term_ornaments' => q[1], 'test_report' => q[0], 'trust_test_report_history' => q[0], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[http://cpan.metacpan.org/], q[http://cpan.metacpan.o +rg/], q[http://mirror.liquidtelecom.com/CPAN/]], 'use_prompt_default' => q[0], 'use_sqlite' => q[0], 'version_timeout' => q[15], 'wget' => q[/usr/bin/wget], 'yaml_load_code' => q[0], 'yaml_module' => q[YAML], }; 1; __END__
      Let me know if further details could be useful. thanks Luca

        I'd suggest you return your system perl to normal, and install your own perl elsewhere on the system. If you mix and match a vendor perl and modules built from cpan you can run into problems after the OS has upgraded various parts of perl. User your OS package manager reinstall perl, note that some OS split perl across numerous packages. http://perlbrew.pl/?perlbrew makes it easy to install and maintain your own perl, or multiple versions should you require it, not that the process of manually building perl is particularly difficult.

      I can't do further test at the moment, as soon as I'll arrive at home I will upgrade the thread. Thanks a lot for your quick reply