public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/94222] New: Architecture dependent problem with vsnprintf
@ 2020-03-19  9:44 JaFojtik at seznam dot cz
  2020-03-19  9:50 ` [Bug c/94222] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: JaFojtik at seznam dot cz @ 2020-03-19  9:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94222

            Bug ID: 94222
           Summary: Architecture dependent problem with vsnprintf
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: JaFojtik at seznam dot cz
  Target Milestone: ---

Created attachment 48062
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48062&action=edit
Minimal testcase that demonstrates a vsnprintf problem.

The critical bug in gcc breaks compilation WP2LaTeX on several platforms:
https://buildd.debian.org/status/package.php?p=wp2latex&suite=sid
Affected platforms are  amd64, s390x,  kfreebsd-amd64, powerpc, x32. All other
platforms seems not to be affected with this defect.

I have prepared minimal testcase that demonstrates a problem.


Buildd exposure stats all  ˇ    3.88-2  Build-Attempted 1d 11h  x86-csail-02   
out-of-date     misc    old | all (1)
Buildd exposure stats amd64  ˇ  3.88-2  Build-Attempted 1d 11h 4m      
x86-csail-01    out-of-date     misc    old | all (1)
Buildd exposure stats arm64     3.88-2  Installed       1d 10h 39m     
arm-arm-03              misc    old | all (1)
Buildd exposure stats armel     3.88-2  Installed       1d 10h 39m      hasse  
        misc    old | all (1)
Buildd exposure stats armhf     3.88-2  Installed       1d 10h 39m      hoiby  
        misc    old | all (1)
Buildd exposure stats i386      3.88-2  Installed       1d 10h 39m     
x86-ubc-02              misc    old | all (1)
Buildd exposure stats mips64el  3.88-2  Installed       1d 10h 9m      
mipsel-sil-01           misc    old | all (1)
Buildd exposure stats mipsel    3.88-2  Installed       1d 9h 8m        eberlin
        misc    old | all (1)
Buildd exposure stats ppc64el   3.88-2  Installed       1d 10h 39m     
ppc64el-unicamp-01              misc    old | all (1)
Buildd exposure stats s390x  ˇ  3.88-2  Build-Attempted 1d 11h 6m      
zandonai        out-of-date     misc    old | all (1)
Buildd exposure stats alpha     3.88-2  Needs-Build     45d 8h 41m             
uncompiled      misc    old | no log
Buildd exposure stats hppa      3.88-2  Installed       1d 8h 11m       mx3210 
        misc    old | all (1)
Buildd exposure stats hurd-i386         3.88-2  Installed       1d 10h 31m     
ironforge               misc    old | all (1)
Buildd exposure stats ia64      3.88-2  Installed       1d 10h 31m     
titanium                misc    old | all (1)
Buildd exposure stats kfreebsd-amd64  ˇ 3.88-2  Build-Attempted 1d 10h 55m     
kamp    out-of-date     misc    old | all (1)
Buildd exposure stats kfreebsd-i386     3.88-2  Installed       1d 10h 31m     
kamp            misc    old | all (1)
Buildd exposure stats m68k      3.88-2  Installed       1d 10h 31m     
m68k-gandi-02           misc    old | all (1)
Buildd exposure stats powerpc  ˇ        3.88-2  Build-Attempted 1d 10h 59m     
blaauw2 out-of-date     misc    old | all (1)
Buildd exposure stats ppc64     3.88-2  Installed       1d 10h 41m     
kapitsa2                misc    old | all (1)
Buildd exposure stats riscv64   3.88-2  Installed       1d 10h 1m      
rv-aurel32-02           misc    old | all (1)
Buildd exposure stats sh4       3.88-2  Installed       1d 10h 11m     
sh4-do-01               misc    old | all (1)
Buildd exposure stats sparc64   3.88-2  Installed       1d 10h 41m      landau4
        misc    old | all (1)
Buildd exposure stats x32  ˇ    3.88-2  Build-Attempted 1d 10h 58m     
x32-do-02       out-of-date     misc    old | all (1)

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

* [Bug c/94222] Architecture dependent problem with vsnprintf
  2020-03-19  9:44 [Bug c/94222] New: Architecture dependent problem with vsnprintf JaFojtik at seznam dot cz
@ 2020-03-19  9:50 ` pinskia at gcc dot gnu.org
  2020-03-19 10:09 ` JaFojtik at seznam dot cz
  2020-03-19 17:20 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-03-19  9:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94222

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You need to use va_copy or va_start and va_end again for the second vsnprintf.

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

* [Bug c/94222] Architecture dependent problem with vsnprintf
  2020-03-19  9:44 [Bug c/94222] New: Architecture dependent problem with vsnprintf JaFojtik at seznam dot cz
  2020-03-19  9:50 ` [Bug c/94222] " pinskia at gcc dot gnu.org
@ 2020-03-19 10:09 ` JaFojtik at seznam dot cz
  2020-03-19 17:20 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: JaFojtik at seznam dot cz @ 2020-03-19 10:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94222

--- Comment #2 from Jaroslav Fojtík <JaFojtik at seznam dot cz> ---
Sorry, it worked for many years without any problems. I has been fixed a
problem in my WP2LaTeX now.

https://bitbucket.org/JaFojtik/wp2latex/commits/b337710165faa629cbae4f81f6ed4d79dde5aa3e

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

* [Bug c/94222] Architecture dependent problem with vsnprintf
  2020-03-19  9:44 [Bug c/94222] New: Architecture dependent problem with vsnprintf JaFojtik at seznam dot cz
  2020-03-19  9:50 ` [Bug c/94222] " pinskia at gcc dot gnu.org
  2020-03-19 10:09 ` JaFojtik at seznam dot cz
@ 2020-03-19 17:20 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-03-19 17:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94222

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jaroslav Fojtík from comment #2)
> Sorry, it worked for many years without any problems. I has been fixed a
> problem in my WP2LaTeX now.

Well it depends on the ABI for va_list .  On the targets where it works, it is
just a pointer which is passed via value and does not get changed by the first
vnsprintf.  On targets where it does not work, va_list is an array of size 1 of
a struct; there for is passed via reference really and gets changed by the
first vnsprintf.

That is why it was working before hand but only on accident.  There are many
documentation about this issue for the last 20 years really since va_copy was
added in C99.

https://www.gnu.org/software/libc/manual/html_node/Argument-Macros.html

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

end of thread, other threads:[~2020-03-19 17:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19  9:44 [Bug c/94222] New: Architecture dependent problem with vsnprintf JaFojtik at seznam dot cz
2020-03-19  9:50 ` [Bug c/94222] " pinskia at gcc dot gnu.org
2020-03-19 10:09 ` JaFojtik at seznam dot cz
2020-03-19 17:20 ` pinskia at gcc dot gnu.org

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