This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

wprintf segmentation fault.


I am getting a segementation fault on wprintf. Here is the code and the 
build command I am using. Is there something wrong in the way I am building, 
or is it wrong usage?

#include <wchar.h>
#include <stdio.h>

int main()
{
    wprintf( L"Hello World" );
    return 0;
}

The build command is g++ -g -D_GNU_SOURCE test1.cpp.

Here is the error log.
GNU gdb Red Hat Linux 7.x (5.0rh-15) (MI_OUT)
This GDB was configured as "i386-redhat-linux".
(gdb) file a.out
Reading symbols from a.out...done.
(gdb) run
Starting program: /home/user1/tests/a.out

Program received signal SIGSEGV, Segmentation fault.
_IO_fwide (fp=0x4006c680, mode=1) at iofwide.c:124
124     iofwide.c: No such file or directory.
        in iofwide.c
Current language:  auto; currently c
(gdb) backtrace
#0  _IO_fwide (fp=0x4006c680, mode=1) at iofwide.c:124
#1  0x400ff15c in _IO_vfwprintf (s=0x4006c680, format=0x8048620, 
ap=0xbffff804) at vfprintf.c:1251
#2  0x4010cadc in wprintf (format=0x8048620) at wprintf.c:32
#3  0x08048593 in main () at test1.cpp:6
#4  0x400b4507 in __libc_start_main (main=0x8048580 <main>, argc=1, 
ubp_av=0xbffff884, init=0x80483fc <_init>, fini=0x80485e0 <_fini>,
    rtld_fini=0x4000dc14 <_dl_fini>, stack_end=0xbffff87c) at 
../sysdeps/generic/libc-start.c:129


Thanks,

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]