Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7509829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:02:35+00:00 2026-05-29T23:02:35+00:00

Is there a way for me to detect/initiate-creash-on a write into a string without

  • 0

Is there a way for me to detect/initiate-creash-on a write into a string without using mprotect (which I can’t use)?

Currently I can detect the write only in the following read, but that’s too late (the following read can come from a completely different lib).

Note: Using gdb with watchpoints failed due to optimizer moving the string around in the process memory.

Edit: The variable in question is a class member (char*) that contains some metadata as a prefix to a string. The string is the part that needs to be immutable, and the prefix must be writable. I’ve got a few millions of these objects in a class-static hash, and they are accessed from just about anywhere in our code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:02:36+00:00Added an answer on May 29, 2026 at 11:02 pm

    You can try to wrap all the code that writes to memory in preprocessor macros which check the address that you’re using but since most people love to use bare bones pointers (instead of library calls that encapsulate things), it will probably be a lot of effort.

    The only other option is mprotect(2) or GDB which all use special parts of the CPU to watch the address bus for accesses to the memory in question.

    Since you can’t use that either, the last option is to print the code on paper and sit down in a quiet corner for a couple of days to read it. This will usually work but most people shun the effort (and because it doesn’t look like “real” work ;-).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to detect which windows XP theme is in use? I
Is there a way to detect if the device I'm currently running on has
Is there a way to detect if a browser window is closed using GWT.
Is there any way to detect the current keyboard layout using JavaScript? I found
Is there a way to detect if a mouse button is currently down in
Is there a way to detect when a specific device is plugged into a
Is there a way to detect, using javascript or a js library, if my
Is there a way to detect if javascript is executing a script using either
Is there any way a google chrome extensions can detect whether a download was
Is there a way to detect if Facebook deletes your application using their API?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.