Vapor crash

*** Error in `./Run': double free or corruption (!prev): 0x00007fd6dc04fc00 ***

======= Backtrace: =========

/lib64/libc.so.6(+0x81679)[0x7fd6ebcc3679]

./Run(+0x13b602b)[0x55ad25dba02b]

./Run(+0x131a788)[0x55ad25d1e788]

./Run(+0x131af7a)[0x55ad25d1ef7a]

./Run(+0x131aff9)[0x55ad25d1eff9]

./Run(+0x1301458)[0x55ad25d05458]

./Run(+0x1301619)[0x55ad25d05619]

./Run(+0x11a0212)[0x55ad25ba4212]

./Run(+0x10851c9)[0x55ad25a891c9]

./Run(+0xe90a3b)[0x55ad25894a3b]

./Run(+0xf5c897)[0x55ad25960897]

@0xTim How to debug crashes

Can you provide more details on your app, such as the Vapor version it is using, what platform and version it is running on when it crashes, etc.

There's not enough information here to help right now.

At a minimum, I'd suggest having a read of the Vapor basics on errors: Vapor: Basics → Errors

Platform: swift:5.5.2-centos7
Vapor 4.55.0

*** Error in `./Run': double free or corruption (!prev): 0x00007fd6dc04fc00 ***

======= Backtrace: =========

/lib64/libc.so.6(+0x81679)[0x7fd6ebcc3679]

./Run(+0x13b602b)[0x55ad25dba02b]

./Run(+0x131a788)[0x55ad25d1e788]

./Run(+0x131af7a)[0x55ad25d1ef7a]

./Run(+0x131aff9)[0x55ad25d1eff9]

./Run(+0x1301458)[0x55ad25d05458]

./Run(+0x1301619)[0x55ad25d05619]

./Run(+0x11a0212)[0x55ad25ba4212]

./Run(+0x10851c9)[0x55ad25a891c9]

./Run(+0xe90a3b)[0x55ad25894a3b]

./Run(+0xf5c897)[0x55ad25960897]

======= Memory map: ========

55ad24a04000-55ad28038000 r-xp 00000000 07:02 1 /var/user/Run

55ad28038000-55ad280fe000 r--p 03633000 07:02 1 /var/user/Run

55ad280fe000-55ad28149000 rw-p 036f9000 07:02 1 /var/user/Run

55ad28149000-55ad281eb000 rw-p 00000000 00:00 0

55ad2a0b4000-55ad2a0d5000 rw-p 00000000 00:00 0 [heap]

7fd68cfd2000-7fd68cfd3000 ---p 00000000 00:00 0

7fd68cfd3000-7fd68d7d3000 rw-p 00000000 00:00 0

7fd68d7d3000-7fd68d7d4000 ---p 00000000 00:00 0

7fd68d7d4000-7fd68dfd4000 rw-p 00000000 00:00 0

7fd68dfd4000-7fd68dfd5000 ---p 00000000 00:00 0

7fd68dfd5000-7fd68e7d5000 rw-p 00000000 00:00 0

7fd68e7d5000-7fd68e7d6000 ---p 00000000 00:00 0

7fd68e7d6000-7fd68efd6000 rw-p 00000000 00:00 0

7fd68efd6000-7fd68efd7000 ---p 00000000 00:00 0

7fd68efd7000-7fd68f7d7000 rw-p 00000000 00:00 0

7fd68f7d7000-7fd68f7d8000 ---p 00000000 00:00 0

7fd68f7d8000-7fd68ffd8000 rw-p 00000000 00:00 0

7fd68ffd8000-7fd68ffd9000 ---p 00000000 00:00 0

7fd68ffd9000-7fd6907d9000 rw-p 00000000 00:00 0

7fd6907d9000-7fd6907da000 ---p 00000000 00:00 0

7fd6907da000-7fd690fda000 rw-p 00000000 00:00 0

7fd690fda000-7fd690fdb000 ---p 00000000 00:00 0

7fd690fdb000-7fd6917db000 rw-p 00000000 00:00 0

7fd6917db000-7fd6917dc000 ---p 00000000 00:00 0

7fd6917dc000-7fd691fdc000 rw-p 00000000 00:00 0

7fd691fdc000-7fd691fdd000 ---p 00000000 00:00 0

7fd691fdd000-7fd6927dd000 rw-p 00000000 00:00 0

