Bug 229101 - Dia crashes when given a bogus print command
Dia crashes when given a bogus print command
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: dia (Show other bugs)
rawhide
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-16 20:36 EST by Jonathan Corbet
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-21 07:11:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Corbet 2007-02-16 20:36:04 EST
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 07:11:33 EST
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.