Modify

Opened 7 years ago

Closed 6 years ago

#4717 closed Patches (fixed)

Non-const local static variable stored_vtable

Reported by: Kazutoshi Satoda <k_satoda@…> Owned by: dgregor
Milestone: Boost 1.46.0 Component: function
Version: Boost 1.44.0 Severity: Regression
Keywords: Cc: viboes

Description

In boost/function/function_template.hpp, there is a local static object stored_vtable which is initialized statically. Since this variable is not const, it is placed in writable memory (or section).

This can be a critical problem on some embedded, ROM environment which has only XX KB of RAM. The variable is small, but instanciated for each combination of template arguments.

Digging the history, this variable was const in old versions, but was changed to non-const in r43884 (accidentally, I think). After that, some changes in r43884 were reverted in r49326, but the constness was left as non-const. I believe that this was just an oversight.

Attachments (1)

djw_function_const_vtable.patch (6.6 KB) - added by djwalker 7 years ago.
Implements a const stored_vtable. Passes regressions on gcc 4.2, msvc 7.1, 10.0

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by Kazutoshi Satoda <k_satoda@…>

  • Type changed from Patches to Bugs

Changed 7 years ago by djwalker

Implements a const stored_vtable. Passes regressions on gcc 4.2, msvc 7.1, 10.0

comment:2 Changed 7 years ago by viboes

  • Cc viboes added
  • Milestone changed from To Be Determined to Boost-1.46.0
  • Type changed from Bugs to Patches

comment:3 Changed 6 years ago by marshall

I applied this patch locally; it passed regressions on gcc 4.2.1 and clang TOT

comment:4 Changed 6 years ago by marshall

Patch applied to trunk in [72316]; waiting for tests to cycle

comment:5 Changed 6 years ago by marshall

  • Resolution set to fixed
  • Status changed from new to closed

(In [72347]) Merge fixes to release; Fixes #4717

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain dgregor.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.