[gmx-users] xtc_write() signals segmentation fault

Mark Abraham mark.j.abraham at gmail.com
Fri Jul 29 00:09:03 CEST 2016


Hi,

Generally one gets good value from running

gdb --args template -f whatever

And then you can inspect the state of the program. But we're off topic for
this GROMACS list, so please have a look for gdb tutorials! :-)

Mark

On Fri, 29 Jul 2016 00:04 Murilo Kramar <mkramar at u.rochester.edu> wrote:

> Hi Mark,
>
> Probably is my library misuse  that provoked such behaviour. I compiled my
> program using the -g flag. Using gdb and running the program I get the
> following result after backtrace:
>
> #0  0x00000000004069f4 in HydrateFinder::analyzeFrame (this=0x6125f0,
> frnr=0,
>     fr=..., pbc=0x7fffffffda70, pdata=0xb59dc0) at template.cpp:338
>
> The core file generated is too large and can't be opened by 'gedit'. Sorry
> for the basic question, but how can I further investigate that?
>
> Best wishes,
>
> Murilo.
>
>
> On Tue, Jul 26, 2016 at 4:49 AM, Mark Abraham <mark.j.abraham at gmail.com>
> wrote:
>
> > Hi,
> >
> > You need to use a debugger to find out where the segfault happens, in
> order
> > to know whether the problem is in the library or your use of it.
> >
> > Mark
> >
> > On Mon, 25 Jul 2016 21:39 Murilo Kramar <mkramar at u.rochester.edu> wrote:
> >
> > > Greetings everyone,
> > >
> > > My Gromacs version is 5.1.2 under CentOs 6.5.
> > >
> > > I'm currently using xtc_write() inside a template.cpp based program,
> but
> > in
> > > the very first frame it crashes and shows a segmentation fault message.
> > >
> > > The opening statement:
> > >
> > >  t_fileio* traj = open_xtc("new_traj.xtc", "w+");
> > >
> > > returns a number different than zero, indicating that the file was
> opened
> > > correctly.
> > >
> > > After that, inside analyzeFrame I call write_xtc() to copy the actual
> > > information into another file in order to check whether the function
> > works
> > > or not:
> > >
> > > write_xtc(traj,
> > >               fr.atoms->nr, fr.step, fr.time,
> > >               const_cast <real (*) [3]> (fr.box), fr.x, 10.0);
> > >
> > > The frame number 0 signals a segmentation fault. Is write_xtc
> recommended
> > > in newer version of Gromacs?
> > >
> > >
> > > Best Regards,
> > >
> > > Murilo. G. K.
> > > --
> > > Gromacs Users mailing list
> > >
> > > * Please search the archive at
> > > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > > posting!
> > >
> > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> > >
> > > * For (un)subscribe requests visit
> > > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> > > send a mail to gmx-users-request at gromacs.org.
> > >
> > --
> > Gromacs Users mailing list
> >
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > posting!
> >
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >
> > * For (un)subscribe requests visit
> > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> > send a mail to gmx-users-request at gromacs.org.
> >
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.
>


More information about the gromacs.org_gmx-users mailing list