#1127: profiling core shows incorrect filenames.
--------------------+-------------------------------------------------------
 Reporter:  coke    |       Owner:  cotto
     Type:  bug     |      Status:  new  
 Priority:  normal  |   Milestone:       
Component:  none    |     Version:       
 Severity:  medium  |    Keywords:       
     Lang:          |       Patch:       
 Platform:          |  
--------------------+-------------------------------------------------------

Comment(by cotto):

 I have something resembling a minimal test case for this.  It's not
 exactly tiny but it's still considerably smaller than the whole of partcl.
 Below is a demo of the bug using pbc_dump to pick apart the pbc and show
 that the location of the const sub for TclConst;class_init is inconsistent
 with what file the debug segment says it should be in.  I'll try cooking
 this down some more tomorrow.  This bug's days may be numbered.


 {{{
 co...@feather:/usr/src/partcl-old\ 0 $ cat proftest
 #!/bin/bash

 echo "building..."
 /usr/local/parrot-svn/bin/parrot --output=runtime/tcllib.pbc
 runtime/tcllib.pir
 let tclconst_start=`pbc_dump runtime/tcllib.pbc |grep tclconst.pir \
     -B1|grep OFFSET|sed -e 's/.*=> //' -e 's/,.*//'`
 let tclconst_end="`pbc_dump runtime/tcllib.pbc |grep tclconst.pir \
     -A4|grep OFFSET|sed -e 's/.*=> //' -e 's/,.*//'`-1"
 let tclconst_class_init=`pbc_dump runtime/tcllib.pbc |grep "namespace =>
 'TclConst'" \
     -B6|grep class_init -B 3|head -n1|sed -e 's/.*start_offs => //' -e
 's/,.*//g'`
 echo "tclconst range (debug segment): $tclconst_start -> $tclconst_end"
 echo "TclConst;class_init starts at $tclconst_class_init"
 if [ $tclconst_class_init > tclconst_end ]
 then
     echo "pbc is broken"
 else
     echo "pbc might not be broken"
 fi
 co...@feather:/usr/src/partcl-old\ 0 $ cat runtime/tcllib.pir
 .include 'src/class/tclarray.pir'
 .include 'src/class/tclconst.pir'
 .include 'src/class/tcldict.pir'
 co...@feather:/usr/src/partcl-old\ 0 $ cat src/class/tclarray.pir
 .sub does :vtable
   .param string provides
 .end

 co...@feather:/usr/src/partcl-old\ 0 $ cat src/class/tclconst.pir
 .namespace [ 'TclConst' ]

 .sub class_init :anon :load
   $P0 = get_class 'String'
 .end

 co...@feather:/usr/src/partcl-old\ 0 $ cat src/class/tcldict.pir
 .namespace [ 'TclDict' ]
 .sub class_init :anon :load
     say "wut"
 .end
 co...@feather:/usr/src/partcl-old\ 0 $ ./proftest
 building...
 tclconst range (debug segment): 3 -> 5
 TclConst;class_init starts at 7
 pbc is broken
 }}}

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1127#comment:4>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to