Bug 149066 - print/gv: Segmentation fault when using "Print Marked" button
Summary: print/gv: Segmentation fault when using "Print Marked" button
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Brendan Fabeny
Depends on:
Reported: 2010-07-29 14:00 UTC by Thomas Mueller
Modified: 2010-08-08 23:10 UTC (History)
0 users

See Also:

file.diff (617 bytes, patch)
2010-07-29 14:00 UTC, Thomas Mueller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Mueller 2010-07-29 14:00:13 UTC
Using the "Print Marked" button produces the a core dump
on my system.

(gdb) run Assigned.ps
Starting program: /tmp/gv Assigned.ps

Program received signal SIGBUS, Bus error.
DialogPopupSetText (s=0x801e7a09c "lpr") at dialog.c:302
302           XtSetArg(args[n], XtNfont, &font);        n++;
(gdb) bt
#0  DialogPopupSetText (s=0x801e7a09c "lpr") at dialog.c:302
#1  0x00000000004149af in cb_print (w=Variable "w" is not available.
) at callbacks.c:636
#2  0x0000000800b27d9f in XtCallCallbackList () from /usr/local/lib/libXt.so.6
#3  0x0000000800b5d616 in HandleActions () from /usr/local/lib/libXt.so.6
#4  0x0000000800b5da23 in HandleSimpleState () from /usr/local/lib/libXt.so.6
#5  0x0000000800b5e0aa in _XtTranslateEvent () from /usr/local/lib/libXt.so.6
#6  0x0000000800b3597a in XtDispatchEventToWidget ()
   from /usr/local/lib/libXt.so.6
#7  0x0000000800b35f96 in _XtDefaultDispatcher ()
   from /usr/local/lib/libXt.so.6
#8  0x0000000800b350b8 in XtDispatchEvent () from /usr/local/lib/libXt.so.6
#9  0x0000000800b35243 in XtAppMainLoop () from /usr/local/lib/libXt.so.6
#10 0x000000000041ad24 in main (argc=2, argv=Variable "argv" is not available.
) at main.c:1349
(gdb) p n
$1 = 4403287

Variable 'n' is used uninitialized in dialog.c:DialogPopupSetText():

gmake[2]: Entering directory `/usr/ports/print/gv/work/gv-3.6.9/src'
cc -DHAVE_CONFIG_H -I.  -DNON_BLOCKING_IO -DGV_CODE -DGV_LIBDIR=\"/usr/local/share/gv\" -I../lib -I../lib -g -I/usr/local/include -DUSE_SETENV_CODE -I/usr/local/include  -O2 -g -Wall -pipe -fno-strict-aliasing -MT dialog.o -MD -MP -MF .deps/dialog.Tpo -c -o dialog.o dialog.c
dialog.c: In function 'DialogPopupSetText':
dialog.c:302: warning: 'n' is used uninitialized in this function

Fix: [root@tom /usr/ports/print/gv]# diff -up work/gv-3.6.9/src/dialog.c.ORG   work/gv-3.6.9/src/dialog.c 
How-To-Repeat: Display a PostScript file, mark some pages, press the "Print Marked" button.
Comment 1 Edwin Groothuis freebsd_committer 2010-07-29 14:00:24 UTC
Responsible Changed
From-To: freebsd-ports-bugs->bf

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2010-08-06 19:07:41 UTC
bf          2010-08-06 18:07:27 UTC

  FreeBSD ports repository

  Modified files:
    print/gv             Makefile distinfo 
  Added files:
    print/gv/files       patch-src_dialog.c 
  -update to 3.7.1
  -fix a segfault that may occur when printing [1]
  PR:             149066
  Submitted by:   Thomas Mueller <tmueller@sysgo.com> [1]
  Approved by:    makc
  Revision  Changes    Path
  1.69      +14 -9     ports/print/gv/Makefile
  1.23      +3 -3      ports/print/gv/distinfo
  1.1       +13 -0     ports/print/gv/files/patch-src_dialog.c (new)
cvs-all@freebsd.org mailing list
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Brendan Fabeny freebsd_committer 2010-08-08 23:10:09 UTC
State Changed
From-To: open->closed

Committed. Thanks!