[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#796899: Acknowledgement (interesting segfault)



Joey Hess wrote:
> Tried building curl from source to get a useful backtrace, but that
> build didn't have the problem. 
> 
> Since that build was done using gcc 4.9.2-4, it may be another hint in
> the direction of the recent gcc transitions.

Indeed, I built curl with gcc 5.2.1-4 and it has the problem.
So, the gcc upgrade led to this problem.

Here is the backtrace:

joey@kite:~/tmp/curl-7.44.0/debian>LD_LIBRARY_PATH=./build/lib/.libs/ gdb /lib64/ld-linux-x86-64.so.2 
GNU gdb (Debian 7.10-1) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.19.so...done.
done.
(gdb) run ./build/src/.libs/curl
Starting program: /lib64/ld-linux-x86-64.so.2 ./build/src/.libs/curl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
fputc (c=99, fp=0x0) at fputc.c:37
37	fputc.c: No such file or directory.
(gdb) bt
#0  fputc (c=99, fp=0x0) at fputc.c:37
#1  0x00007ffff7b7cd9f in dprintf_formatf (data=<optimized out>, 
    stream=0x7ffff73d7470 <fputc>, format=<optimized out>, 
    ap_save=ap_save@entry=0x7fffffffe060) at mprintf.c:616
#2  0x00007ffff7b7e58e in curl_mfprintf (whereto=<optimized out>, 
    format=<optimized out>) at mprintf.c:1121
#3  0x00007ffff7ddae51 in ?? ()
#4  0x0000000000000000 in ?? ()

The code here is quite horrible, kind of looks like the FILE * has
been somehow optimised out, perhaps wrongly?

static int dprintf_formatf(
  void *data, /* untouched by format(), just sent to the stream() function in
                 the second argument */
  /* function pointer called for each output character */
  int (*stream)(int, FILE *),

        OUTCHAR(*f);

#define OUTCHAR(x) \
  do{ \
    if(stream((unsigned char)(x), (FILE *)data) != -1) \
      done++; \
    else \
     return done; /* return immediately on failure */ \
  } WHILE_FALSE

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature


Reply to: