GNU bug report logs - #78824
[igc] segfault in temacs during build => charset-table

Previous Next

Package: emacs;

Reported by: Jeff Walsh <fejfighter <at> gmail.com>

Date: Wed, 18 Jun 2025 11:47:01 UTC

Severity: normal

To reply to this bug, email your comments to 78824 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78824; Package emacs. (Wed, 18 Jun 2025 11:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jeff Walsh <fejfighter <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 18 Jun 2025 11:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jeff Walsh <fejfighter <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [igc] segfault in temacs during build => charset-table
Date: Wed, 18 Jun 2025 21:45:39 +1000
[Message part 1 (text/plain, inline)]
When building the latest of the IGC branch, commit:
887db2ff38ce82bb5f33aa128c76b578caba216d

I am getting a SEGFAULT during temacs execution.

running under a debugger, this occurs in root_find in igc.c
`if (r->d.start == start)` (r is null in this case)

walking the list of roots:
p
*global_igc->roots->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next

provides:
(igc_root_list) {
  next = NULL
  prev = 0x00000000006d5f00
  d = {
    gc = 0x0000000000726e00
    root = 0x00007fffe80012a8
    start = 0x00000000006142e0
    end = 0x0000000000622f20
    label = 0x0000000000233fb9 "charset-table"
    ambig = true
  }
}

(lldb) p start
(void *) 0x0000000000000000

(lldb) bt
* thread #1, name = 'temacs', stop reason = signal SIGSEGV: address not
mapped to object (fault address=0x20)
    frame #0: 0x000000000051c953 temacs`igc_xpalloc_lisp_objs_exact
[inlined] root_find(start=0x0000000000000000) at igc.c:3111:8
    frame #1: 0x000000000051c940 temacs`igc_xpalloc_lisp_objs_exact
[inlined] igc_destroy_root_with_start(start=0x0000000000000000) at
igc.c:3135:33
  * frame #2: 0x000000000051c940
temacs`igc_xpalloc_lisp_objs_exact(pa=(struct Lisp_Symbol *) $7 =
0x0000000000685300, nitems=0x0000000000628e18,
nitems_incr_min=<unavailable>, nitems_max=<unavailable>,
item_size=<unavailable>, label="lface-id-to-name") at igc.c:3520:3
    frame #3: 0x0000000000392fd1
temacs`Finternal_make_lisp_face(face=(struct Lisp_Symbol *) $13 =
0x000000000068d0c8, frame=<unavailable>) at xfaces.c:2993:8
    frame #4: 0x000000000048981a temacs`eval_sub(form=<unavailable>) at
eval.c:2703:15
    frame #5: 0x000000000048d980 temacs`Flet [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #6: 0x000000000048d961 temacs`Flet(args=(struct Lisp_Cons *) $16
= 0x00007fffe71676d8) at eval.c:1203:9
    frame #7: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #8: 0x000000000048ccf0 temacs`Fwhile [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #9: 0x000000000048ccd3 temacs`Fwhile [inlined]
prog_ignore(body=<unavailable>) at eval.c:466:3
    frame #10: 0x000000000048ccd3 temacs`Fwhile(args=<unavailable>) at
eval.c:1224:7
    frame #11: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #12: 0x000000000048d980 temacs`Flet [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #13: 0x000000000048d961 temacs`Flet(args=(struct Lisp_Cons *) $17
= 0x00007fffe7167768) at eval.c:1203:9
    frame #14: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #15: 0x0000000000489b60 temacs`Fif [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #16: 0x0000000000489b40 temacs`Fif(args=<unavailable>) at
eval.c:411:10
    frame #17: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #18: 0x0000000000489de1 temacs`funcall_lambda [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #19: 0x0000000000489dd0 temacs`funcall_lambda(fun=(struct
Lisp_Vector *) $19 = 0x00007fffe716fb80, nargs=39200, arg_vector=(struct
Lisp_Symbol *) $25 = 0x0000800000681830) at eval.c:3452:15
    frame #20: 0x000000000048ab14 temacs`apply_lambda(fun=(struct
Lisp_Vector *) $19 = 0x00007fffe716fb80, args=<unavailable>,
count=<unavailable>) at eval.c:3317:9
    frame #21: 0x0000000000489028 temacs`eval_sub(form=<unavailable>) at
eval.c:2789:9
    frame #22: 0x0000000000489de1 temacs`funcall_lambda [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #23: 0x0000000000489dd0 temacs`funcall_lambda(fun=(struct
