public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: Prelinking on ARM with Debug Link
@ 2015-12-01  7:26 Torsten Polle
  0 siblings, 0 replies; 35+ messages in thread
From: Torsten Polle @ 2015-12-01  7:26 UTC (permalink / raw)
  To: mjw; +Cc: systemtap

Hi Mark,

> Torsten Polle writes
>
> Hi Mark,
>
> Mark Wielaard writes:
>> On Fri, Nov 27, 2015 at 04:06:14PM +0100, Mark Wielaard wrote:
>>> On Fri, Nov 27, 2015 at 01:57:31PM +0100, Torsten Polle wrote:
>>> > In file included from /tmp/stap/taptrek_src.c:6010:0:
>>> > /tmp/stap/stap-symbols.h:95902:1: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
>>> 
>>> But the stap-symbols.h file has only 8107 lines.
>
>> If you happen to know which library it is that causes the issue, then
>> it would be beneficial to also have the output of eu-readelf -Sl for
>> both the main and debug file.
>
>> And maybe the stap -vv output of the script to know which files and
>> probes are used.
>
>> Thanks,
>> Mark
>
> thanks for the support.
>
> I'll provide you with a reproduction scenario that is much smaller.
>
> Kind Regards,
> Torsten

please find a less complex example attached.

The output of readelf -Sl for the affected library.
libc-2.18.so.txt

The library is using a debug link to link to a file with the debug information.
libc-2.18.so.debug.txt

The command to run the script "taptrek_run_ZIX2.stp" is stored in "cmd.sh".

The output of executing "cmd.sh" is in "cmd-output.txt".

The folder "stap" contains the result of the stap run. I only removed
the already compiled object files to keep the size small.

Thanks,
Torsten

^ permalink raw reply	[flat|nested] 35+ messages in thread
* Re: Prelinking on ARM with Debug Link
@ 2015-12-01 19:29 Torsten Polle
  2016-02-09 20:55 ` Torsten Polle
  0 siblings, 1 reply; 35+ messages in thread
From: Torsten Polle @ 2015-12-01 19:29 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: systemtap

[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]

Hi Mark,
 
Now with attachment.

> Torsten Polle writes
>
> Hi Mark,
>
> Mark Wielaard writes:
>> On Fri, Nov 27, 2015 at 04:06:14PM +0100, Mark Wielaard wrote:
>>> On Fri, Nov 27, 2015 at 01:57:31PM +0100, Torsten Polle wrote:
>>> > In file included from /tmp/stap/taptrek_src.c:6010:0:
>>> > /tmp/stap/stap-symbols.h:95902:1: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
>>>
>>> But the stap-symbols.h file has only 8107 lines.
>
>> If you happen to know which library it is that causes the issue, then
>> it would be beneficial to also have the output of eu-readelf -Sl for
>> both the main and debug file.
>
>> And maybe the stap -vv output of the script to know which files and
>> probes are used.
>
>> Thanks,
>> Mark
>
> thanks for the support.
>
> I'll provide you with a reproduction scenario that is much smaller.
>
> Kind Regards,
> Torsten

Please find a less complex example attached.

The output of readelf -Sl for the affected library.
libc-2.18.so.txt

The library is using a debug link to link to a file with the debug information.
libc-2.18.so.debug.txt

The command to run the script "taptrek_run_ZIX2.stp" is stored in "cmd.sh".

The output of executing "cmd.sh" is in "cmd-output.txt".

The folder "stap" contains the result of the stap run. I only removed
the already compiled object files to keep the size small.

Thanks,
Torsten

[-- Attachment #2: prelinking.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 63461 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread
* Prelinking on ARM with Debug Link
@ 2015-11-25 20:52 Torsten Polle
  2015-11-26 10:33 ` Mark Wielaard
  0 siblings, 1 reply; 35+ messages in thread
From: Torsten Polle @ 2015-11-25 20:52 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: systemtap

Hi Mark,

I reported an issue with prelinking before. While I was able to solve my issue with your help before, I got stuck with my current issue. As you might remember, I’m using a cross compile environment, i.e. my host is a X86 64bit machine, while my target is a 32bit ARM machine (Freescale i.MX6).

