Builds with gcc -fsanitize=address crashing on startup

Bug #2058411 reported by Dan
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gcc-defaults (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Builds of any code using -fsanitize=address sometimes crash, as shown below. Sometimes they run successfully, sometimes failing with this "AddressSantizer:DEADLYSIGNAL" message. I've just run "software updater" and upgraded everything.

$ cat p.c

#include <stdio.h>

int main(int argc, char **argv){
  printf("hello world\n");
  return 0;
}
dan@ws1:~/work/sqlite/bld4/tst$ gcc -fsanitize=address ./p.c
dan@ws1:~/work/sqlite/bld4/tst$ ./a.out
hello world
dan@ws1:~/work/sqlite/bld4/tst$ ./a.out
hello world
dan@ws1:~/work/sqlite/bld4/tst$ ./a.out
hello world
dan@ws1:~/work/sqlite/bld4/tst$ ./a.out
hello world
dan@ws1:~/work/sqlite/bld4/tst$ ./a.out
hello world
dan@ws1:~/work/sqlite/bld4/tst$ ./a.out
hello world
dan@ws1:~/work/sqlite/bld4/tst$ ./a.out
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
Segmentation fault

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: gcc 4:11.2.0-1ubuntu1
ProcVersionSignature: Ubuntu 6.5.0-26.26~22.04.1-generic 6.5.13
Uname: Linux 6.5.0-26-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Wed Mar 20 00:40:15 2024
InstallationDate: Installed on 2022-10-07 (528 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
SourcePackage: gcc-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dan (dan-sqlite-org) wrote :
Revision history for this message
Andrew Burnard (aburnard) wrote :

Also affects me, using Uname: Linux 6.5.0-26-generic x86_64

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-defaults (Ubuntu):
status: New → Confirmed
Revision history for this message
Teemu Ollakka (teemu-ollakka) wrote :

The workaround mentioned here https://github.com/google/sanitizers/issues/1716

  sudo sysctl vm.mmap_rnd_bits=28

made the problem go away for me.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.