remzi-arpacidusseau / ostep-typos

51 stars 44 forks source link

Figure 29.8: List_Insert function doesn't report malloc failure to caller functions #83

Closed MondoGao closed 1 year ago

MondoGao commented 1 year ago

Version: 1.01 Downloadable PDF Description:

In Chapter 29.2, the book provides us two implementations for concurrent linked list. For the optimized version, List_Insert function's return signature changes to void, and it doesn't report malloc failure. But for the original version, the function reports the success/failure by return int.

CleanShot 2023-10-26 at 11 49 09

The optimized version will cause a silent error, which is bad in situations like inserting a batch of items in loops.

I noticed this issue on 23 Fall's CS537 class, and the prof told me it could be a bug on the book. If this is by design, can I know the reason for that?

BTW: please include the Security part in the downloadable in next release, thank you!

remzi-arpacidusseau commented 1 year ago

Thanks! Now fixed.

You will be acknowledged on the errata page now (https://github.com/remzi-arpacidusseau/ostep-typos) and eventually in the printed book preface.

Thanks again for your help! Remzi