Here I have a problem to compile my probes when I want to include unwind information.

The error message is as follow:

In file included from /tmp/stap/taptrek_src.c:6010:0:
/tmp/stap/stap-symbol.h:95831:1: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
 },
 ^

The offending line in stap-symbols.h looks as follows:
.sec_load_offset = 0xffffffffffffebc0 /* 4dec8000 4dec9440*/

The line includes debug output, because I checked the code in translate.cxx that generates this output and wanted to understand what is going wrong.

                  Dwarf_Addr dwbias = 0;
                  dwfl_module_getdwarf (m, &dwbias);
                  c->output << ".sec_load_offset = 0x"
                                    << hex << debug_frame_off - dwbias << dec
                                    << "/* "  << hex << debug_frame_off << " " << dwbias << dec << "*/"
                                    << "\n";

As I use a 64bit host, the hex value is given as 64bit long hex value. Additional the value is very large, because the value is actually the difference between debug_frame_off=0x4dec8000 and dwbias=0x4dec9440. As dwbias is larger than debug_frame_off, the value becomes negative. But the field .sec_load_offset as unsigned long and therefore does not take negative values.

I use a stripped and prelinked library on the target. The same library is available on the host as well. The debug link in the library points then to a non-prelinked file with the debug information. This works fine for most cases. E.g. I can set user space probe points. Only when I include the unwind information, this phenomenon occurs.

The offset of the .text section in the non-prelinked library is 0x15c40. 
The offset of the .text section in the prelinked library is 0x4decf080 - 0xdeb8000 = 0x17080.

This means that .sec_load_offset is exactly the difference 0x15c40 - 0x17080 ~ 0xffffffffffffebc0.

I wonder how I can overcome this situation.

Kind Regards,
Torsten

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

end of thread, other threads:[~2016-04-13  9:25 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01  7:26 Prelinking on ARM with Debug Link Torsten Polle
  -- strict thread matches above, loose matches on Subject: below --
2015-12-01 19:29 Torsten Polle
2016-02-09 20:55 ` Torsten Polle
2016-02-10 16:17   ` Mark Wielaard
2016-02-10 20:12     ` Torsten Polle
2016-02-10 20:35       ` Mark Wielaard
2016-02-11 10:49         ` Aw: " Torsten Polle
2016-02-16 10:08           ` Mark Wielaard
2016-02-16 20:46             ` Torsten Polle
2016-02-18 16:21               ` Mark Wielaard
2016-02-22 21:45                 ` Torsten Polle
2016-02-23 16:46                   ` Mark Wielaard
2016-02-23 22:16                     ` Torsten Polle
2016-02-28 20:51                       ` Torsten Polle
2016-03-30 20:05                         ` Torsten Polle
2016-04-01 13:07                           ` Mark Wielaard
2016-04-01 21:19                             ` Torsten Polle
2016-04-05 13:44                               ` Mark Wielaard
2016-04-06 20:45                                 ` Torsten Polle
2016-04-06 21:56                                   ` Mark Wielaard
2016-04-11 18:47                                     ` Torsten Polle
2016-04-11 21:02                                       ` Mark Wielaard
2016-04-12 20:26                                         ` Torsten Polle
2016-04-13  9:25                                           ` Mark Wielaard
2015-11-25 20:52 Torsten Polle
2015-11-26 10:33 ` Mark Wielaard
2015-11-26 22:05   ` Torsten Polle
2015-11-27  8:05     ` Mark Wielaard
2015-11-27 12:57       ` Torsten Polle
2015-11-27 15:06         ` Mark Wielaard
2015-11-27 16:34           ` Mark Wielaard
2015-11-27 20:08             ` Torsten Polle
2015-11-27 20:01           ` Torsten Polle
2015-11-30 19:26             ` David Smith
2015-12-01 20:10               ` Torsten Polle
2015-12-10 19:00                 ` David Smith
2015-12-10 19:45                   ` Torsten Polle

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