7fd6927dd000-7fd6927de000 ---p 00000000 00:00 0

7fd6927de000-7fd692fde000 rw-p 00000000 00:00 0

7fd692fde000-7fd692fdf000 ---p 00000000 00:00 0

7fd692fdf000-7fd6937df000 rw-p 00000000 00:00 0

7fd6937df000-7fd6937e0000 ---p 00000000 00:00 0

7fd6937e0000-7fd693fe0000 rw-p 00000000 00:00 0

7fd693fe0000-7fd693fe1000 ---p 00000000 00:00 0

7fd693fe1000-7fd6947e1000 rw-p 00000000 00:00 0

7fd6947e1000-7fd6947e2000 ---p 00000000 00:00 0

7fd6947e2000-7fd694fe2000 rw-p 00000000 00:00 0

7fd694fe2000-7fd694fe3000 ---p 00000000 00:00 0

7fd694fe3000-7fd6957e3000 rw-p 00000000 00:00 0

7fd6957e3000-7fd6957e4000 ---p 00000000 00:00 0

7fd6957e4000-7fd695fe4000 rw-p 00000000 00:00 0

7fd695fe4000-7fd695fe5000 ---p 00000000 00:00 0

7fd695fe5000-7fd6967e5000 rw-p 00000000 00:00 0

7fd6967e5000-7fd6967e6000 ---p 00000000 00:00 0

7fd6967e6000-7fd696fe6000 rw-p 00000000 00:00 0

7fd696fe6000-7fd696fe7000 ---p 00000000 00:00 0

7fd696fe7000-7fd6977e7000 rw-p 00000000 00:00 0

7fd6977e7000-7fd6977e8000 ---p 00000000 00:00 0

7fd6977e8000-7fd697fe8000 rw-p 00000000 00:00 0

7fd697fe8000-7fd697fe9000 ---p 00000000 00:00 0

7fd697fe9000-7fd6987e9000 rw-p 00000000 00:00 0

7fd6987e9000-7fd6987ea000 ---p 00000000 00:00 0

7fd6987ea000-7fd698fea000 rw-p 00000000 00:00 0

7fd698fea000-7fd698feb000 ---p 00000000 00:00 0

7fd698feb000-7fd6997eb000 rw-p 00000000 00:00 0

7fd6997eb000-7fd6997ec000 ---p 00000000 00:00 0

7fd6997ec000-7fd699fec000 rw-p 00000000 00:00 0

7fd699fec000-7fd699fed000 ---p 00000000 00:00 0

7fd699fed000-7fd69a7ed000 rw-p 00000000 00:00 0

7fd69a7ed000-7fd69a7ee000 ---p 00000000 00:00 0

7fd69a7ee000-7fd69afee000 rw-p 00000000 00:00 0

7fd69afee000-7fd69afef000 ---p 00000000 00:00 0

7fd69afef000-7fd69b7ef000 rw-p 00000000 00:00 0

7fd69b7ef000-7fd69b7f0000 ---p 00000000 00:00 0

7fd69b7f0000-7fd69bff0000 rw-p 00000000 00:00 0

7fd69bff0000-7fd69bff1000 ---p 00000000 00:00 0

7fd69bff1000-7fd69c7f1000 rw-p 00000000 00:00 0

7fd69c7f1000-7fd69c7f2000 ---p 00000000 00:00 0

7fd69c7f2000-7fd69cff2000 rw-p 00000000 00:00 0

7fd69cff2000-7fd69cff3000 ---p 00000000 00:00 0

7fd69cff3000-7fd69d7f3000 rw-p 00000000 00:00 0

7fd69d7f3000-7fd69d7f4000 ---p 00000000 00:00 0

7fd69d7f4000-7fd69dff4000 rw-p 00000000 00:00 0

7fd69dff4000-7fd69dff5000 ---p 00000000 00:00 0

7fd69dff5000-7fd69e7f5000 rw-p 00000000 00:00 0

7fd69e7f5000-7fd69e7f6000 ---p 00000000 00:00 0

7fd69e7f6000-7fd69eff6000 rw-p 00000000 00:00 0

7fd69eff6000-7fd69eff7000 ---p 00000000 00:00 0

7fd69eff7000-7fd69f7f7000 rw-p 00000000 00:00 0

7fd69f7f7000-7fd69f7f8000 ---p 00000000 00:00 0

7fd69f7f8000-7fd69fff8000 rw-p 00000000 00:00 0

