Menu

#355 TModule no longer accepts null-pointer for name (regression in 6.32)

6.36
closed
1
2026-04-03
2016-11-06
No

In the string overhaul for 6.32 [r793], the type of TModule::Name was changed from LPCTSTR to tstring, and the corresponding parameters for the constructors, as well as TModule::SetName, were changed likewise. Now these functions no longer accept a null-pointer, which previously was well-defined. Passing a null pointer will now cause a crash.

This change is contrary to the policy stated in Strings in OWLNext, in which well-defined behaviour for null pointers should be preserved (i.e. by providing side-by-side overloads for LPCTSTR and tstring).

This bug also affects the TApplication constructor parameter name, which was changed to tstring in the same revision. See discussion [02c5f40c].

Related

Commit: [r793]
Discussion: 02c5f40c
Discussion: Problems with migrating to OWLNext 6.35
Wiki: OWLNext_Stable_Releases
Wiki: Strings_in_OWLNext

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2016-11-06
    • assigned_to: Vidar Hasfjord
    • Group: unspecified --> 6.36
     

    Last edit: Vidar Hasfjord 2016-11-06
  • Erwin Lotter

    Erwin Lotter - 2017-01-05

    Hi Vidar,

    a second instance of the same problem has now shown up in my application. In this case I passed a null pointer to TPrintout::TPrintout(const char* title), what was ok before 6.35 (but not explicitely allowed as with TApplication), but now throws an exception.

    Erwin

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2017-01-05

    Hi Erwin, thanks for the feedback. I'll investigate and document.

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2017-01-10

    I have now created a new ticket for the TPrintout regression [bugs:#360], and documented it in Strings in OWLNext.

     

    Related

    Bugs: #360
    Wiki: Strings_in_OWLNext


    Last edit: Vidar Hasfjord 2017-01-10
  • Vidar Hasfjord

    Vidar Hasfjord - 2017-01-11

    This ticket has now been addressed by reintroducing support for passing a null-pointer to the TModule and TApplication constructors (except for the TModule constructor encapsulating LoadLibrary, with which a null-pointer makes no sense). The issue was fixed in [r3607], and the fix has been merged into Owlet [r3609], 6.44 [r3610] and 6.36 [r3611].

    For consistency, constructor TModule (LPCTSTR name, HINSTANCE, const tstring& cmdLine, bool addToList) will now, like constructor TModule (LPCTSR, HINSTANCE, bool addToList), retrieve the module name using GetModuleFileName, if a null-pointer is passed. Similarly for the string-aware overload, if an empty string is passed. This change was implemented in [r3608], and merged into Owlet, 6.44 and 6.36 together with the main fix.

     

    Related

    Commit: [r3607]
    Commit: [r3608]
    Commit: [r3609]
    Commit: [r3610]
    Commit: [r3611]

  • Vidar Hasfjord

    Vidar Hasfjord - 2017-01-11
    • status: open --> pending
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2017-01-15
    • Status: pending --> closed
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2026-04-03
    • labels: Crash, Strings, API --> Crash, Strings, API, Regression
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2026-04-03

    The fix for this issue was released in OWLNext 6.36.0 and OWLNext 6.44.0.

     

Log in to post a comment.

MongoDB Logo MongoDB