Bug 380763

Summary: plots not working on Ubuntu 10.04 / R 2.15.1
Product: [Applications] rkward Reporter: RKWard Team <rkward-devel>
Component: generalAssignee: RKWard Team <rkward-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description RKWard Team 2013-07-15 16:23:32 UTC
-- Originally posted by (AT sourceforge.net): rtautenh --

-- This ticket was imported from http://sourceforge.net/p/rkward/bugs/129 on 2017-05-30 15:26:51 +0100 --
plots do not work any more for me in rkward on Ubuntu 10.04.4

e.g. an initial plot(1,1) creates the window and the grid, but does not show the dot.

any plot command after that only creates an empty window but does not show anything.



---Session Info---
-- Frontend --
RKWard version: 0.6.1z+0.6.2+devel1
KDE version (runtime): 4.4.92 (KDE 4.4.92 (KDE 4.5 RC2))
KDE version (compile time): 4.4.92 (KDE 4.4.92 (KDE 4.5 RC2))
Qt build key: x86_64 linux g++-4 full-config

Backend version (as known to the frontend): 2.15.1

Debug message file (this may contain relevant diagnostic output in case of trouble):
/tmp/rkward.frontend.nS3063

-- Backend --
Debug message file (this may contain relevant diagnostic output in case of trouble):
/tmp/rkward.rbackend.TJ3081

R version (compile time): 2.15.1  (2012-06-22 r59600)
R runtime session info:
R version 2.15.1 (2012-06-22)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                  LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8        LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8      
 [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8           LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8      LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rkward_0.6.1

loaded via a namespace (and not attached):
[1] tools_2.15.1
Comment 1 Thomas Friedrichsmeier 2013-07-16 07:15:03 UTC
Hi Ralf!

(I tried to follow-up by mail, but this did not seem to work. If a double-post appears, you'll know, what happened.)

Is this on the most recent svn revision (svn info)? Compiled from source? I 
know some revisions had similar problems, but I am not aware of a current 
problem. My testing is mostly with R 3.0.x and KDE >= 4.9, though.

Please try this:
- RMB click on one of the tool bars (e.g. the right hand one), check the 
"RKWard Debug Messages" window. Activate it.
- Run some simple plot commands in the console until the problem appears. Copy 
any output from the RKWard Debug Messages window.
- Change Configure RKWard->Debug->Debug level to "4", and repeat.

Also:
- What happens, if you follow up plot(1,1) with 
a) title("test")
b) locator(1)

Most likely you can work around this problem by changing the device settings 
at Configure RKWard->Onscreen Graphics, but of course it would be best, if we can track this down.

Regards
Thomas
Comment 2 Thomas Friedrichsmeier 2013-07-16 07:30:31 UTC
Hi Ralf,

On Monday 15 July 2013 17:23:33 Ralf  Tautenhahn wrote:
> plots do not work any more for me in rkward on Ubuntu 10.04.4
> 
> e.g. an initial plot(1,1) creates the window and the grid, but does not show
> the dot.
> 
> any plot command after that only creates an empty window but does not show
> anything.

is this on the most recent svn revision (svn info)? Compiled from source? I 
know some revisions had similar problems, but I am not aware of a current 
problem. My testing is mostly with R 3.0.x and KDE >= 4.9, though.

Please try this:
- RMB click on one of the tool bars (e.g. the right hand one), check the 
"RKWard Debug Messages" window. Activate it.
- Run some simple plot commands in the console until the problem appears. Copy 
any output from the Debug Messages window.
- Change Configure RKWard->Debug->Debug level to "4", and repeat.

Also:
- What happens, if you follow up plot(1,1) with 
a) title("test")
b) locator(1)

Most likely you can work around this problem by changing the device settings 
at Configure RKWard->Onscreen Graphics, but of course it would be nice to 
track this down.

Regards
Thomas
Comment 3 RKWard Team 2013-07-16 15:52:12 UTC
-- Originally posted by (AT sourceforge.net): rtautenh --
Hi Thomas,

yes, I compiled the most recent version from source.

URL: svn://svn.code.sf.net/p/rkward/code/trunk/rkward
Repository Root: svn://svn.code.sf.net/p/rkward/code
Repository UUID: 7936002b-cd1d-0410-9ce3-d7ebf93b5162
Revision: 4759
Node Kind: directory
Schedule: normal
Last Changed Author: m-eik
Last Changed Rev: 4759
Last Changed Date: 2013-07-05 07:14:16 -0700 (Fri, 05 Jul 2013)


There are no debugging message with debug level 2.

With debug level 4 I get:
DEBUG	running command: plot(1,1)

DEBUG	Transmitting request of length 52
DEBUG	Transmitting request of length 42
DEBUG	Received transmission of type 7, devnum 2, size 6
DEBUG	Received transmission of type 11, devnum 2, size 34
DEBUG	Received transmission of type 11, devnum 2, size 34
DEBUG	Received transmission of type 1, devnum 2, size 46
DEBUG	Received transmission of type 11, devnum 2, size 34
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 18, devnum 2, size 55
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 2, devnum 2, size 60
DEBUG	Received transmission of type 18, devnum 2, size 55
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 18, devnum 2, size 59
DEBUG	Received transmission of type 6, devnum 2, size 95
DEBUG	Received transmission of type 4, devnum 2, size 112
DEBUG	Received transmission of type 11, devnum 2, size 34
DEBUG	Received transmission of type 18, devnum 2, size 55
DEBUG	Received transmission of type 6, devnum 2, size 91
DEBUG	Received transmission of type 18, devnum 2, size 55
DEBUG	Transmitting request of length 42
DEBUG	Received transmission of type 6, devnum 2, size 91