7fd69fff8000-7fd69fff9000 ---p 00000000 00:00 0

7fd69fff9000-7fd6a07f9000 rw-p 00000000 00:00 0

7fd6a07f9000-7fd6a07fa000 ---p 00000000 00:00 0

7fd6a07fa000-7fd6a0ffa000 rw-p 00000000 00:00 0

7fd6a0ffa000-7fd6a0ffb000 ---p 00000000 00:00 0

7fd6a0ffb000-7fd6a17fb000 rw-p 00000000 00:00 0

7fd6a17fb000-7fd6a17fc000 ---p 00000000 00:00 0

7fd6a17fc000-7fd6a1ffc000 rw-p 00000000 00:00 0

7fd6a1ffc000-7fd6a1ffd000 ---p 00000000 00:00 0

7fd6a1ffd000-7fd6a27fd000 rw-p 00000000 00:00 0

7fd6a27fd000-7fd6a27fe000 ---p 00000000 00:00 0

7fd6a27fe000-7fd6a2ffe000 rw-p 00000000 00:00 0

7fd6a2ffe000-7fd6a2fff000 ---p 00000000 00:00 0

7fd6a2fff000-7fd6a37ff000 rw-p 00000000 00:00 0

7fd6a37ff000-7fd6a3800000 ---p 00000000 00:00 0

7fd6a3800000-7fd6a4000000 rw-p 00000000 00:00 0

7fd6a4000000-7fd6a4021000 rw-p 00000000 00:00 0

7fd6a4021000-7fd6a8000000 ---p 00000000 00:00 0

7fd6a8000000-7fd6a8021000 rw-p 00000000 00:00 0

7fd6a8021000-7fd6ac000000 ---p 00000000 00:00 0

7fd6ac000000-7fd6ac021000 rw-p 00000000 00:00 0

7fd6ac021000-7fd6b0000000 ---p 00000000 00:00 0

7fd6b0000000-7fd6b0021000 rw-p 00000000 00:00 0

7fd6b0021000-7fd6b4000000 ---p 00000000 00:00 0

7fd6b4000000-7fd6b4021000 rw-p 00000000 00:00 0

7fd6b4021000-7fd6b8000000 ---p 00000000 00:00 0

7fd6b8000000-7fd6b8021000 rw-p 00000000 00:00 0

7fd6b8021000-7fd6bc000000 ---p 00000000 00:00 0

7fd6bc000000-7fd6bc021000 rw-p 00000000 00:00 0

7fd6bc021000-7fd6c0000000 ---p 00000000 00:00 0

7fd6c07f9000-7fd6c07fa000 ---p 00000000 00:00 0

7fd6c07fa000-7fd6c0ffa000 rw-p 00000000 00:00 0

7fd6c0ffa000-7fd6c0ffb000 ---p 00000000 00:00 0

7fd6c0ffb000-7fd6c17fb000 rw-p 00000000 00:00 0

7fd6c17fb000-7fd6c17fc000 ---p 00000000 00:00 0

7fd6c17fc000-7fd6c1ffc000 rw-p 00000000 00:00 0

7fd6c1ffc000-7fd6c1ffd000 ---p 00000000 00:00 0

7fd6c1ffd000-7fd6c27fd000 rw-p 00000000 00:00 0

7fd6c27fd000-7fd6c27fe000 ---p 00000000 00:00 0

7fd6c27fe000-7fd6c2ffe000 rw-p 00000000 00:00 0

7fd6c2ffe000-7fd6c2fff000 ---p 00000000 00:00 0

7fd6c2fff000-7fd6c37ff000 rw-p 00000000 00:00 0

7fd6c37ff000-7fd6c3800000 ---p 00000000 00:00 0

7fd6c3800000-7fd6c4000000 rw-p 00000000 00:00 0

7fd6c4000000-7fd6c4021000 rw-p 00000000 00:00 0

7fd6c4021000-7fd6c8000000 ---p 00000000 00:00 0

7fd6c8000000-7fd6c8021000 rw-p 00000000 00:00 0

7fd6c8021000-7fd6cc000000 ---p 00000000 00:00 0

7fd6cc000000-7fd6cc021000 rw-p 00000000 00:00 0

7fd6cc021000-7fd6d0000000 ---p 00000000 00:00 0

7fd6d0000000-7fd6d0021000 rw-p 00000000 00:00 0

