Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#9658 - Segfault when try to pacman -Suy

Attached to Project: Pacman
Opened by Marcin Lubojański (marceli) - Saturday, 23 February 2008, 17:45 GMT
Last edited by Xavier (shining) - Tuesday, 26 February 2008, 12:02 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Xavier (shining)
Dan McGee (toofishes)
Architecture All
Severity High
Priority Normal
Reported Version 3.1.2
Due in Version 3.1.3
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When I try to update system I got segfault on "pacman -Suy"

Additional info:
* package version(s)
Pacman v3.1.2 - libalpm v2.2.0


Steps to reproduce:
run "pacman -Suv"
answer Yes on question if replace mktemp by core/coreutils

Here's my pacman -Suv --debug output:
(attached)
   debug.log (38.8 KiB)
This task depends upon

Closed by  Xavier (shining)
Tuesday, 26 February 2008, 12:02 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed by commit 66591e8284054
Comment by Marcin Lubojański (marceli) - Sunday, 24 February 2008, 12:07 GMT
I've attached strace output
Comment by Xavier (shining) - Sunday, 24 February 2008, 22:01 GMT
Can you edit your original post? It would be nicer to have the debug log as a separate attachment instead of pasted directly.

Otherwise, it's hard for us to reproduce this (but thanks for providing all these informations already).
Could you try to get a gdb backtrace too? it would be very helpful.
You can just use the attached pacman.static (which has debug symbols), then just run: gdb pacman.static
In gdb prompt :
1) run -Su
Then it should segfault.
2) bt full
That prints the full backtrace, which you can then attach here.
Comment by Nagy Gabor (combo) - Monday, 25 February 2008, 17:42 GMT
There is a bug in polish translation:
-------------------------------------------
155 #: lib/libalpm/deps.c:171
156 msgid "dependency cycle detected:\n"
157 msgstr "wykryto cykl zależności: %s\n"
-------------------------------------------
Comment by Xavier (shining) - Monday, 25 February 2008, 18:02 GMT
omg. I made exactly the same error with french translation back then :
http://projects.archlinux.org/git/?p=pacman.git;a=commitdiff;h=630541a72e2ca041d2fb4401b374670134b12c3d

And I didn't even think about that! Thanks Nagy, good catch.

I just found out something I didn't understand earlier. Sometimes gettext complains when the %s don't match, and in this case, it didn't.
That's because c-format is missing for that string!
And it's probably missing because the msgid doesn't contain any %s anymore.
However, aren't all these translated strings in c format? Is there any way we could enforce that setting?

That mistake is so stupid, and easy to make. And it's also quite bad, all polish users (with a localized system) will get a segfault when trying to install packages :(
If we could find a way there are no other strings like that, I think we shouldn't wait too much for a 3.1.3 :P
Well the workaround is easy (LANG=C pacman ...), but still..
Comment by Xavier (shining) - Monday, 25 February 2008, 18:31 GMT
After a quick google, I felt on this :
http://www.gnu.org/software/gettext/manual/html_node/c_002dformat-Flag.html

The first informations from this :
1) It's possible to force a string to be in c-format like this :
+ /* xgettext:c-format */
_alpm_log(PM_LOG_WARNING, _("dependency cycle detected:\n"));

2)
"This situation happens quite often. The printf function is often called with strings which do not contain a format specifier. Of course one would normally use fputs but it does happen. In this case xgettext does not recognize this as a format string but what happens if the translation introduces a valid format specifier? The printf function will try to access one of the parameters but none exists because the original code does not pass any parameters."

Hmm not sure we could use fputs with all the alpm_log / callback stuff.

3) From there :
http://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html#xgettext-Invocation

"For example, if you use the ‘_’ shortcut for the gettext function, you should use --flag=_:1:pass-c-format. The effect of this specification is that xgettext will propagate a format string requirement for a _("string") call to its first argument, the literal "string", and thus mark it as a format string."

We already have this option in Makevars. It doesn't seem to work though :/ It looks like it's still xgettext heuristic which is used to detect format string.

Loading...