[Bug gdb/34047] gdb Fatal signal: Bus error | SIGBUS (Misaligned address error)

simark at simark dot ca via Gdb-prs <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34047

--- Comment #15 from Simon Marchi <simark at simark dot ca> ---
(In reply to k4lizen from comment #14)
> > I am not sure we're looking at the same thing as your original report though.
> 
> Thats pretty funny.
> 
> It might be that fixing this issue makes the previous one easier to
> reproduce!

I side-stepped that issue by creating some dummy temporary aspace/pspace:

diff --git i/gdb/infrun.c w/gdb/infrun.c
index 00bedc7b6aec..0f19cc0ebc09 100644
--- i/gdb/infrun.c
+++ w/gdb/infrun.c
@@ -1118,6 +1118,9 @@ handle_vfork_child_exec_or_exit (int exec)
          inf->pspace = nullptr;
          address_space_ref_ptr aspace = std::move (inf->aspace);

+         inf->aspace = maybe_new_address_space();
+         inf->pspace = new program_space (inf->aspace);
+
          if (print_inferior_events)
            {
              std::string pidstr



With this, I no longer see the internal error.  pwndbg/gdb appears to work
fine, no SIGBUS.

> Let me know if you want me to open a new bug report.

Yes, that might be useful.

> > The problem looks like: [...]
> 
> Oh wau thats a pretty crazy bug, honestly good job for figuring it out.
> 
> Any ideas on what the way forward is?

If someone wants to work on fixing that internal error, they would be very
welcome to (I probably won't).

Let me know if you are still able to reproduce that SIGBUS thing.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.