public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Warning: Too many CFI instuctions
@ 2018-11-25 21:31 Torsten Polle
  2018-11-26 17:57 ` Mark Wielaard
  0 siblings, 1 reply; 3+ messages in thread
From: Torsten Polle @ 2018-11-25 21:31 UTC (permalink / raw)
  To: systemtap

Hi,

I get the following warning when calculating backtraces with SystemTap: "Too many CFI instuctions“. Therefore I change the output of the warning to print out the number of needed instructions.

Too many CFI instuctions: 723
Too many CFI instuctions: 967
Too many CFI instuctions: 571
Too many CFI instuctions: 555
Too many CFI instuctions: 2167
Too many CFI instuctions: 883
Too many CFI instuctions: 647
Too many CFI instuctions: 2691
Too many CFI instuctions: 787
Too many CFI instuctions: 931
Too many CFI instuctions: 1627
Too many CFI instuctions: 751
Too many CFI instuctions: 615
Too many CFI instuctions: 1283
Too many CFI instuctions: 619
Too many CFI instuctions: 663
Too many CFI instuctions: 727
Too many CFI instuctions: 759
Too many CFI instuctions: 579
Too many CFI instuctions: 527
Too many CFI instuctions: 959
Too many CFI instuctions: 1091
Too many CFI instuctions: 1335
Too many CFI instuctions: 515
Too many CFI instuctions: 843
Too many CFI instuctions: 1567
Too many CFI instuctions: 671
Too many CFI instuctions: 539
Too many CFI instuctions: 991
Too many CFI instuctions: 823
Too many CFI instuctions: 1211
Too many CFI instuctions: 627
Too many CFI instuctions: 667
Too many CFI instuctions: 695
Too many CFI instuctions: 639
Too many CFI instuctions: 691
Too many CFI instuctions: 635
Too many CFI instuctions: 587
Too many CFI instuctions: 2299
Too many CFI instuctions: 1019
Too many CFI instuctions: 763
Too many CFI instuctions: 547
Too many CFI instuctions: 523
Too many CFI instuctions: 1095
Too many CFI instuctions: 771
Too many CFI instuctions: 543
Too many CFI instuctions: 875
Too many CFI instuctions: 2223
Too many CFI instuctions: 535
Too many CFI instuctions: 903
Too many CFI instuctions: 799
Too many CFI instuctions: 755
Too many CFI instuctions: 1219
Too many CFI instuctions: 867
Too many CFI instuctions: 592
Too many CFI instuctions: 611
Too many CFI instuctions: 5547
Too many CFI instuctions: 1847

Consequently, I increase the maximum to 8192 in runtime/unwind.c.
#define MAX_CFI 8192

As a result SystemTap behaves as expected.

Would it be possible to either increase the size or make it configurable?

Regards,
Torsten


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Warning: Too many CFI instuctions
  2018-11-25 21:31 Warning: Too many CFI instuctions Torsten Polle
@ 2018-11-26 17:57 ` Mark Wielaard
  2019-02-05 20:44   ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2018-11-26 17:57 UTC (permalink / raw)
  To: Torsten Polle; +Cc: systemtap

Hi Torsten,

