public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error
@ 2015-02-19 22:50 curzonj at gmail dot com
  2015-02-19 23:08 ` [Bug translator/18001] Using sysname(), " curzonj at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: curzonj at gmail dot com @ 2015-02-19 22:50 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18001

            Bug ID: 18001
           Summary: Using backtrace(), caller(), or callers(n) causes a
                    gcc internal error
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: curzonj at gmail dot com

Overview: Calling caller() causes a gcc internal error.
Reproduce:

stap -k -v -e 'probe kernel.function("dev_hold") { printf("%s", caller()) }'

Actual Results: GCC internal error during compile.
Expected Results: Compile happens and script runs

I want to use caller, but I tried callers(n) and backtrack() and they caused
the same GCC internal error result.

The compile log and artifacts are here:
https://gist.github.com/curzonj/857090762c52730aa028

root@vagrant-ubuntu-trusty-64:/vagrant# uname -a
Linux vagrant-ubuntu-trusty-64 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13
19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
root@vagrant-ubuntu-trusty-64:/vagrant# dpkg -l | grep linux-image
ii  linux-image-3.13.0-40-generic        3.13.0-40.69                     amd64
       Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-40-generic-dbgsym 3.13.0-40.69                     amd64
       Linux kernel debug image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-45-generic        3.13.0-45.74                     amd64
       Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-45-generic-dbgsym 3.13.0-45.74                     amd64
       Linux kernel debug image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-virtual                  3.13.0.45.52                     amd64
       This package will always depend on the latest minimal generic kernel
image.
root@vagrant-ubuntu-trusty-64:/vagrant# dpkg -l | grep gcc
ii  gcc                                  4:4.8.2-1ubuntu6                 amd64
       GNU C compiler
ii  gcc-4.8                              4.8.2-19ubuntu1                  amd64
       GNU C compiler
ii  gcc-4.8-base:amd64                   4.8.2-19ubuntu1                  amd64
       GCC, the GNU Compiler Collection (base package)
ii  gcc-4.9-base:amd64                   4.9.1-0ubuntu1                   amd64
       GCC, the GNU Compiler Collection (base package)
ii  libgcc-4.8-dev:amd64                 4.8.2-19ubuntu1                  amd64
       GCC support library (development files)
ii  libgcc1:amd64                        1:4.9.1-0ubuntu1                 amd64
       GCC support library
root@vagrant-ubuntu-trusty-64:/vagrant# dpkg -l | grep systemtap
ii  systemtap                            2.3-1ubuntu1                     amd64
       instrumentation system for Linux
ii  systemtap-common                     2.3-1ubuntu1                     all  
       instrumentation system for Linux (common component)
ii  systemtap-runtime                    2.3-1ubuntu1                     amd64
       instrumentation system for Linux (runtime component)

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/18001] Using sysname(), caller(), or callers(n) causes a gcc internal error
  2015-02-19 22:50 [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error curzonj at gmail dot com
@ 2015-02-19 23:08 ` curzonj at gmail dot com
  2015-02-19 23:10 ` curzonj at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: curzonj at gmail dot com @ 2015-02-19 23:08 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18001

curzonj at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Using backtrace(),          |Using sysname(), caller(),
                   |caller(), or callers(n)     |or callers(n) causes a gcc
                   |causes a gcc internal error |internal error

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/18001] Using sysname(), caller(), or callers(n) causes a gcc internal error
  2015-02-19 22:50 [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error curzonj at gmail dot com
  2015-02-19 23:08 ` [Bug translator/18001] Using sysname(), " curzonj at gmail dot com
@ 2015-02-19 23:10 ` curzonj at gmail dot com
  2015-02-20  3:01 ` curzonj at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: curzonj at gmail dot com @ 2015-02-19 23:10 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18001

--- Comment #1 from curzonj at gmail dot com ---
I was wrong, about backtrace also causing a compile error. But here is some
more info.

This works:

stap -e 'probe kernel.function("dev_hold") { printf("%x", caller_addr());
exit() }'

But this fails:

