Skip to contentSkip to conversation

Issue in man page sprof.1

DISCUSSION Helge Kreutzmann 4 participants 10 messages Nov 17, 2024 – Feb 10 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Without further ado, the following was found:

Issue: Inconsistency detected by ld.so: dl-open.c: 930: _dl_open: Assertion `_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT' failed!

"$ B<sprof -p libdemo.so.1 $LD_PROFILE_OUTPUT/libdemo.so.1.profile>\n" "Flat profile:\n"
"\\&\n"
"Each sample counts as 0.01 seconds.\n"
" % cumulative self self total\n"

" time   seconds   seconds    calls  us/call  us/call  name\n"
" 60.00      0.06     0.06      100   600.00           consumeCpu1\n"
" 40.00      0.10     0.04     1000    40.00           consumeCpu2\n"
"  0.00      0.10     0.00        1     0.00           x1\n"
"  0.00      0.10     0.00        1     0.00           x2\n"
#1 lore raw

Hi Helge,

Quoted 3 lines · Helge Kreutzmann

Without further ado, the following was found:

Issue: Inconsistency detected by ld.so: dl-open.c: 930: _dl_open: Assertion `_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT' failed!

IIUC, this report is that running the example shell session resulted in that problem. I've CCed glibc in case they can help.

It would be interesting to know if this can be reproduced, and a full reproducer.

Cheers,
Alex

Quoted 11 lines

"$ B<sprof -p libdemo.so.1 $LD_PROFILE_OUTPUT/libdemo.so.1.profile>\n" "Flat profile:\n"
"\\&\n"
"Each sample counts as 0.01 seconds.\n"
" % cumulative self self total\n"

" time   seconds   seconds    calls  us/call  us/call  name\n"
" 60.00      0.06     0.06      100   600.00           consumeCpu1\n"
" 40.00      0.10     0.04     1000    40.00           consumeCpu2\n"
"  0.00      0.10     0.00        1     0.00           x1\n"
"  0.00      0.10     0.00        1     0.00           x2\n"
Signature · 1 line
<https://www.alejandro-colomar.es/>
#2 lore raw

* Alejandro Colomar:

Quoted 5 lines

Hi Helge,

Quoted 2 lines · Helge Kreutzmann

Without further ado, the following was found:

Quoted 7 lines
Quoted 1 line

Issue: Inconsistency detected by ld.so: dl-open.c: 930: _dl_open: Assertion `_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT' failed!

IIUC, this report is that running the example shell session resulted in that problem. I've CCed glibc in case they can help.

It would be interesting to know if this can be reproduced, and a full reproducer.

Hasn't this been fixed in glibc 2.38? Via:

commit ab5aa2ee3d3f978e474803cbbc5fe805ad30e293

Author: Andreas Schwab <[email protected]>
Date:   Thu Mar 23 16:46:20 2023 +0100

dlopen: skip debugger notification for DSO loaded from sprof (bug 30258)

Avoid inconsistent state in the debugger interface.

Thanks,
Florian

#3 lore raw

Hello Florian,
Am Sun, Nov 17, 2024 at 11:50:18PM +0100 schrieb Florian Weimer:

Quoted 17 lines

* Alejandro Colomar:

Quoted 5 lines

Hi Helge,

Quoted 2 lines · Helge Kreutzmann

Without further ado, the following was found:

Quoted 7 lines
Quoted 1 line

Issue: Inconsistency detected by ld.so: dl-open.c: 930: _dl_open: Assertion `_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT' failed!

IIUC, this report is that running the example shell session resulted in that problem. I've CCed glibc in case they can help.

It would be interesting to know if this can be reproduced, and a full reproducer.

Hasn't this been fixed in glibc 2.38? Via:

Quoted 7 lines

commit ab5aa2ee3d3f978e474803cbbc5fe805ad30e293

Author: Andreas Schwab <[email protected]>
Date:   Thu Mar 23 16:46:20 2023 +0100

dlopen: skip debugger notification for DSO loaded from sprof (bug 30258)

Avoid inconsistent state in the debugger interface.

Apologies that I missed that question.

In Debian stable (Trixie), glibc 2.41-12+deb13u1, this error is no longer present.

I can run all commands of sprof(1), however none produces any content, i.e. something beyond the header lines. As I'm not a programmer, I don't know if this is something to worry about.

helge@twentytwo:/tmp$ sprof -p libdemo.so.1 $LD_PROFILE_OUTPUT/libdemo.so.1.profile
Flat profile:

