[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    Re: AIX and stdbool.h (was Re: Fw: Smoke [5.15.3]
From:       Nicholas Clark <nick () ccl4 ! org>
Date:       2011-10-31 15:31:15
Message-ID: 20111031153114.GO23881 () plum ! flirble ! org
[Download RAW message or body]

On Sun, Oct 30, 2011 at 11:04:26AM +0100, Rainer Tammer wrote:
> Hello,
> Just to let you know, I did a static non shared build and the problem is
> the same.
> So fortunately we do not have to deal with threading/shared stuff.

At least some good news.

> Unfortunately I can not break at gv.c:2015. The whole thing seems to
> fail before that:
> 
> 
> # dbx ./miniperl
> Type 'help' for help.
> reading symbolic information ...
> (dbx) stop at "gv.c":2015
> [1] stop at "gv.c":2015
> (dbx) run -le 'print length $^V'
> 
> 
> execution completed
> (dbx)
> ---------------------------------
> # gdb ./miniperl
> GNU gdb 6.8
> Copyright (C) 2008 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 "powerpc-ibm-aix5.1.0.0"...
> (gdb) b gv.c:2015
> Breakpoint 1 at 0x100808b0: file gv.c, line 2015.
> (gdb) run -le 'print length $^V'
> Starting program: /daten/source/perl-current_32/miniperl -le 'print
> length $^V'
> 
> 
> Program exited normally.
> (gdb)

Strange. That's an exit with no output?


Another way to try to get to line 2015 would be something like this.
I've changed the one-liner to do the work inside eval so that I can put
a breakpoint on perl_run() and skip all the calls during perl interpreter
setup. Clearing the breakpoint on Perl_gv_fetchpvn_flags is necessary
because otherwise it will stop in lots of calls within Perl_version_new().
I hope that this can get to a dump of $^V on AIX at the point in question:

$ gdb ./miniperl
GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared \
libraries ... done

(gdb) b perl_run
Breakpoint 1 at 0x100007d52: file perl.c, line 2281.
(gdb) run -le 'eval q{print length $^V}'
Starting program: /Volumes/Stuff/Perl/perl/miniperl -le 'eval q{print length $^V}'
Reading symbols for shared libraries ++.. done

Breakpoint 1, perl_run (my_perl=0x100500080) at perl.c:2281
2281        int ret = 0;
(gdb) b Perl_gv_fetchpvn_flags
Breakpoint 2 at 0x10005a721: file gv.c, line 1436.
(gdb) c
Continuing.

Breakpoint 2, Perl_gv_fetchpvn_flags (nambeg=0x100508210 "length", full_len=6, \
flags=0, sv_type=SVt_PVCV) at gv.c:1436 1436        register const char *name = \
nambeg; (gdb) 
Continuing.

Breakpoint 2, Perl_gv_fetchpvn_flags (nambeg=0x100508211 "\026", full_len=1, \
flags=10, sv_type=SVt_PV) at gv.c:1436 1436        register const char *name = \
nambeg; (gdb) clear
Deleted breakpoint 2 
(gdb) n
1437        register GV *gv = NULL;
(gdb) 
1441        HV *stash = NULL;
(gdb) 
1442        const I32 no_init = flags & (GV_NOADD_NOINIT | GV_NOINIT);
(gdb) 
1443        const I32 no_expand = flags & GV_NOEXPAND;
(gdb) 
1444        const I32 add = flags & ~GV_NOADD_MASK;
(gdb) 
1445        const U32 is_utf8 = flags & SVf_UTF8;
(gdb) 
1446        bool addmg = !!(flags & GV_ADDMG);
(gdb) 
1447        const char *const name_end = nambeg + full_len;
(gdb) 
1448        const char *const name_em1 = name_end - 1;
(gdb) 
1451        PERL_ARGS_ASSERT_GV_FETCHPVN_FLAGS;
(gdb) 
1453        if (flags & GV_NOTQUAL) {
(gdb) 
1459        if (full_len > 2 && *name == '*' && isIDFIRST_lazy_if(name + 1, is_utf8)) \
{ (gdb) 
1464        for (name_cursor = name; name_cursor < name_end; name_cursor++) {
(gdb) 
1465            if (name_cursor < name_em1 &&
(gdb) 
1464        for (name_cursor = name; name_cursor < name_end; name_cursor++) {
(gdb) 
1531        len = name_cursor - name;
(gdb) 
1535        if (!stash) {
(gdb) 
1537            if (len && isIDFIRST_lazy(name)) {
(gdb) 
1619                stash = PL_defstash;
(gdb) 
1624        if (!stash) {
(gdb) 
1647        if (!SvREFCNT(stash))       /* symbol table under destruction */
(gdb) 
1650        gvp = (GV**)hv_fetch(stash,name,is_utf8 ? -len : len,add);
(gdb) 
1651        if (!gvp || *gvp == (const GV *)&PL_sv_undef) {
(gdb) 
1655        else gv = *gvp, addmg = 0;
(gdb) 
1659        if (SvTYPE(gv) == SVt_PVGV) {
(gdb) 
1679        } else if (no_init) {
(gdb) 
1682        } else if (no_expand && SvROK(gv)) {
(gdb) 
1694        faking_it = SvOK(gv);
(gdb) 
1696        if (add & GV_ADDWARN)
(gdb) 
1699        gv_init_pvn(gv, stash, name, len, (add & GV_ADDMULTI)|is_utf8);
(gdb) 
1701        if ( isIDFIRST_lazy_if(name, is_utf8)
(gdb) 
1706        if (stash != PL_defstash) { /* not the main stash */
(gdb) 
1745        else if (len > 1) {
(gdb) 
1878            switch (*name) {
(gdb) 
2014                SV * const sv = GvSV(gv);
(gdb) 
2015                GvSV(gv) = new_version(PL_patchlevel);
(gdb) p sv
$1 = (SV * const) 0x0
(gdb) call Perl_sv_dump(PL_patchlevel)
SV = PV(0x100801040) at 0x100802cc0
  REFCNT = 1
  FLAGS = (POK,pPOK)
  PV = 0x100500860 "v5.15.4"\0
  CUR = 7
  LEN = 16
(gdb) n
2016                SvREADONLY_on(GvSV(gv));
(gdb) call Perl_sv_dump(gv->sv_u.svu_gp->gp_sv)
SV = PV(0x100801150) at 0x100812710
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x100812740
    SV = PVHV(0x100807b80) at 0x100812740
      REFCNT = 1
      FLAGS = (OBJECT,OVERLOAD,SHAREKEYS)
      STASH = 0x100803338       "version"
      ARRAY = 0x1005088d0  (0:6, 1:1, 2:1)
      hash quality = 90.0%
      KEYS = 3
      FILL = 2
      MAX = 7
      RITER = -1
      EITER = 0x0
        Elt "original" HASH = 0xb45e44f2
        SV = PV(0x100801180) at 0x1008128d8
          REFCNT = 1
          FLAGS = (POK,pPOK)
          PV = 0x100506090 "v5.15.4"\0
          CUR = 7
          LEN = 16
        Elt "qv" HASH = 0x18c4b28a
        SV = IV(0x100812868) at 0x100812878
          REFCNT = 1
          FLAGS = (IOK,pIOK)
          IV = 1
        Elt "version" HASH = 0x68c27e33
        SV = IV(0x1008128e0) at 0x1008128f0
          REFCNT = 1
          FLAGS = (ROK)
          RV = 0x100802fc0
            SV = PVAV(0x100804088) at 0x100802fc0
              REFCNT = 1
              FLAGS = ()
              ARRAY = 0x100508910
              FILL = 2
              MAX = 3
              ARYLEN = 0x0
              FLAGS = (REAL)
                Elt No. 0
                SV = IV(0x100812880) at 0x100812890
                  REFCNT = 1
                  FLAGS = (IOK,pIOK)
                  IV = 5
                Elt No. 1
                SV = IV(0x100812898) at 0x1008128a8
                  REFCNT = 1
                  FLAGS = (IOK,pIOK)
                  IV = 15
                Elt No. 2
                SV = IV(0x1008128b0) at 0x1008128c0
                  REFCNT = 1
                  FLAGS = (IOK,pIOK)
                  IV = 4
  PV = 0x100812740 ""
  CUR = 0
  LEN = 0
(gdb) 


Nicholas Clark


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic