https://bugs.kde.org/show_bug.cgi?id=505673

            Bug ID: 505673
           Summary: Valgrind crashes with an **internal error** (`SIGBUS`,
                    signal 7) when running my `minishell` program. This
                    appears to be a fatal crash inside Valgrind itself,
                    not a user-code error. It is **100% reproducible**.
                    The crash happens during execution of a red
    Classification: Developer tools
           Product: valgrind
      Version First 3.22.0
       Reported In:
          Platform: Ubuntu
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

[Valgrind 3.22.0] Internal Error: SIGBUS crash in memcheck when running
`minishell` on Ubuntu 24.04
📝 Full Bug Report:

### Description

Valgrind crashes with an **internal error** (`SIGBUS`, signal 7) when running
my `minishell` program. This appears to be a fatal crash inside Valgrind
itself, not a user-code error. It is **100% reproducible**.

The crash happens during execution of a redirection function in `minishell`,
and Valgrind reports it received a signal it couldn't handle (`si_code=2`,
SIGBUS, Address alignment error), and exits.

The stacktrace shows it occurs deep in `memcheck`, not in the user program
itself.

---

### System Information

- **Valgrind Version:**  
  `valgrind-3.22.0`

  valgrind ./minishell
and run > minishell , which is the executable running in valgrind , and the
issue happens when i try to close the file after editing .
Operating System:

Distributor ID: Ubuntu  
Description:    Ubuntu 24.04.2 LTS  
Release:        24.04  
Codename:       noble
Kernel:         Linux sma3ine-EZbook 6.11.0-26-generic x86_64
Reproducible:
Yes – crash happens every time.

==13036== Memcheck, a memory error detector
==13036== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==13036== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==13036== Command: ./minishell
==13036== 

--13036-- VALGRIND INTERNAL ERROR: Valgrind received a signal 7 (SIGBUS) -
exiting
--13036-- si_code=2;  Faulting address: 0x10E469;  sp: 0x1002dad580

valgrind: the 'impossible' happened:
   Killed by fatal signal

host stacktrace:
==13036==    at 0x581C9AC3: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==13036==    by 0x581CA8DD: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==13036==    by 0x581518CB: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==13036==    by 0x58152099: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==13036==    by 0x58135614: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==13036==    by 0x58135F36: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==13036==    by 0x5805C635: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==13036==    by 0x5809DB21: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==13036==    by 0x580EB087: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 13036)
==13036==    at 0x10E469: out_fd (redirections.c:30)
==13036==    by 0x112CE7: redirection (execute_redirections.c:25)
==13036==    by 0x112DD0: execute_redirections (execute_redirections.c:52)
==13036==    by 0x111762: execute_ast (execute_ast.c:65)
==13036==    by 0x10F0C2: execution (execution.c:54)
==13036==    by 0x11374A: read_eval_print_loop (main.c:218)
==13036==    by 0x113876: main (main.c:256)

client stack range: [0x1FFEFE6000 0x1FFF000FFF] client SP: 0x1FFEFFFB40  
valgrind stack range: [0x1002CAE000 0x1002DADFFF] top usage: 18232 of 1048576

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to