DEBUG	running command: locator(1)

DEBUG	Transmitting request of length 54
DEBUG	Transmitting request of length 42
DEBUG	Received transmission of type 20, devnum 2, size 2

- I changed setting to Embed Original Device and No Integration. That did not work.

- However, changing it to Platform default device does work.


Kind Regards,
Ralf

PS: Maybe I should upgrade to R3.0.1 ...
Comment 4 Thomas Friedrichsmeier 2013-07-16 17:04:28 UTC
Hi!

Thanks for your testing so far. What happened (with the "RKWard native" / RK() device), when running locator(1) after plot(1,1)? Did this cause the plot to appear?

Could you try the following small modification in the sources?
- edit rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
- add '//' (comment mark) at the start of lines 27 (#ifdef Q_WS_MAC) and 33 (#endif). (Or remove these two lines).
- recompile
- try again (making sure you really test the "RKWard native" / RK() device, of course)

Thanks!
Comment 5 RKWard Team 2013-07-16 17:13:26 UTC
-- Originally posted by (AT sourceforge.net): rtautenh --
Hi Thomas,

using locator(1) after plot(1,1) makes no difference. The plot does not show up (but I do see the location on the console).

when I comment out lines 27 and 33 in rkgraphicsdevice.h and try to compile I get this error (but it compiles fine when I put them back in):

[ 78%] Built target rkward.rbackend
/vol/R/rkward/trunk-new/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp: In member function ‘void RKGraphicsDevice::clear(const QColor&)’:
/vol/R/rkward/trunk-new/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp:126: error: no matching function for call to ‘QImage::fill(const QColor&)’
/usr/include/qt4/QtGui/qimage.h:212: note: candidates are: void QImage::fill(uint)
/vol/R/rkward/trunk-new/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp:127: error: no matching function for call to ‘QImage::fill(QColor)’
/usr/include/qt4/QtGui/qimage.h:212: note: candidates are: void QImage::fill(uint)
make[2]: *** [rkward/rbackend/rkwarddevice/CMakeFiles/rkgraphicsdevice.frontend.dir/rkgraphicsdevice.o] Error 1


Thanks!
Ralf
Comment 6 Thomas Friedrichsmeier 2013-07-16 17:36:40 UTC
> when I comment out lines 27 and 33 in rkgraphicsdevice.h and try to compile I get this error (but it compiles fine when I put them back in):

Ok, comment out the lines again, then replace the offending lines 126 and 127 in rkgraphicsdevice.cpp with

	if (col.isValid ()) area.fill (col.rgb());
	else area.fill (qRgb (255, 255, 255));

then try once more.

Thanks!
Thomas
Comment 7 RKWard Team 2013-07-16 21:36:34 UTC
-- Originally posted by (AT sourceforge.net): rtautenh --
Hi Thomas,

perfect! rkward's native device now works with this patch!

Thanks,
Ralf
Comment 8 Thomas Friedrichsmeier 2013-07-17 08:42:18 UTC
Hi!

> perfect! rkward's native device now works with this patch!

Glad to hear that. That leaves the bug (in the unpatched version) somewhere between Qt and the X server. Could you provide version numbers for these two for future reference?

(Background: This patch causes all rendering to be done inside the rkward process, rather than in the X-server (which might utilize hardware acceleration). My impression - and rudimentary timing - is that this does not make _too_ much of a difference for R plots, and so I guess I'll simply enable it for all X11-compiles for now. However, in case we run into performance problems at some point of time, it will be useful to know better, when using the X server for rendering is reliable, and when it is not.)

Regards
Thomas
Comment 9 RKWard Team 2013-07-17 16:48:05 UTC
-- Originally posted by (AT sourceforge.net): rtautenh --
libqt is 4:4.7.0~beta2
libx11 is 2:1.3.2
xserver-xorg is 1:7.5

Thanks again for fixing!
Ralf
Comment 10 RKWard Team 2013-08-17 13:24:47 UTC
-- Originally posted by (AT sourceforge.net): ziogelis77 --
I wonder if I perhaps have the same bug: if I run hist(x), only an empty device appears. but if I resize the window just a bit, the plot does appear. If after that I run hist(y) (or any other plot command), the new plot does not get displayed till I resize the window again. I am using Version 0.6.1
on KDE 4.10.5, Kubuntu 13.04, from the repository 
deb http://ppa.launchpad.net/rkward-devel/rkward-stable/ubuntu raring main

Please advise me if I should open another bug or just wait for this fix to reach the repos.
Comment 11 Thomas Friedrichsmeier 2013-08-18 05:47:19 UTC
Hi Donatas!

This is almost definitely a different bug. Ralf was having trouble with the RK()-device, which is a new feature introduced after 0.6.1 (only in development versions, so far).

> Please advise me if I should open another bug or just wait for this fix to reach the repos.

Go ahead, and open a new report. If you have any idea, when the problem has started, please include that bit of info. However, I'll be very short on time the upcoming weeks, so I won't promise anything.

You may want to give the current development snapshot a try (https://launchpad.net/~rkward-devel/+archive/rkward-dailys), where the RK()-device is the default device, already.

Regards
Thomas
Comment 12 Thomas Friedrichsmeier 2015-12-31 21:18:26 UTC
- **status**: open --> closed-fixed
Comment 13 Thomas Friedrichsmeier 2015-12-31 21:18:26 UTC
Original issue fixed, long ago. Secondary issue as reported by Donatas not reproduced, since. Closing.

Donatas: Do let us know, if the issue still persists.