On Sun, Nov 25, 2018 at 10:31:33PM +0100, Torsten Polle wrote:
> I get the following warning when calculating backtraces with SystemTap: "Too many CFI instuctions“. Therefore I change the output of the warning to print out the number of needed instructions.
> 
> Too many CFI instuctions: 723
> Too many CFI instuctions: 967
> Too many CFI instuctions: 571
> Too many CFI instuctions: 555
> Too many CFI instuctions: 2167
> Too many CFI instuctions: 883
> Too many CFI instuctions: 647
> Too many CFI instuctions: 2691
> Too many CFI instuctions: 787
> Too many CFI instuctions: 931
> Too many CFI instuctions: 1627
> Too many CFI instuctions: 751
> Too many CFI instuctions: 615
> Too many CFI instuctions: 1283
> Too many CFI instuctions: 619
> Too many CFI instuctions: 663
> Too many CFI instuctions: 727
> Too many CFI instuctions: 759
> Too many CFI instuctions: 579
> Too many CFI instuctions: 527
> Too many CFI instuctions: 959
> Too many CFI instuctions: 1091
> Too many CFI instuctions: 1335
> Too many CFI instuctions: 515
> Too many CFI instuctions: 843
> Too many CFI instuctions: 1567
> Too many CFI instuctions: 671
> Too many CFI instuctions: 539
> Too many CFI instuctions: 991
> Too many CFI instuctions: 823
> Too many CFI instuctions: 1211
> Too many CFI instuctions: 627
> Too many CFI instuctions: 667
> Too many CFI instuctions: 695
> Too many CFI instuctions: 639
> Too many CFI instuctions: 691
> Too many CFI instuctions: 635
> Too many CFI instuctions: 587
> Too many CFI instuctions: 2299
> Too many CFI instuctions: 1019
> Too many CFI instuctions: 763
> Too many CFI instuctions: 547
> Too many CFI instuctions: 523
> Too many CFI instuctions: 1095
> Too many CFI instuctions: 771
> Too many CFI instuctions: 543
> Too many CFI instuctions: 875
> Too many CFI instuctions: 2223
> Too many CFI instuctions: 535
> Too many CFI instuctions: 903
> Too many CFI instuctions: 799
> Too many CFI instuctions: 755
> Too many CFI instuctions: 1219
> Too many CFI instuctions: 867
> Too many CFI instuctions: 592
> Too many CFI instuctions: 611
> Too many CFI instuctions: 5547
> Too many CFI instuctions: 1847
> 
> Consequently, I increase the maximum to 8192 in runtime/unwind.c.
> #define MAX_CFI 8192
> 
> As a result SystemTap behaves as expected.
> 
> Would it be possible to either increase the size or make it configurable?

We could certainly make it larger and/or configurable.
Probably using it as:

#ifndef MAX_CFI
#define MAX_CFI 512
#endif

would make it possible to just use stap -DMAX_CFI=8192
(untested)

But what has 5000+ CFI instructions? That seems excessive.
As the comment says:

/* Limit the number of instructions we process. Arbitrary limit.
   512 should be enough for anybody... */

Apparently 512 isn't enough for everybody :)
But I am really curious what CFI is so big.

Thanks,

Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Warning: Too many CFI instuctions
  2018-11-26 17:57 ` Mark Wielaard
@ 2019-02-05 20:44   ` Frank Ch. Eigler
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Ch. Eigler @ 2019-02-05 20:44 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: Torsten Polle, systemtap


mark wrote ... in a necrothread long ago:

> [...]
>> I get the following warning when calculating backtraces with
>> SystemTap: "Too many CFI instuctions“. Therefore I change the output
>> of the warning to print out the number of needed instructions.
>> Would it be possible to either increase the size or make it configurable?
>
> #ifndef MAX_CFI
> #define MAX_CFI 512
> #endif

And this was done.

> would make it possible to just use stap -DMAX_CFI=8192
> (untested)
> But what has 5000+ CFI instructions? That seems excessive.

Just for giggles, I ran 

% eu-readelf -wframe BINARY |
awk 'BEGIN { state=0; max=0 }
     /initial_location/ { name=$0}
     /Program:/ { state=1; count=0; next }
     /^.....*/ && (state==1) { count ++ } 
     /^$/ && (state==1) { print(name, " CFI-length:", count); state=0;
                          if (max < count) { max = count }}
     END { print("max cfi count: ", max)}' | grep max.cfi.count

on some random binaries in fedora29 x86-64.

libavcodec.so.58: 3176
libQt5WebEngineCore.so.5.11.3: 4856
mame: 1805
libxul.so: 2175
vmlinux: 234

so these are real.  I'll bump up the number to 8192, which I haven't
seen anything get close.


- FChE

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-05 20:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-25 21:31 Warning: Too many CFI instuctions Torsten Polle
2018-11-26 17:57 ` Mark Wielaard
2019-02-05 20:44   ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).