RE: static member variable in libcommon and double free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I don't think is the problem that John and Kefu described.

Seems that  the problem is that there are two dynamic libraries that think each one of them is responsible for static run-time initialization of the same global variable. This violates the "One Definition Rule".

I'm guessing that the source of the problem is that the AsyncMessager.cc file is included twice, one in each library. If so, then the solution is to break out the offending *.cc file into a separate third library that's linked in the right combination with the others so that there's no duplication.

I have no idea why this appears to work with autotools.


Allen Samuels
SanDisk |a Western Digital brand
951 SanDisk Drive, Milpitas, CA 95035
T: +1 408 801 7030| M: +1 408 780 6416
allen.samuels@xxxxxxxxxxx

> -----Original Message-----
> From: ceph-devel-owner@xxxxxxxxxxxxxxx [mailto:ceph-devel-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Jesse Williamson
> Sent: Tuesday, July 26, 2016 5:12 PM
> To: kefu chai <tchaikov@xxxxxxxxx>
> Cc: John Spray <jspray@xxxxxxxxxx>; ceph-devel@xxxxxxxxxxxxxxx
> Subject: Re: static member variable in libcommon and double free
> 
> 
> Folks,
> 
> I hope this will help.
> 
> Three are some issues that you need to know about when you're writing
> computer programs in C++. Before you decide to change away from the
> whole
> structure, consider what it is currently accomplishing.
> 
> Here is one of them. It may be exactly what you're running in to:
> https://isocpp.org/wiki/faq/ctors#static-init-order
> 
> Please feel free to ask questions.
> 
> -Jesse
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux