> sessionInfo()R version 2.8.0 Under development (unstable) (2008-07-07 r46046) i686-pc-linux-gnu locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base x = cbind(a=1:10,b=1:10) View(x) View(x) View(x) View(x) then try to close the latest window by clicking on the "x" (close-window) icon in the corner. I can usually provoke a segmentation fault this way ... Ubuntu Hardy, up to date. [on a related topic, can anyone tell me why View() usually doesn't work when I try it on someone else's Mac? I don't use Macs myself so haven't tried to figure this one out -- I know, I could write to R-SIG-MAC about it ...] Ben Bolker -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20080729/883ecda7/attachment.bin>
Bill Dunlap
2008-Jul-29 19:59 UTC
[Rd] closing View windows after multiple View(x) crashes
On Tue, 29 Jul 2008, Ben Bolker wrote:> > sessionInfo() > R version 2.8.0 Under development (unstable) (2008-07-07 r46046) > i686-pc-linux-gnu > ... > x = cbind(a=1:10,b=1:10) > > View(x) > View(x) > View(x) > View(x) > > then try to close the latest window by clicking on the "x" > (close-window) icon in the corner. > I can usually provoke a segmentation fault this way ... > Ubuntu Hardy, up to date.Does it work any better for you if you edit src/modules/X11/dataentry.c and add a call to Rsync(DE) after the XDestroyWindow(iodisplay, DE->iowindow) in closewin()? I don't get your crash, but I have to click twice on the X button to get the View window to close and valgrind complains about the use of freed memory, DE->prot in the event loop in R_ProcessX11Events() if(ioevent.xclient.message_type == _XA_WM_PROTOCOLS && ioevent.xclient.data.l[0] == DE->prot) { /* user clicked on `close' aka `destroy' */ done = 1; } The trouble seems to be that this code sets done=1, causing the calls closewin(DE); free(DE); but without the Rsync call in closewin(), the window doesn't close immediately and later sends some messages to its event handler, causing the use of the freed DE. (I sometimes use the idiom free(DE);DE=NULL; instead of just free(DE) to make sure no one tries to use DE afterwards, but valgrind does that job better.) When I make closewin() call Rsync(DE) then I only have to click once on the X button to close the View window, the event loop doesn't get reentered, and valgrind seems happy. I'm using R on "Red Hat Enterprise Linux WS release 4 (Nahant Update 3)" with the Cygwin X server on a Windows XP laptop. ---------------------------------------------------------------------------- Bill Dunlap Insightful Corporation bill at insightful dot com "All statements in this message represent the opinions of the author and do not necessarily reflect Insightful Corporation policy or position."
Reasonably Related Threads
- segmentation violation when closing the data entry window (PR#1453)
- [R] fix and edit don't work: unable to open X Input
- memory leak in sub("[range]",...)
- X11 device doesn't handle destroy events correcly (PR#848)
- [PATCH 3/5] vhost: Make vhost a separate module