Lisp_Vector *) $26 = 0x00007fffe7174d30, nargs=39200, arg_vector=(struct
Lisp_Symbol *) $28 = 0x00008000006819d0) at eval.c:3452:15
    frame #24: 0x000000000048ab14 temacs`apply_lambda(fun=(struct
Lisp_Vector *) $26 = 0x00007fffe7174d30, args=<unavailable>,
count=<unavailable>) at eval.c:3317:9
    frame #25: 0x0000000000489028 temacs`eval_sub(form=<unavailable>) at
eval.c:2789:9
    frame #26: 0x0000000000489de1 temacs`funcall_lambda [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #27: 0x0000000000489dd0 temacs`funcall_lambda(fun=(struct
Lisp_Vector *) $29 = 0x00007fffe7736e38, nargs=140737068522315,
arg_vector=(struct Lisp_Symbol *) $31 = 0x0000800000681b70) at
eval.c:3452:15
    frame #28: 0x000000000048ab14 temacs`apply_lambda(fun=(struct
Lisp_Vector *) $29 = 0x00007fffe7736e38, args=<unavailable>,
count=<unavailable>) at eval.c:3317:9
    frame #29: 0x0000000000489028 temacs`eval_sub(form=<unavailable>) at
eval.c:2789:9
    frame #30: 0x0000000000489b60 temacs`Fif [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #31: 0x0000000000489b40 temacs`Fif(args=<unavailable>) at
eval.c:411:10
    frame #32: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #33: 0x0000000000489de1 temacs`funcall_lambda [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #34: 0x0000000000489dd0 temacs`funcall_lambda(fun=(struct
Lisp_Vector *) $32 = 0x00007fffe6fac7e8, nargs=140737078856675,
arg_vector=(struct Lisp_Symbol *) $34 = 0x0000800000681df0) at
eval.c:3452:15
    frame #35: 0x000000000048ab14 temacs`apply_lambda(fun=(struct
Lisp_Vector *) $32 = 0x00007fffe6fac7e8, args=<unavailable>,
count=<unavailable>) at eval.c:3317:9
    frame #36: 0x0000000000489028 temacs`eval_sub(form=<unavailable>) at
eval.c:2789:9
    frame #37: 0x00000000004b76e6
