Skip to content

Memory corruption when using '%M' #1

Description

@fmv1992

Issuing:

LC_ALL=fa_IR.UTF-8 pjdate -f '%A %B %Y-%M'

Gives:

*** Error in `pjdate': malloc(): memory corruption: 0x0000000000c0e280 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fb00e2f97e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8213e)[0x7fb00e30413e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7fb00e306184]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_doallocate+0x55)[0x7fb00e2ef1d5]
/lib/x86_64-linux-gnu/libc.so.6(_IO_doallocbuf+0x34)[0x7fb00e2fd594]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_overflow+0x1c8)[0x7fb00e2fc8f8]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_xsputn+0xad)[0x7fb00e2fb28d]
/lib/x86_64-linux-gnu/libc.so.6(_IO_puts+0xa8)[0x7fb00e2f1738]
pjdate[0x400d09]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fb00e2a2830]
pjdate[0x400d99]
======= Memory map: ========
00400000-00404000 r-xp 00000000 fd:01 2886806                            /usr/local/bin/pjdate
00603000-00604000 r--p 00003000 fd:01 2886806                            /usr/local/bin/pjdate
00604000-00605000 rw-p 00004000 fd:01 2886806                            /usr/local/bin/pjdate
00c0d000-00c2e000 rw-p 00000000 00:00 0                                  [heap]
7fb008000000-7fb008021000 rw-p 00000000 00:00 0 
7fb008021000-7fb00c000000 ---p 00000000 00:00 0 
7fb00e06c000-7fb00e082000 r-xp 00000000 fd:01 2621458                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7fb00e082000-7fb00e281000 ---p 00016000 fd:01 2621458                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7fb00e281000-7fb00e282000 rw-p 00015000 fd:01 2621458                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7fb00e282000-7fb00e442000 r-xp 00000000 fd:01 2625956                    /lib/x86_64-linux-gnu/libc-2.23.so
7fb00e442000-7fb00e642000 ---p 001c0000 fd:01 2625956                    /lib/x86_64-linux-gnu/libc-2.23.so
7fb00e642000-7fb00e646000 r--p 001c0000 fd:01 2625956                    /lib/x86_64-linux-gnu/libc-2.23.so
7fb00e646000-7fb00e648000 rw-p 001c4000 fd:01 2625956                    /lib/x86_64-linux-gnu/libc-2.23.so
7fb00e648000-7fb00e64c000 rw-p 00000000 00:00 0 
7fb00e64c000-7fb00e672000 r-xp 00000000 fd:01 2625954                    /lib/x86_64-linux-gnu/ld-2.23.so
7fb00e850000-7fb00e853000 rw-p 00000000 00:00 0 
7fb00e870000-7fb00e871000 rw-p 00000000 00:00 0 
7fb00e871000-7fb00e872000 r--p 00025000 fd:01 2625954                    /lib/x86_64-linux-gnu/ld-2.23.so
7fb00e872000-7fb00e873000 rw-p 00026000 fd:01 2625954                    /lib/x86_64-linux-gnu/ld-2.23.so
7fb00e873000-7fb00e874000 rw-p 00000000 00:00 0 
7ffec9992000-7ffec99b3000 rw-p 00000000 00:00 0                          [stack]
7ffec99da000-7ffec99dd000 r--p 00000000 00:00 0                          [vvar]
7ffec99dd000-7ffec99df000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
[1]    17496 abort (core dumped)  LC_ALL=fa_IR.UTF-8 pjdate -f '%A %B %Y-%M'

It looks like the month is the cause of the error here.

For reference:

date

Gives:

Sun Sep 23 14:46:53 -03 2018

Thanks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions