Subject: bug#58232: 29.0.50; alloc.c:879: assertion failed: 0 < item_size && 0 < nitems_incr_min && 0 <= n0 && -1 <= nitems_max

From: Visuwesh <[email-masked]>
Date: Sun, 02 Oct 2022 14:47:33 +0530

[Sunday October 02, 2022] Eli Zaretskii wrote:

>> From: Visuwesh <[email-masked]>
>> Cc: [email-masked]
>> Date: Sun, 02 Oct 2022 14:07:54 +0530
>> 
>> Reading symbols from emacs...
>> [New LWP 6962]
>> [Thread debugging using libthread_db enabled]
>> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>> Core was generated by `emacs -Q'.
>> Program terminated with signal SIGABRT, Aborted.
>> (gdb) bt
>> #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
>> #1  0x00007f854d4895df in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
>> #2  0x00007f854d43da02 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
>> #3  0x000055a416dac32d in terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:458
>> #4  0x000055a416e6712d in die (msg=0x55a41702d090 "0 < item_size && 0 < nitems_incr_min && 0 <= n0 && -1 <= nitems_max", file=0x55a41702d06b "alloc.c", line=879) at alloc.c:7672
>> #5  0x000055a416e5a9be in xpalloc (pa=0x0, nitems=0x7fffc2172868, nitems_incr_min=-87, nitems_max=-1, item_size=1) at alloc.c:879
>> #6  0x000055a416dad158 in load_pdump (argc=2, argv=0x7fffc2172b98) at emacs.c:935
>> #7  0x000055a416dade3a in main (argc=2, argv=0x7fffc2172b98) at emacs.c:1359
>> (gdb) 
>
> Please show the values of some variables in frame #6.  Like this:
>
>   (gdb) frame 6
>   (gdb) p needed
>   (gdb) p bufsize
>   (gdb) p exenamelen
>   (gdb) p emacs_executable
>   (gdb) p suffix

(gdb) frame 6
#6  0x000055a416dad158 in load_pdump (argc=2, argv=0x7fffc2172b98) at emacs.c:935
935	  dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1);
(gdb) p needed
$1 = 41
(gdb) p bufsize
$2 = 128
(gdb) p exenamelen
$3 = 35
(gdb) p emacs_executable
$4 = 0x55a41793af20 "/home/viz/lib/ports/emacs/src/emacs"
(gdb) p suffix
$5 = 0x55a41701a648 ".pdmp"