[Bug 2095206] [NEW] throw not caught causing an seg fault rather than a `terminate called after throwing an instance of 'int'` message

Max Allendorf 2095206 at bugs.launchpad.net
Fri Jan 17 23:04:54 UTC 2025


Public bug reported:

Initially reported at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118538

Seems to happen on ubuntu 24.04 arm64 running on a raspberry pi 5

Operating System: Ubuntu 24.04.1 LTS
          Kernel: Linux 6.8.0-1017-raspi
    Architecture: arm64

The attached reproduction throws a segfault rather than throwing the
raised exception properly.

g++-14 -O0 -std=c++17 -Wall -Wextra -Wpedantic -Wuninitialized -fno-strict-aliasing -fwrapv -g3 test.cpp && ./a.out
test.cpp: In function ‘int main()’:
test.cpp:55:10: warning: variable ‘reader’ set but not used [-Wunused-but-set-variable]
   55 |     auto reader = Reader("file", 1);
      |          ^~~~~~
[1]    473461 segmentation fault (core dumped)  ./a.out

** Affects: gcc-14 (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "reproduction.cpp"
   https://bugs.launchpad.net/bugs/2095206/+attachment/5852531/+files/reproduction.cpp

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-14 in Ubuntu.
https://bugs.launchpad.net/bugs/2095206

Title:
  throw not caught causing an seg fault rather than a `terminate called
  after throwing an instance of 'int'` message

Status in gcc-14 package in Ubuntu:
  New

Bug description:
  Initially reported at
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118538

  Seems to happen on ubuntu 24.04 arm64 running on a raspberry pi 5

  Operating System: Ubuntu 24.04.1 LTS
            Kernel: Linux 6.8.0-1017-raspi
      Architecture: arm64

  The attached reproduction throws a segfault rather than throwing the
  raised exception properly.

  g++-14 -O0 -std=c++17 -Wall -Wextra -Wpedantic -Wuninitialized -fno-strict-aliasing -fwrapv -g3 test.cpp && ./a.out
  test.cpp: In function ‘int main()’:
  test.cpp:55:10: warning: variable ‘reader’ set but not used [-Wunused-but-set-variable]
     55 |     auto reader = Reader("file", 1);
        |          ^~~~~~
  [1]    473461 segmentation fault (core dumped)  ./a.out

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-14/+bug/2095206/+subscriptions




More information about the foundations-bugs mailing list