From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Apr 04 2022 - 11:30:35 CDT

Hi,
  I should also point out that there's another new way of merging molecules in
VMD 1.9.4 that people probably aren't aware of yet:
  mol fromsels $selectionlist

e.g.:
  set sellist {}
  lappend sellist [atomselect 2 "index 11 to 18"]
  lappend sellist [atomselect 3 "index 20 to 30"]
  llength $sellist
  mol fromsels $sellist

This bypasses any disk I/O and builds a new VMD molecule from a list of
VMD atom selections from existing molecule(s). It can be substantially
faster than other methods if the structures you've got loaded in VMD
contain everything you want and you just need to put them together
in a single molecule.

You can of course then write the new molecule to a file if you like.

Best,
  John

On Mon, Apr 04, 2022 at 11:18:41AM -0500, yjcoshc wrote:
> Hi Josh,
>
> Thanks for your information. I have tried VMD 1.9.3 with psfgen 1.6,
> which works without the segfault. The generated files look correct,
> so I have used them. I will try topotools if I have time.
>
> Thanks,
>
> Haochuan Chen
>
>
> On 4/4/22 11:15, Josh Vermaas wrote:
> >Hi Haochuan,
> >
> >If you are just trying to merge together two structures in a way
> >that doesn't segfault, I think the "mergemols" command in
> >topotools gives you a way around this problem. Admittedly, this is
> >now my default approach, so I don't know how widespread this
> >problem is with psfgen 2.0.
> >
> >-Josh
> >
> >On 4/4/22 11:06, yjcoshc wrote:
> >>Dear VMD developers,
> >>
> >>I am using the "Merge Structures" plugin in VMD 1.9.4a51, and
> >>after setting all the options and clicking the "Merge" button,
> >>VMD encounters a segmentation fault. The VMD binary is download
> >>from the official website. I have also tried to compile VMD from
> >>source with debug options, and the backtrace is attached as
> >>following:
> >>
> >>Thread 1 "vmd_LINUXAMD64" received signal SIGSEGV, Segmentation fault.
> >>0x00007fc70f04aded in __GI__IO_fflush (fp=0x46ac450) at iofflush.c:39
> >>39            _IO_acquire_lock (fp);
> >>(gdb) bt
> >>#0  0x00007fc70f04aded in __GI__IO_fflush (fp=0x46ac450) at
> >>iofflush.c:39
> >>#1  0x00007fc6f4ef6c82 in newhandle_msg_text
> >>(psfcontext=0x516c090, interp=interp_at_entry=0x4158b60,
> >>msg=msg_at_entry=0x7ffef16f7590 "reading topology file /home/hanatok/vmd/plugins/noarch/tcl/readcharmmtop1.2/top_all27_prot_lipid_na.inp\n")
> >>at src/tcl_psfgen.c:71
> >>#2  0x00007fc6f4ef6d35 in newhandle_msg
> >>(vdata=vdata_at_entry=0x4be8230, v=v_at_entry=0x4158b60,
> >>msg=msg_at_entry=0x7ffef16f7590 "reading topology file /home/hanatok/vmd/plugins/noarch/tcl/readcharmmtop1.2/top_all27_prot_lipid_na.inp\n")
> >>at src/tcl_psfgen.c:95
> >>#3  0x00007fc6f4ef7183 in tcl_topology (data=0x4be8230,
> >>interp=0x4158b60, argc=<optimized out>, argv=<optimized out>) at
> >>src/tcl_psfgen.c:736
> >>#4  0x00007fc70f8da815 in TclInvokeStringCommand () from
> >>/lib64/libtcl8.6.so
> >>#5  0x00007fc70f8dbad2 in TclNRRunCallbacks () from /lib64/libtcl8.6.so
> >>#6  0x00007fc70f8e200a in ?? () from /lib64/libtcl8.6.so
> >>#7  0x00007fc70f8e2833 in Tcl_EvalEx () from /lib64/libtcl8.6.so
> >>#8  0x00007fc70f8e2856 in Tcl_Eval () from /lib64/libtcl8.6.so
> >>#9  0x00007fc6f4ef98fd in tcl_psfcontext (data=0x4be8230,
> >>interp=0x4158b60, argc=<optimized out>, argv=0x415cf90) at
> >>src/tcl_psfgen.c:560
> >>#10 0x00007fc70f8da815 in TclInvokeStringCommand () from
> >>/lib64/libtcl8.6.so
> >>#11 0x00007fc70f8dbad2 in TclNRRunCallbacks () from /lib64/libtcl8.6.so
> >>#12 0x00007fc70f9aa1ac in ?? () from /lib64/libtcl8.6.so
> >>#13 0x00007fc70f9a9d97 in TclServiceIdle () from /lib64/libtcl8.6.so
> >>#14 0x00007fc70f98ce9c in Tcl_DoOneEvent () from /lib64/libtcl8.6.so
> >>#15 0x0000000000a30f09 in TclTextInterp::doTkUpdate
> >>(this=0x4158ac0) at TclTextInterp.C:543
> >>#16 0x00000000009aaecb in UIText::check_event (this=0x4156990)
> >>at UIText.C:186
> >>#17 0x0000000000894ee3 in CommandQueue::check_events
> >>(this=0x3a677f0) at CommandQueue.C:92
> >>#18 0x00000000009af65a in VMDApp::VMDupdate (this=0x3a3f030,
> >>check_for_events=1) at VMDApp.C:915
> >>#19 0x0000000000a045ef in main (argc=1, argv=0x7ffef16f8468) at
> >>vmdmain.C:93
> >>
> >>I suspect it may be caused by incorrect file descriptor
> >>psfcontext->PSFGENLOGFILE (or wild pointer) in the new psfgen
> >>2.0. The crash does not happen in VMD 1.9.3, which uses psfgen
> >>1.6. Any ideas?
> >>
> >>Thanks,
> >>
> >>Haochuan Chen
> >>
> >>

-- 
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/