Each sample counts as 0,01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name

And no, I don't expect any of the output to be translated, I was just curious to try this out.

If you need any further input from my side, please let me know, otherwise I'm fine as well.

Greetings

Helge

Signature · 4 lines
      Dr. Helge Kreutzmann                     [email protected]
           Dipl.-Phys.                   http://www.helgefjell.de/debian.php
        64bit GNU powered                     gpg signed mail preferred
           Help keep free software "libre": http://www.ffii.de/
#4 lore raw

* Helge Kreutzmann:

Quoted 23 lines

Hello Florian,
Am Sun, Nov 17, 2024 at 11:50:18PM +0100 schrieb Florian Weimer:

Quoted 21 lines

* Alejandro Colomar:

Quoted 5 lines

Hi Helge,

Quoted 2 lines · Helge Kreutzmann

Without further ado, the following was found:

Quoted 7 lines
Quoted 1 line

Issue: Inconsistency detected by ld.so: dl-open.c: 930: _dl_open: Assertion `_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT' failed!

IIUC, this report is that running the example shell session resulted in that problem. I've CCed glibc in case they can help.

It would be interesting to know if this can be reproduced, and a full reproducer.

Hasn't this been fixed in glibc 2.38? Via:

commit ab5aa2ee3d3f978e474803cbbc5fe805ad30e293

Author: Andreas Schwab <[email protected]>
Date:   Thu Mar 23 16:46:20 2023 +0100
Quoted 8 lines
Quoted 3 lines

dlopen: skip debugger notification for DSO loaded from sprof (bug 30258)

Avoid inconsistent state in the debugger interface.

Apologies that I missed that question.

In Debian stable (Trixie), glibc 2.41-12+deb13u1, this error is no longer present.

I think we should then assume that your issue was bug 30258.

Quoted 10 lines

I can run all commands of sprof(1), however none produces any content, i.e. something beyond the header lines. As I'm not a programmer, I don't know if this is something to worry about.

helge@twentytwo:/tmp$ sprof -p libdemo.so.1 $LD_PROFILE_OUTPUT/libdemo.so.1.profile
Flat profile:

Each sample counts as 0,01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name

Is it possible that no profiling events have been recorded? How do you call functions in libdemo.so.1?

Thanks,
Florian

#5 lore raw

Hello Florian,

Quoted 10 lines · Florian Weimer
Quoted 10 lines

Am Sun, Nov 17, 2024 at 11:50:18PM +0100 schrieb Florian Weimer:

Quoted 1 line

* Alejandro Colomar:

I can run all commands of sprof(1), however none produces any content, i.e. something beyond the header lines. As I'm not a programmer, I don't know if this is something to worry about.

helge@twentytwo:/tmp$ sprof -p libdemo.so.1 $LD_PROFILE_OUTPUT/libdemo.so.1.profile
Flat profile:
Quoted 6 lines
Quoted 3 lines

Each sample counts as 0,01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name

Is it possible that no profiling events have been recorded? How do you call functions in libdemo.so.1?

I simply copied the instructions in the man page one by one and observed the output, without really understanding what I'm doing. So yes, the problem may be perfectly on my side, that I should have generated some events.

But since I'm not a programmer but a translator, I don't think this is worth further investigating.

Greetings

Helge

Signature · 4 lines
      Dr. Helge Kreutzmann                     [email protected]
           Dipl.-Phys.                   http://www.helgefjell.de/debian.php
        64bit GNU powered                     gpg signed mail preferred
           Help keep free software "libre": http://www.ffii.de/
#6 lore raw

* Helge Kreutzmann:

Quoted 16 lines

Hello Florian,

Quoted 14 lines · Florian Weimer
Quoted 13 lines

Am Sun, Nov 17, 2024 at 11:50:18PM +0100 schrieb Florian Weimer:

Quoted 1 line

* Alejandro Colomar:

I can run all commands of sprof(1), however none produces any content, i.e. something beyond the header lines. As I'm not a programmer, I don't know if this is something to worry about.

helge@twentytwo:/tmp$ sprof -p libdemo.so.1 $LD_PROFILE_OUTPUT/libdemo.so.1.profile
Flat profile:

Each sample counts as 0,01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name

Quoted 7 lines
Quoted 2 lines

Is it possible that no profiling events have been recorded? How do you call functions in libdemo.so.1?

I simply copied the instructions in the man page one by one and observed the output, without really understanding what I'm doing. So yes, the problem may be perfectly on my side, that I should have generated some events.

The instructions work for me on Fedora 43. It's possible that they depend on compiler/linker default settings not being overriden by the distribution. Fedora only changes fewer upstream defaults than other distributions.

Thanks,
Florian

#7 lore raw
In reply to Helge Kreutzmann
Quoted 3 lines · Helge Kreutzmann

Without further ado, the following was found:

Issue: Inconsistency detected by ld.so: dl-open.c: 930: _dl_open: Assertion `_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT' failed!