temacs`readevalloop_eager_expand_eval(val=<unavailable>,
macroexpand=(struct Lisp_Symbol *) $36 = 0x0000800000681400) at
lread.c:2389:13
    frame #38: 0x00000000004bfa6e temacs`readevalloop(readcharfun=error:
error: error: Multiple internal symbols found for 'buffer'
id = {0x0000046a}, range = [0x00007ffff31feea8-0x00007ffff31feeb0),
name="buffer"
id = {0x00000427}, range = [0x00007ffff31fec00-0x00007ffff31fec08),
name="buffer"
id = {0x00000439}, range = [0x00007ffff31fece8-0x00007ffff31fecf0),
name="buffer"
id = {0x000004cd}, range = [0x00007ffff31ff420-0x00007ffff31ff428),
name="buffer"
id = {0x00000422}, range = [0x00007ffff31feba8-0x00007ffff31febb0),
name="buffer"
id = {0x00000432}, range = [0x00007ffff31feca8-0x00007ffff31fecb0),
name="buffer"
id = {0x000004bb}, range = [0x00007ffff31ff330-0x00007ffff31ff338),
name="buffer"
id = {0x000004bf}, range = [0x00007ffff31ff360-0x00007ffff31ff368),
name="buffer"
id = {0x0000041e}, range = [0x00007ffff31feb68-0x00007ffff31feb70),
name="buffer"
id = {0x000004c4}, range = [0x00007ffff31ff398-0x00007ffff31ff3a0),
name="buffer"
id = {0x00000417}, range = [0x00007ffff31feb00-0x00007ffff31feb08),
name="buffer"
id = {0x0000043e}, range = [0x00007ffff31fed40-0x00007ffff31fed48),
name="buffer"
id = {0x000004b7}, range = [0x00007ffff31ff2f8-0x00007ffff31ff300),
name="buffer"
id = {0x000004b3}, range = [0x00007ffff31ff298-0x00007ffff31ff2a0),
name="buffer"
id = {0x00000466}, range = [0x00007ffff31fee68-0x00007ffff31fee70),
name="buffer"
id = {0x0000046e}, range = [0x00007ffff31feee8-0x00007ffff31feef0),
name="buffer"
id = {0x0000042e}, range = [0x00007ffff31fec68-0x00007ffff31fec70),
name="buffer"
id = {0x00000445}, range = [0x00007ffff31feda8-0x00007ffff31fedb0),
name="buffer"
id = {0x000004e2}, range = [0x00007ffff31ff5a8-0x00007ffff31ff5b0),
name="buffer"
id = {0x000004dd}, range = [0x00007ffff31ff530-0x00007ffff31ff538),
name="buffer"
id = {0x000004e9}, range = [0x00007ffff31ff630-0x00007ffff31ff638),
name="buffer"
id = {0x0000048d}, range = [0x00007ffff31ff088-0x00007ffff31ff090),
name="buffer"
id = {0x000005ca}, range = [0x00007ffff31ffa70-0x00007ffff31ffa8e),
name="buffer"
id = {0x00000488}, range = [0x00007ffff31ff050-0x00007ffff31ff058),
name="buffer"
id = {0x000005c6}, range = [0x00007ffff31ffa60-0x00007ffff31ffa68),
name="buffer"
id = {0x000004ac}, range = [0x00007ffff31ff230-0x00007ffff31ff238),
name="buffer"
id = {0x00000484}, range = [0x00007ffff31ff020-0x00007ffff31ff028),
name="buffer"
id = {0x00000495}, range = [0x00007ffff31ff0e0-0x00007ffff31ff0e8),
name="buffer"
id = {0x000004d9}, range = [0x00007ffff31ff4c8-0x00007ffff31ff4d0),
name="buffer"
id = {0x0000047e}, range = [0x00007ffff31fef88-0x00007ffff31fef90),
name="buffer"
id = {0x000005c5}, range = [0x00007ffff31ffa58-0x00007ffff31ffa60),
name="buffer"
id = {0x0000049a}, range = [0x00007ffff31ff118-0x00007ffff31ff120),
name="buffer"
id = {0x000004d5}, range = [0x00007ffff31ff488-0x00007ffff31ff490),
name="buffer"
id = {0x000005c4}, range = [0x00007ffff31ffa48-0x00007ffff31ffa50),
name="buffer"
id = {0x00000473}, range = [0x00007ffff31fef40-0x00007ffff31fef48),
name="buffer"
id = {0x000004a2}, range = [0x00007ffff31ff170-0x00007ffff31ff178),
name="buffer"
id = {0x000004a6}, range = [0x00007ffff31ff1b8-0x00007ffff31ff1c0),
name="buffer", infile0=0x0000000000000000, sourcename=(struct Lisp_String
*) $39 = 0x00007fffe70d1d30, printflag=false, unibyte=(struct Lisp_Symbol
*) $7 = 0x0000000000685300, readfun=(struct Lisp_Symbol *) $7 =
0x0000000000685300, start=(struct Lisp_Symbol *) $7 = 0x0000000000685300,
end=<unavailable>) at lread.c:2571:15
    frame #39: 0x00000000004c0e6f temacs`Feval_buffer(buffer=<unavailable>,
printflag=(struct Lisp_Symbol *) $41 = 0x00007fffe7757238, filename=(struct
Lisp_Symbol *) $7 = 0x0000000000685300, unibyte=(struct Lisp_Symbol *) $7 =
0x0000000000685300, do_allow_print=<unavailable>) at lread.c:2651:3
    frame #40: 0x00000000004897d8 temacs`eval_sub(form=<unavailable>) at
eval.c:2714:15
    frame #41: 0x0000000000489b60 temacs`Fif [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #42: 0x0000000000489b40 temacs`Fif(args=<unavailable>) at
eval.c:411:10
    frame #43: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #44: 0x000000000048d980 temacs`Flet [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #45: 0x000000000048d961 temacs`Flet(args=(struct Lisp_Cons *) $43
= 0x00007fffe236d5b8) at eval.c:1203:9
    frame #46: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #47: 0x000000000048d980 temacs`Flet [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #48: 0x000000000048d961 temacs`Flet(args=(struct Lisp_Cons *) $44
= 0x00007fffe236d0d8) at eval.c:1203:9
    frame #49: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #50: 0x00000000004899f4 temacs`Funwind_protect(args=(struct