7fd6d0021000-7fd6d4000000 ---p 00000000 00:00 0

7fd6d4000000-7fd6d4021000 rw-p 00000000 00:00 0

7fd6d4021000-7fd6d8000000 ---p 00000000 00:00 0

7fd6d87f9000-7fd6d87fa000 ---p 00000000 00:00 0

7fd6d87fa000-7fd6d8ffa000 rw-p 00000000 00:00 0

7fd6d8ffa000-7fd6d8ffb000 ---p 00000000 00:00 0

7fd6d8ffb000-7fd6d97fb000 rw-p 00000000 00:00 0

7fd6d97fb000-7fd6d97fc000 ---p 00000000 00:00 0

7fd6d97fc000-7fd6d9ffc000 rw-p 00000000 00:00 0

7fd6d9ffc000-7fd6d9ffd000 ---p 00000000 00:00 0

7fd6d9ffd000-7fd6da7fd000 rw-p 00000000 00:00 0

7fd6da7fd000-7fd6da7fe000 ---p 00000000 00:00 0

7fd6da7fe000-7fd6daffe000 rw-p 00000000 00:00 0

7fd6daffe000-7fd6dafff000 ---p 00000000 00:00 0

7fd6dafff000-7fd6db7ff000 rw-p 00000000 00:00 0

7fd6db7ff000-7fd6db800000 ---p 00000000 00:00 0

7fd6db800000-7fd6dc000000 rw-p 00000000 00:00 0

7fd6dc000000-7fd6dc055000 rw-p 00000000 00:00 0

7fd6dc055000-7fd6e0000000 ---p 00000000 00:00 0

7fd6e0000000-7fd6e0021000 rw-p 00000000 00:00 0

7fd6e0021000-7fd6e4000000 ---p 00000000 00:00 0

7fd6e4000000-7fd6e407b000 rw-p 00000000 00:00 0

7fd6e407b000-7fd6e8000000 ---p 00000000 00:00 0

7fd6e843b000-7fd6e843c000 ---p 00000000 00:00 0

7fd6e843c000-7fd6e8c3c000 rw-p 00000000 00:00 0

7fd6e8c3c000-7fd6e8c3d000 ---p 00000000 00:00 0

7fd6e8c3d000-7fd6e943d000 rw-p 00000000 00:00 0

7fd6e943d000-7fd6e943e000 ---p 00000000 00:00 0

7fd6e943e000-7fd6e9c3e000 rw-p 00000000 00:00 0

7fd6e9c3e000-7fd6e9c3f000 ---p 00000000 00:00 0

7fd6e9c3f000-7fd6ea43f000 rw-p 00000000 00:00 0

7fd6ea43f000-7fd6ea440000 ---p 00000000 00:00 0

7fd6ea440000-7fd6eac40000 rw-p 00000000 00:00 0

7fd6eac40000-7fd6eac41000 ---p 00000000 00:00 0

7fd6eac41000-7fd6eb441000 rw-p 00000000 00:00 0

7fd6eb441000-7fd6eb442000 ---p 00000000 00:00 0

7fd6eb442000-7fd6ebc42000 rw-p 00000000 00:00 0

7fd6ebc42000-7fd6ebe05000 r-xp 00000000 fd:01 406571 /usr/lib64/libc-2.17.so

7fd6ebe05000-7fd6ec005000 ---p 001c3000 fd:01 406571 /usr/lib64/libc-2.17.so

7fd6ec005000-7fd6ec009000 r--p 001c3000 fd:01 406571 /usr/lib64/libc-2.17.so

7fd6ec009000-7fd6ec00b000 rw-p 001c7000 fd:01 406571 /usr/lib64/libc-2.17.so

7fd6ec00b000-7fd6ec010000 rw-p 00000000 00:00 0

7fd6ec010000-7fd6ec025000 r-xp 00000000 fd:01 406536 /usr/lib64/libgcc_s-4.8.5-20150702.so.1

7fd6ec025000-7fd6ec224000 ---p 00015000 fd:01 406536 /usr/lib64/libgcc_s-4.8.5-20150702.so.1

7fd6ec224000-7fd6ec225000 r--p 00014000 fd:01 406536 /usr/lib64/libgcc_s-4.8.5-20150702.so.1

7fd6ec225000-7fd6ec226000 rw-p 00015000 fd:01 406536 /usr/lib64/libgcc_s-4.8.5-20150702.so.1