This is no translation for this assertion failure.

We don't ask glibc translators, via the Translation Project
(https://translationproject.org/html/welcome.html), to translate the above text.

This is early in the startup of ld.so and we cannot translate this error message because the infrastructure to do the translation is not usable yet i.e. elf/dl-minimal.c:__assert_fail.

Once ld.so is fully relocated and setup we can start translating error messages.

I don't see the above message in any of the man pages text?

Quoted 10 lines

"$ B<sprof -p libdemo.so.1 $LD_PROFILE_OUTPUT/libdemo.so.1.profile>\n" "Flat profile:\n"
"\\&\n"
"Each sample counts as 0.01 seconds.\n"
" % cumulative self self total\n"

" time   seconds   seconds    calls  us/call  us/call  name\n"
" 60.00      0.06     0.06      100   600.00           consumeCpu1\n"
" 40.00      0.10     0.04     1000    40.00           consumeCpu2\n"
"  0.00      0.10     0.00        1     0.00           x1\n"
"  0.00      0.10     0.00        1     0.00           x2\n"

This has no translation today.

This *could* be translated in glibc, but we haven't marked it as translatable.

I expect the reason is that we align the columns precisely on the given English ascii text in order to produce a nice table, but with a translation that would need to be adjusted per translated label.

Thus for now this isn't being translated, and to translate it would require an RFE to rewrite elf/sprof.c in generate_flat_profile and generate_call_graph to handle the translated column width correctly.

Signature · 2 lines
Cheers,
Carlos.
#8 lore raw

Hello Carlos,
Am Tue, Nov 19, 2024 at 08:29:34AM -0500 schrieb Carlos O'Donell:

Quoted 6 lines · Helge Kreutzmann
Quoted 3 lines

Without further ado, the following was found:

Issue: Inconsistency detected by ld.so: dl-open.c: 930: _dl_open: Assertion `_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT' failed!

This is no translation for this assertion failure.

Sorry for beeing unclear. This is not about translating the string. One of our translators tried out the example given in sprof(1) and came across this message.

So the question is:
Is the example correct, despite the failure?

And if yes, maybe this failure should be mentioned in the man page.

As a side note:
We translators regularly check if messages are translated or not, so in this case we would *not* translate the output ourselves, but leave it in English, of course.

Greetings

Helge

Signature · 4 lines
      Dr. Helge Kreutzmann                     [email protected]
           Dipl.-Phys.                   http://www.helgefjell.de/debian.php
        64bit GNU powered                     gpg signed mail preferred
           Help keep free software "libre": http://www.ffii.de/
#9 lore raw
Quoted 9 lines · Helge Kreutzmann

Hello Carlos,
Am Tue, Nov 19, 2024 at 08:29:34AM -0500 schrieb Carlos O'Donell:

Quoted 7 lines · Helge Kreutzmann
Quoted 5 lines

Without further ado, the following was found:

Issue: Inconsistency detected by ld.so: dl-open.c: 930:
_dl_open: Assertion `_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT' failed!

Quoted 8 lines
Quoted 1 line

This is no translation for this assertion failure.

Sorry for beeing unclear. This is not about translating the string. One of our translators tried out the example given in sprof(1) and came across this message.

So the question is:
Is the example correct, despite the failure?

The example looks correct to me.

We have glibc/elf/tst-sprof-basic.sh to verify basic operation of sprof (though we test it wrapped using the newly built ld.so, so we might improve this with a containerized test).

It doesn't fail for me on a glibc-2.39 test system I have right now, but I haven't verified the data is correct either.

If this is failing for you please submit a bug upstream to glibc and we'll review.

Quoted 1 line

And if yes, maybe this failure should be mentioned in the man page.

We shouldn't document every bug in the man-pages.

We should verify the examples keep working though.

Quoted 4 lines

As a side note:
We translators regularly check if messages are translated or not, so in this case we would *not* translate the output ourselves, but leave it in English, of course.

Thank you!

Signature · 2 lines
Cheers,
Carlos.