Lisp_Cons *) $45 = 0x00007fffe236d810) at eval.c:1491:9
    frame #51: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #52: 0x000000000048d980 temacs`Flet [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #53: 0x000000000048d961 temacs`Flet(args=(struct Lisp_Cons *) $46
= 0x00007fffe236cc50) at eval.c:1203:9
    frame #54: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #55: 0x0000000000489b60 temacs`Fif [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #56: 0x0000000000489b40 temacs`Fif(args=<unavailable>) at
eval.c:411:10
    frame #57: 0x0000000000489676 temacs`eval_sub(form=<unavailable>) at
eval.c:2651:30
    frame #58: 0x0000000000489de1 temacs`funcall_lambda [inlined]
Fprogn(body=<unavailable>) at eval.c:455:13
    frame #59: 0x0000000000489dd0 temacs`funcall_lambda(fun=<unavailable>,
nargs=<unavailable>, arg_vector=<unavailable>) at eval.c:3452:15
    frame #60: 0x000000000048a432 temacs`Ffuncall(nargs=<unavailable>,
args=(struct Lisp_Symbol *) $48 = 0x0000000000685840) at eval.c:3195:21
    frame #61: 0x00000000004c0a15 temacs`Fload(file=(struct Lisp_Symbol *)
$7 = 0x0000000000685300, noerror=<unavailable>, nomessage=(struct
Lisp_Symbol *) $7 = 0x0000000000685300, nosuffix=<unavailable>,
must_suffix=<unavailable>) at lread.c:1649:10
    frame #62: 0x00000000004897d8 temacs`eval_sub(form=<unavailable>) at
eval.c:2714:15
    frame #63: 0x00000000004bfc45 temacs`readevalloop(readcharfun=(struct
Lisp_Symbol *) $51 = 0x0000000000690708, infile0=0x00007fffffffd820,
sourcename=(struct Lisp_String *) $53 = 0x00007ffff1cb6930,
printflag=false, unibyte=(struct Lisp_Symbol *) $7 = 0x0000000000685300,
readfun=(struct Lisp_Symbol *) $7 = 0x0000000000685300, start=(struct
Lisp_Symbol *) $7 = 0x0000000000685300, end=<unavailable>) at
lread.c:2573:15
    frame #64: 0x00000000004c089c temacs`Fload(file=(struct Lisp_Cons *)
$54 = 0x00007fffe70d1a18, noerror=<unavailable>, nomessage=(struct
Lisp_Symbol *) $7 = 0x0000000000685300, nosuffix=<unavailable>,
must_suffix=<unavailable>) at lread.c:1761:9
    frame #65: 0x00000000004897d8 temacs`eval_sub(form=(struct Lisp_Cons *)
$55 = 0x00007ffff1cb6670) at eval.c:2714:15
    frame #66: 0x0000000000489a50 temacs`Feval(form=(struct Lisp_Cons *)
$55 = 0x00007ffff1cb6670, lexical=(struct Lisp_Symbol *) $57 =
0x0000000000685338) at eval.c:2551:10
    frame #67: 0x00000000003f7822 temacs`top_level_2 at keyboard.c:1196:21
    frame #68: 0x0000000000487293
temacs`internal_condition_case(bfun=(temacs`top_level_2 at
keyboard.c:1192:6), handlers=(struct Lisp_Symbol *) $60 =
0x00000000006853a8, hfun=(temacs`cmd_error at keyboard.c:982:1)) at
eval.c:1707:25
    frame #69: 0x00000000003f85b2 temacs`top_level_1(ignore=<unavailable>)
at keyboard.c:1208:5
    frame #70: 0x00000000004871bf temacs`internal_catch(tag=(struct
Lisp_Symbol *) $63 = 0x000000000069aaa8, func=(temacs`top_level_1 at
keyboard.c:1205:1), arg=(struct Lisp_Symbol *) $7 = 0x0000000000685300) at
eval.c:1387:25
    frame #71: 0x00000000003f7743 temacs`command_loop at keyboard.c:1157:2
    frame #72: 0x00000000003ff726 temacs`recursive_edit_1 at
keyboard.c:766:9
    frame #73: 0x00000000003ffad6 temacs`Frecursive_edit at keyboard.c:849:3
    frame #74: 0x00000000003f7077 temacs`main(argc=<unavailable>,
argv=<unavailable>) at emacs.c:2604:3
    frame #75: 0x00007ffff30115f5 libc.so.6`__libc_start_call_main + 117
    frame #76: 0x00007ffff30116a8 libc.so.6`__libc_start_main@@GLIBC_2.34 +
