Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 229101 - Dia crashes when given a bogus print command
Summary: Dia crashes when given a bogus print command
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dia
Version: rawhide
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Hans de Goede
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-17 01:36 UTC by Jonathan Corbet
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-02-21 12:11:33 UTC


Attachments (Terms of Use)

Description Jonathan Corbet 2007-02-17 01:36:04 UTC
Description of problem:

The "print" operation in dia pops up a "select printer" dialog.  That dialog,
however, does not want a printer; it wants a print command.  If you type a
printer name, dia immediately crashes.  It prints shell complaints; I assume it
is getting (and not handling) a SIGPIPE.

Version-Release number of selected component (if applicable):
dia-0.95-7.fc6

How reproducible:
Completely

Steps to Reproduce:
1. Start dia
2. Select print
3. Type something random in the text box next to "printer"
4. Tell it to do it
  
Actual results:

Dies after printing:

Traceback (most recent call last):
  File "/usr/share/dia/python-startup.py", line 1, in ?
    import sys, os
ImportError: No module named os
Print dialog?
sh: officejet: command not found



Expected results:
  Beautiful printed versions of my most artistic drawings.  No crash would also
be really nice.

Additional info:

Comment 1 Hans de Goede 2007-02-21 12:11:33 UTC
Hi Jonathan,

Great article on who wrote 2.6.20, when I have discussions on why I don't use
Ubuntu I always say that I find that Ubuntu contributes little to upstream
projects, no I have some "hard" numbers to back that up :)

Anyways back on topic. I've been debugging this a bit and the problem indeed is
sigpipe, the dia code already catches this, but with plain signal(). Since dia's
./configure adds -ansi to the CFLAGS signal installs a oneshot handler (bsd
behavior instead of sysv behavior). I've written a patch changing the code to
use sigaction, which is more predictable in what it does. This fixes the problem
you describe.

That still leaves the fact that its a pretty worthless printing interface, dia
also has experimental gnomeprint support. When sending my patch upstream I'll
ask what the status of that support is.

I've just send dia-0.95-8 to the buildsys with this fixed, it should show up on
a mirror near you soon.



Note You need to log in before you can comment on or make changes to this bug.