bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sr #110809] UBSAN failure in output.c:511 (make_room_for)


From: Sam James
Subject: [sr #110809] UBSAN failure in output.c:511 (make_room_for)
Date: Sat, 7 Jan 2023 17:01:46 -0500 (EST)

URL:
  <https://savannah.gnu.org/support/?110809>

                 Summary: UBSAN failure in output.c:511 (make_room_for)
                 Project: GNU M4
               Submitter: thesamesam
               Submitted: Sat 07 Jan 2023 10:01:44 PM UTC
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 07 Jan 2023 10:01:44 PM UTC By: Sam James <thesamesam>
When building m4 1.4.19 or from the 'branch-1.4' branch, a collection of
Undefined Behaviour Sanitizer (UBSAN, -fsanitize=undefined) errors are thrown
both at runtime in real world use and in the test suite.

Steps to reproduce:
1. ./configure CFLAGS="-O2 -fsanitize=undefined -ggdb3"
LDFLAGS="-fsanitize=undefined -ggdb3" --disable-gcc-warnings
2. make -j$(nproc)
3. make check -j$(nproc)

This is with GCC 12.2.1_p20221231.

Snippet from build log:
```
[...]
./233.improved_c: stderr mismatch
--- m4-tmp.1998872/m4-xerr      2023-01-07 21:59:28.043863382 +0000
+++ m4-tmp.1998872/m4-err       2023-01-07 21:59:28.030529977 +0000
@@ -0,0 +1,10 @@
+output.c:511:9: runtime error: null pointer passed as argument 2, which is
declared to never be null
+    #0 0x5577efe67295 in make_room_for /tmp/m4/src/output.c:511
+    #1 0x5577efe8fe05 in output_character_helper /tmp/m4/src/output.c:539
+    #2 0x5577efe8fe05 in shipout_text /tmp/m4/src/output.c:627
+    #3 0x5577efe8d67d in expand_input /tmp/m4/src/macro.c:68
+    #4 0x5577efe6a3de in main /tmp/m4/src/m4.c:684
+    #5 0x7f1bea2bb289  (/usr/lib64/libc.so.6+0x23289)
+    #6 0x7f1bea2bb344 in __libc_start_main (/usr/lib64/libc.so.6+0x23344)
+    #7 0x5577efe6a980 in _start (/tmp/m4/src/m4+0x52980)
+
Checking ./234.improved_c
Checking ./235.improved_c
Checking ./236.improved_f
Checking ./stackovf.test
Stack soft limit set to 300K
Pass

Skipped checks were:
  ./125.changeword ./126.changeword ./127.changeword ./128.changeword
./129.changeword ./130.changeword
Failed checks were:
  ./143.diversions:err ./144.diversions:err ./145.diversions:err
./146.diversions:err ./147.divert:err ./148.divert:err ./150.divert:err
./152.undivert:err ./153.undivert:err ./154.undivert:err ./155.undivert:err
./157.undivert:err ./158.divnum:err ./159.cleardiver:err ./206.m4exit:err
./212.other_inco:err ./233.improved_c:err
```

```
# ./m4 --version
m4 (GNU M4) 1.4.19.15-bb35
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by René Seindal.
```

I've attached the full test log as 'm4.log' (make check output).






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Sat 07 Jan 2023 10:01:44 PM UTC  Name: m4.log  Size: 21KiB   By:
thesamesam
m4.log
<http://savannah.gnu.org/support/download.php?file_id=54200>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110809>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]