136
    frame #77: 0x00000000002befa5 temacs`_start + 37
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78824; Package emacs. (Wed, 18 Jun 2025 12:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 78824 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> protonmail.com>
To: Jeff Walsh <fejfighter <at> gmail.com>
Cc: 78824 <at> debbugs.gnu.org
Subject: Re: bug#78824: [igc] segfault in temacs during build => charset-table
Date: Wed, 18 Jun 2025 12:09:36 +0000
"Jeff Walsh" <fejfighter <at> gmail.com> writes:

> When building the latest of the IGC branch, commit: 887db2ff38ce82bb5f33aa128c76b578caba216d 
>
> I am getting a SEGFAULT during temacs execution.

Thanks for the report.  I'm not sure what is happening, though.

> running under a debugger, this occurs in root_find in igc.c
> `if (r->d.start == start)` (r is null in this case)

This is the code:

static igc_root_list *
root_find (void *start)
{
  for (igc_root_list *r = global_igc->roots; r; r = r->next)
    if (r->d.start == start)
      return r;
  return NULL;
}

Clearly, r cannot be NULL on the second line, because of the check in
the for loop continue condition.

> walking the list of roots:
> p
> *global_igc->roots->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next->next
>
>
> provides:
> (igc_root_list) {
>   next = NULL
>   prev = 0x00000000006d5f00
>   d = {
>     gc = 0x0000000000726e00
>     root = 0x00007fffe80012a8
>     start = 0x00000000006142e0
>     end = 0x0000000000622f20
>     label = 0x0000000000233fb9 "charset-table"
>     ambig = true
>   }
> }

That's the last root in the list; can you walk the list to try to find
the one labelled "lface-id-to-name"?  My guess is there is no such root.

> (lldb) p start
> (void *) 0x0000000000000000
>
> (lldb) bt
> * thread #1, name = 'temacs', stop reason = signal SIGSEGV: address not mapped to object (fault address=0x20)
>     frame #0: 0x000000000051c953 temacs`igc_xpalloc_lisp_objs_exact [inlined] root_find(start=0x0000000000000000) at igc.c:3111:8
>     frame #1: 0x000000000051c940 temacs`igc_xpalloc_lisp_objs_exact [inlined] igc_destroy_root_with_start(start=0x0000000000000000) at
> igc.c:3135:33
>   * frame #2: 0x000000000051c940 temacs`igc_xpalloc_lisp_objs_exact(pa=(struct Lisp_Symbol *) $7 = 0x0000000000685300,
> nitems=0x0000000000628e18, nitems_incr_min=<unavailable>, nitems_max=<unavailable>, item_size=<unavailable>, label="lface-id-to-name") at
> igc.c:3520:3

