Fork Problem



Hi,

I have made a simple window with a button. When button is clicked popup
another window. This win includes a classic text_view. I wanna show in this
text_view a text "piped" from STDERR. For example "gcc -v" puts text in
STDERR. And so I have used:

  gint stderr_pipe;
  gchar **options;

  options [0] = "/usr/bin/gcc";
  options [1] = "-v";
  options [2] = NULL;

  ...other code...

  g_spawn_async_with_pipes (
  	NULL,
	options,
	NULL,
	G_SPAWN_STDOUT_TO_DEV_NULL,
	NULL,
	NULL,
	NULL,
	NULL, //stdin
	NULL, //stdout
	&stderr_pipe, //stderr
	NULL   );

   ...other code...

When I launch it, program crash with a "seg fault". This is strace output:

....
open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 4
fstat64(4, {st_mode=S_IFCHR|0644, st_rdev=makedev(1, 9), ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE, 0xbfffba00) = -1 EINVAL (Invalid argument)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x4085a000
read(4, "\0224\235\177\371,\242\n\26\345(\234\277\277\17Ne\331\346"...,
1024) = 1024
close(4)                                = 0
munmap(0x4085a000, 4096)                = 0
brk(0)                                  = 0x8364000
brk(0x8365000)                          = 0x8365000
open("/etc/gtk-2.0/gtk.immodules", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1981, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x4085a000
read(4, "# GTK+ Input Method Modules file"..., 4096) = 1981
brk(0)                                  = 0x8365000
brk(0x8366000)                          = 0x8366000
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x4085a000, 4096)                = 0
brk(0)                                  = 0x8366000
brk(0x8367000)                          = 0x8367000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

Can you help me?

Thank you very much
Frances


__________________________________________________________________
Tiscali ADSL, fino a 9 MESI GRATIS sull'offerta Tiscali ADSL Light Mega!
Tiscali ADSL non teme confronti! Abbonati subito.
http://point.tiscali.it/adsl/index.shtml






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