Reliable Source: Lessons from a Life in Software Engineering by Bonang Clarisse & Bonang James

Reliable Source: Lessons from a Life in Software Engineering by Bonang Clarisse & Bonang James

Author:Bonang, Clarisse & Bonang, James
Language: eng
Format: epub
Published: 2022-01-12T00:00:00+00:00


This suggests that thread T1, fnThreadA, is also accessing that same location, offset 64 bytes (40 in hexadecimal) from the start of the Cryptanalyzer object (0x7b1800000000).

The next block of messages from TSan confirms our suspicions. The race condition involves memory allocated on the heap beginning at hexadecimal address 0x7b1800000000 and allocated by the newInstance simple factory method of the Cryptanalyzer class using the new operator.

Location is heap block of size 96 at 0x7b1800000000 allocated by main thread:

#0 operator new(unsigned long) <null> (libtsan.so.0+0x7502a)

#1 Cryptanalyzer::newInstance(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) /home/jbonang/projects/study_in_concurrency/Cryptanalyzer.cpp:52 (cryptanalyzer+0x402df0)

#2 main /home/jbonang/projects/study_in_concurrency/main.cpp:103 (cryptanalyzer+0x40ef80)

Figure 50: ThreadSanitizer reports location of data race

We have an airtight case: the member variable vecCandidatePlaintextFitnessMeasureTuple within the Cryptanalyzer object passed to threads A (T1) and T (T2), is a vector of tuples and is not thread safe, leading to race conditions.

std::vector< std::tuple<std::string, double> > m_vecCandidatePlaintextFitnessMeasureTuple;

Figure 51: C++ code fragment showing our prime suspect, the vector of tuples

Our suspect has the means, opportunity and, of course, motive. It has accomplices in the form of our two threads. Our suspect will hang for this - well, actually, not hang, but "seg fault."

Even the worst of criminals may not be beyond redemption, though. What can be done to rehabilitate our perpetrator?

Rehabilitation



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Whisky: Malt Whiskies of Scotland (Collins Little Books) by dominic roskrow(55662)
What's Done in Darkness by Kayla Perrin(26362)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(18880)
Shot Through the Heart by Mercy Celeste(18750)
The Fifty Shades Trilogy & Grey by E L James(18729)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(15714)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(15707)
Peren F. Statistics for Business and Economics...Essential Formulas 3ed 2025 by Unknown(15598)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 03 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(15499)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 01 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(15136)
The Subtle Art of Not Giving a F*ck by Mark Manson(14041)
The 3rd Cycle of the Betrayed Series Collection: Extremely Controversial Historical Thrillers (Betrayed Series Boxed set) by McCray Carolyn(13939)
Stepbrother Stories 2 - 21 Taboo Story Collection (Brother Sister Stepbrother Stepsister Taboo Pseudo Incest Family Virgin Creampie Pregnant Forced Pregnancy Breeding) by Roxi Harding(13029)
Scorched Earth by Nick Kyme(12581)
Drei Generationen auf dem Jakobsweg by Stein Pia(10807)
Suna by Ziefle Pia(10742)
Scythe by Neal Shusterman(10124)
International Relations from the Global South; Worlds of Difference; First Edition by Arlene B. Tickner & Karen Smith(9364)
Successful Proposal Strategies for Small Businesses: Using Knowledge Management ot Win Govenment, Private Sector, and International Contracts 3rd Edition by Robert Frey(9189)
This is Going to Hurt by Adam Kay(8851)