Hmm.  I think the value of pa is 0.  That would mean lldb's
interpretation of pa as a pointer to struct Lisp_Symbol (which it isn't)
is incorrect.  Can you print the numeric value of lispsym to confirm
it's 0x685300?

My best guess at this point is that clang deduces that start must be
non-NULL because it's used as the source argument of a 0-byte memcpy.
Can you try replacing the memcpy in igc_xpalloc_lisp_objs_exact with

  if (nitems_old) memcpy (new, old, nitems_old * sizeof old[0]);

?

Thanks!

Pip





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78824; Package emacs. (Wed, 18 Jun 2025 19:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 78824 <at> debbugs.gnu.org (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: Jeff Walsh <fejfighter <at> gmail.com>
Cc: Pip Cet <pipcet <at> protonmail.com>, 78824 <at> debbugs.gnu.org
Subject: Re: bug#78824: [igc] segfault in temacs during build => charset-table
Date: Wed, 18 Jun 2025 21:53:56 +0200
On Wed, Jun 18 2025, Jeff Walsh wrote:

> When building the latest of the IGC branch, commit:
> 887db2ff38ce82bb5f33aa128c76b578caba216d 
>
> I am getting a SEGFAULT during temacs execution.
>
> running under a debugger, this occurs in root_find in igc.c
> `if (r->d.start == start)` (r is null in this case)

I can reproduce this with gcc 14.2, when configured with

  ./configure -C --without-x --with-gnutls=no --with-mps=debug 'CFLAGS=-O2
  -ggdb3 -gctf -fno-omit-frame-pointer -fno-tree-sra
  -I/scratch/emacs/mps-install/include' 'LDFLAGS=-L
  /scratch/emacs/mps-install/lib'

I had to remove --enable-checking.

As Pip suspected, the problem in igc_xpalloc_lisp_objs_exact is that
memcpy is called with old == NULL.  According to [1]: The behavior is
undefined if either dest or src is an invalid or null pointer.  So I
guess that we are in nasal demon territory and the compiler assumes that
old != NULL.

Helmut

[1] https://en.cppreference.com/w/c/string/byte/memcpy




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78824; Package emacs. (Wed, 18 Jun 2025 20:20:03 GMT) Full text and rfc822 format available.

Message #14 received at 78824 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> protonmail.com>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: Jeff Walsh <fejfighter <at> gmail.com>, 78824 <at> debbugs.gnu.org
Subject: Re: bug#78824: [igc] segfault in temacs during build => charset-table
Date: Wed, 18 Jun 2025 20:19:44 +0000
"Helmut Eller" <eller.helmut <at> gmail.com> writes:

> On Wed, Jun 18 2025, Jeff Walsh wrote:
>
>> When building the latest of the IGC branch, commit:
>> 887db2ff38ce82bb5f33aa128c76b578caba216d 
>>
>> I am getting a SEGFAULT during temacs execution.
>>
>> running under a debugger, this occurs in root_find in igc.c
>> `if (r->d.start == start)` (r is null in this case)
>
> I can reproduce this with gcc 14.2, when configured with
>
>   ./configure -C --without-x --with-gnutls=no --with-mps=debug 'CFLAGS=-O2
>   -ggdb3 -gctf -fno-omit-frame-pointer -fno-tree-sra
>   -I/scratch/emacs/mps-install/include' 'LDFLAGS=-L
>   /scratch/emacs/mps-install/lib'
>
> I had to remove --enable-checking.

Et tu, GCC?  Let's hope this rampage of declaring what's logically a
perfectly consistent call to be UB (eventually) goes the way of C99
trigraphs...

Thanks for testing that.  I've applied your second patch and hopefully
that fixes this bug.

Jeff, could you confirm?

Thanks again!

Pip





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78824; Package emacs. (Wed, 18 Jun 2025 22:15:02 GMT) Full text and rfc822 format available.

Message #17 received at 78824 <at> debbugs.gnu.org (full text, mbox):

From: Jeff Walsh <fejfighter <at> gmail.com>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: Helmut Eller <eller.helmut <at> gmail.com>, 78824 <at> debbugs.gnu.org
Subject: Re: bug#78824: [igc] segfault in temacs during build => charset-table
Date: Thu, 19 Jun 2025 08:13:47 +1000
[Message part 1 (text/plain, inline)]
Hi Pip, Helmet,

I can confirm that this is gcc 15.1 on Fedora 42.
CFLAGS are less dramatic: just `-O2 -g`

Building with commit ac73794b43d440d34689293f4152ea38a42bb07a (which I
believe has the patches) works as expected, thankyou.

Jeff Walsh



On Thu, Jun 19, 2025 at 6:19 AM Pip Cet <pipcet <at> protonmail.com> wrote:

> "Helmut Eller" <eller.helmut <at> gmail.com> writes:
>
> > On Wed, Jun 18 2025, Jeff Walsh wrote:
> >
> >> When building the latest of the IGC branch, commit:
> >> 887db2ff38ce82bb5f33aa128c76b578caba216d
> >>
> >> I am getting a SEGFAULT during temacs execution.
> >>
> >> running under a debugger, this occurs in root_find in igc.c
> >> `if (r->d.start == start)` (r is null in this case)
> >
> > I can reproduce this with gcc 14.2, when configured with
> >
> >   ./configure -C --without-x --with-gnutls=no --with-mps=debug
> 'CFLAGS=-O2
> >   -ggdb3 -gctf -fno-omit-frame-pointer -fno-tree-sra
> >   -I/scratch/emacs/mps-install/include' 'LDFLAGS=-L
> >   /scratch/emacs/mps-install/lib'
> >
> > I had to remove --enable-checking.
>
> Et tu, GCC?  Let's hope this rampage of declaring what's logically a
> perfectly consistent call to be UB (eventually) goes the way of C99
> trigraphs...
>
> Thanks for testing that.  I've applied your second patch and hopefully
> that fixes this bug.
>
> Jeff, could you confirm?
>
> Thanks again!
>
> Pip
>
>
[Message part 2 (text/html, inline)]

This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.