There is another case where calling a member method can segfault. It's the
case where the object you are calling the method on is NULL. It's quite
possible that you can start executing a member method on a NULL object
until it needs to actually work with the data. Your program won't
necessarily crash when the member method starts executing if it isn't
virtual and data is not immediately needed.

That may not be your case here but I thought I'd throw it out there.
Cody

On Tue, May 10, 2016 at 12:50 PM John Peterson <jwpeter...@gmail.com> wrote:

> On Tue, May 10, 2016 at 11:47 AM, Lorenzo Zanon <
> za...@aices.rwth-aachen.de>
> wrote:
>
> > Hello,
> >
> > Calling empty() on the DenseVector<Number> is causing the segfault. If I
> > copy the DenseVector into a std::vector, then it's fine.
> >
>
> Calling empty() on a DenseVector just calls empty() on the underlying _val,
> which is a std::vector.  I see no way that copying the DenseVector into a
> std::vector could work if simply calling empty() on said DenseVector
> segfaults.
>
>
> How can I see if there is something wrong with my build/compiler?
> > Everything runs fine apart from that error.
> >
>
> Unfortunately there's no one way to know for sure, but if everything else
> works fine (have you run make check?) then I would suspect the build itself
> is OK.
>
>
>
> >
> > The libMesh version is 0.9.5 (according to the first line of the NEWS
> > file).
> >
>
> Unless you downloaded a release, it's unlikely that you're using exactly
> 0.9.5.  Since you're using at least 0.9.5, it probably wouldn't hurt to try
> master, it should still be API-compatible with your app.
>
>
>
> The lines I sent come from a debug in dbg-mode with gdb.
> >
> > I can share the code, but there are several files. It looks like
> > rhs->add_vector() is failing with any DenseVector<Number>, crashing at
> the
> > check empty().
> >
>
> Several files would be OK, if there are detailed instructions about how to
> build the app.  Even better would be to start a GitHub or bitbucket
> repository with the code and let us know the URL.
>
> --
> John
>
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data
> untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
> _______________________________________________
> Libmesh-users mailing list
> Libmesh-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to