7fd6ec226000-7fd6ec23b000 r-xp 00000000 fd:01 405118 /usr/lib64/libz.so.1.2.7

7fd6ec23b000-7fd6ec43a000 ---p 00015000 fd:01 405118 /usr/lib64/libz.so.1.2.7

7fd6ec43a000-7fd6ec43b000 r--p 00014000 fd:01 405118 /usr/lib64/libz.so.1.2.7

7fd6ec43b000-7fd6ec43c000 rw-p 00015000 fd:01 405118 /usr/lib64/libz.so.1.2.7

7fd6ec43c000-7fd6ec43e000 r-xp 00000000 fd:01 405384 /usr/lib64/libdl-2.17.so

7fd6ec43e000-7fd6ec63e000 ---p 00002000 fd:01 405384 /usr/lib64/libdl-2.17.so

7fd6ec63e000-7fd6ec63f000 r--p 00002000 fd:01 405384 /usr/lib64/libdl-2.17.so

7fd6ec63f000-7fd6ec640000 rw-p 00003000 fd:01 405384 /usr/lib64/libdl-2.17.so

7fd6ec640000-7fd6ec642000 r-xp 00000000 fd:01 403645 /usr/lib64/libutil-2.17.so

7fd6ec642000-7fd6ec841000 ---p 00002000 fd:01 403645 /usr/lib64/libutil-2.17.so

7fd6ec841000-7fd6ec842000 r--p 00001000 fd:01 403645 /usr/lib64/libutil-2.17.so

7fd6ec842000-7fd6ec843000 rw-p 00002000 fd:01 403645 /usr/lib64/libutil-2.17.so

7fd6ec843000-7fd6ec85a000 r-xp 00000000 fd:01 408226 /usr/lib64/libpthread-2.17.so

7fd6ec85a000-7fd6eca59000 ---p 00017000 fd:01 408226 /usr/lib64/libpthread-2.17.so

7fd6eca59000-7fd6eca5a000 r--p 00016000 fd:01 408226 /usr/lib64/libpthread-2.17.so

7fd6eca5a000-7fd6eca5b000 rw-p 00017000 fd:01 408226 /usr/lib64/libpthread-2.17.so

7fd6eca5b000-7fd6eca5f000 rw-p 00000000 00:00 0

7fd6eca5f000-7fd6ecb60000 r-xp 00000000 fd:01 406445 /usr/lib64/libm-2.17.so

7fd6ecb60000-7fd6ecd5f000 ---p 00101000 fd:01 406445 /usr/lib64/libm-2.17.so

7fd6ecd5f000-7fd6ecd60000 r--p 00100000 fd:01 406445 /usr/lib64/libm-2.17.so

7fd6ecd60000-7fd6ecd61000 rw-p 00101000 fd:01 406445 /usr/lib64/libm-2.17.so

7fd6ecd61000-7fd6ecd83000 r-xp 00000000 fd:01 406509 /usr/lib64/ld-2.17.so

7fd6ecf32000-7fd6ecf7a000 rw-p 00000000 00:00 0

7fd6ecf7f000-7fd6ecf82000 rw-p 00000000 00:00 0

7fd6ecf82000-7fd6ecf83000 r--p 00021000 fd:01 406509 /usr/lib64/ld-2.17.so

7fd6ecf83000-7fd6ecf84000 rw-p 00022000 fd:01 406509 /usr/lib64/ld-2.17.so

7fd6ecf84000-7fd6ecf85000 rw-p 00000000 00:00 0

7fff36e60000-7fff36e81000 rw-p 00000000 00:00 0 [stack]

7fff36f13000-7fff36f17000 r--p 00000000 00:00 0 [vvar]

7fff36f17000-7fff36f19000 r-xp 00000000 00:00 0 [vdso]

ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

just a demo

Your use of DateFormatter is not thread-safe: the Linux version of DateFormatter cannot safely be modified from multiple threads. Move your creation of DateFormatter inside your .get request and you'll be fine.

Try installing tzdata to the run image.

The error is extremely unhelpful here from the compiler

I thought the Linux DateFormatter was now thread safe?

The code says otherwise.

Okay thank you

That's frustrating, guess I can raise an issue on GH now!

2 Likes

It's this one: [SR-7745] DateFormatter implemented in swift-corelibs-foundation isn't thread safe · Issue #50285 · apple/swift · GitHub