stap -e 'probe kernel.function("dev_hold") { printf("%s",
symname(caller_addr())); exit() }'

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/18001] Using sysname(), caller(), or callers(n) causes a gcc internal error
  2015-02-19 22:50 [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error curzonj at gmail dot com
  2015-02-19 23:08 ` [Bug translator/18001] Using sysname(), " curzonj at gmail dot com
  2015-02-19 23:10 ` curzonj at gmail dot com
@ 2015-02-20  3:01 ` curzonj at gmail dot com
  2015-02-20 14:30 ` fche at redhat dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: curzonj at gmail dot com @ 2015-02-20  3:01 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18001

--- Comment #2 from curzonj at gmail dot com ---
I tried it with the latest 2.7 code and it still happens:

root@vagrant-ubuntu-trusty-64:~# ./systemtap-2.7-19547/bin/stap -v -e 'probe
kernel.function("dev_hold") { printf("%s", caller()) }'
Pass 1: parsed user script and 106 library script(s) using
58116virt/34428res/2108shr/33140data kb, in 100usr/0sys/109real ms.
Pass 2: analyzed script: 50 probe(s), 9 function(s), 5 embed(s), 0 global(s)
using 102708virt/79992res/3248shr/77732data kb, in 1250usr/610sys/2204real ms.
Pass 3: translated to C into
"/tmp/stapYJx4LW/stap_e822ddb75f639bdc4f9d6dc5d068516b_16046_src.c" using
102708virt/80668res/3544shr/77732data kb, in 280usr/20sys/295real ms.
gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[1]: ***
[/tmp/stapYJx4LW/stap_e822ddb75f639bdc4f9d6dc5d068516b_16046_src.o] Error 4
make: *** [_module_/tmp/stapYJx4LW] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_e822ddb75f639bdc4f9d6dc5d068516b_16046.ko" in
3930usr/1780sys/17480real ms.
Pass 4: compilation failed.  [man error::pass4]
root@vagrant-ubuntu-trusty-64:~# ./systemtap-2.7-19547/bin/stap -v
A script must be specified.
Try '--help' for more information.
root@vagrant-ubuntu-trusty-64:~# ./systemtap-2.7-19547/bin/stap --version
Systemtap translator/driver (version 2.7/0.160, non-git sources)
Copyright (C) 2005-2014 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: TR1_UNORDERED_MAP NLS

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/18001] Using sysname(), caller(), or callers(n) causes a gcc internal error
  2015-02-19 22:50 [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error curzonj at gmail dot com
                   ` (2 preceding siblings ...)
  2015-02-20  3:01 ` curzonj at gmail dot com
@ 2015-02-20 14:30 ` fche at redhat dot com
  2015-02-20 17:31 ` curzonj at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: fche at redhat dot com @ 2015-02-20 14:30 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18001

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #3 from Frank Ch. Eigler <fche at redhat dot com> ---
A gcc internal compiler error is at least a gcc bug (and could also
be a stap bug in terms of C code it generates).  I'll add some info to
the error::pass4 man page to help gather data for the gcc guys, but
it'll go something like

   stap -k --vp 0004 -p4 .....
   cd /var/tmp/stapFOOBAR
   edit Makefile to run gcc -E rather than -c
   send resulting .i (preprocessed input) and CFLAGS to gcc guys

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/18001] Using sysname(), caller(), or callers(n) causes a gcc internal error
  2015-02-19 22:50 [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error curzonj at gmail dot com
                   ` (3 preceding siblings ...)
  2015-02-20 14:30 ` fche at redhat dot com
@ 2015-02-20 17:31 ` curzonj at gmail dot com
  2015-02-22  1:51 ` fche at redhat dot com
  2020-02-19 21:40 ` fche at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: curzonj at gmail dot com @ 2015-02-20 17:31 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18001

--- Comment #4 from curzonj at gmail dot com ---
Frank,

I couldn't find any place in the Makefile that specified "-c". I did see the -c
in the output of the build process when make ran gcc, so I copied the gcc
command and manually changed the -c to -E and ran it from the kernel headers
directory. The command ran and exited with the same internal error, but I
didn't find any *.i files in my cwd nor in the /tmp/stap* directory. Then I
realized that the -o command may have put the .i contents in the .o file. Then
when I went to submit a gcc bug report, they don't accept new account
registrations which are required to report a bug. Just some problems I ran into
when you write the notes in error::pass4.

Thanks,
Jordan

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/18001] Using sysname(), caller(), or callers(n) causes a gcc internal error
  2015-02-19 22:50 [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error curzonj at gmail dot com
                   ` (4 preceding siblings ...)
  2015-02-20 17:31 ` curzonj at gmail dot com
@ 2015-02-22  1:51 ` fche at redhat dot com
  2020-02-19 21:40 ` fche at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: fche at redhat dot com @ 2015-02-22  1:51 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18001

--- Comment #5 from Frank Ch. Eigler <fche at redhat dot com> ---
This commit adds some man(nroff) goodness as to how to invoke
the preprocessor with less fuss.

https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=commitdiff;h=52c654ecb6d0178ea413fb102803a7395541fda6

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/18001] Using sysname(), caller(), or callers(n) causes a gcc internal error
  2015-02-19 22:50 [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error curzonj at gmail dot com
                   ` (5 preceding siblings ...)
  2015-02-22  1:51 ` fche at redhat dot com
@ 2020-02-19 21:40 ` fche at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: fche at redhat dot com @ 2020-02-19 21:40 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18001

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #6 from Frank Ch. Eigler <fche at redhat dot com> ---
Since commit eead67871, stap -k will also create a preprocessed .i file for use
in diagnosing such problems.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

end of thread, other threads:[~2020-02-19 21:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-19 22:50 [Bug translator/18001] New: Using backtrace(), caller(), or callers(n) causes a gcc internal error curzonj at gmail dot com
2015-02-19 23:08 ` [Bug translator/18001] Using sysname(), " curzonj at gmail dot com
2015-02-19 23:10 ` curzonj at gmail dot com
2015-02-20  3:01 ` curzonj at gmail dot com
2015-02-20 14:30 ` fche at redhat dot com
2015-02-20 17:31 ` curzonj at gmail dot com
2015-02-22  1:51 ` fche at redhat dot com
2020-02-19 21:40 ` fche at redhat dot com

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).