> > Ok, I tested printing, yes it remains zombie too .
>
>       What is the parent process of the zombie?
>
>       In unix zombies exist because the parent isn't getting the exit
>       code back from the child process. I believe windows works the same way.
>       The bug is almost always in the parent process that started the zombie.
>
>       Do we know what code invokes the device.exe process, and if that code is
>       in FLTK, can someone point me at it? I'm usually pretty good at 
> recognizing
>       problems with process creation/reaping.


Greg:

One problem is to reproduce the zombie. To my understanding, only
Domingo ever saw one.

Device.exe is the name of the FLTK program itself.

This short code is supposed to create the zombie process.
With -DMINIMAL it gives an even shorter zombie-causing thing.
It also seems that the Fl_Clock object is necessary for
the zombie to appear, and that commenting out this statement
  pd.hwndOwner = GetForegroundWindow();
makes the zombie disappear.


#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Clock.H>
#include <FL/Fl_Printer.H>
#include <windows.h>

static void cb_Print(Fl_Button*b, void*) {
#ifdef MINIMAL
  DWORD       commdlgerr;
  DOCINFO     di;
  PRINTDLG      pd;
  memset (&pd, 0, sizeof (PRINTDLG));
  pd.lStructSize = sizeof (PRINTDLG);
  pd.hwndOwner = GetForegroundWindow();
  pd.Flags = PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE | PD_NOSELECTION;
  pd.nMinPage = 1;
  pd.nMaxPage = 5;
  PrintDlg (&pd);
#else
  Fl_Printer printer;
  if (printer.start_job(1)) return;
  if (printer.start_page())return;
  printer.print_widget(b->window());
  printer.end_page();
  printer.end_job();
#endif
}

int main(int argc, char **argv) {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(174, 210);
    w = o;
    { Fl_Button* o = new Fl_Button(25, 25, 115, 25, "Print Dialog");
      o->labelsize(18);
      o->callback((Fl_Callback*)cb_Print);
    } // Fl_Button* o
    { Fl_Clock* o = new Fl_Clock(25, 75, 115, 115);
      o->labelsize(18);
    } // Fl_Clock* o
    o->end();
  } // Fl_Double_Window* o
  w->show(argc, argv);
  return Fl::run();
}

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to