vibe-d / vibe.d

Official vibe.d development
MIT License
1.15k stars 284 forks source link

Segfault with master in readGradChanges #1369

Open 9il opened 8 years ago

9il commented 8 years ago
#0  0x0000000000b727cb in gc.gc.Gcx.smallAlloc() ()
#1  0x0000000000b70279 in gc.gc.GC.malloc() ()
#2  0x0000000000b197f7 in gc_qalloc ()
#3  0x0000000000b14f30 in core.memory.GC.qalloc() ()
#4  0x00000000008b03ed in std.array.__T8AppenderTAyaZ.Appender.ensureAddable() (this=..., nelems=1) at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/array.d:2775
#5  0x00000000008b250e in std.array.__T8AppenderTAyaZ.Appender.__T3putTaZ.put() (this=..., item=47 '/') at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/array.d:2825
#6  0x00000000009c294a in vibe.inet.path.Path.toString() (this=...) at ../dep/vibe.d/source/vibe/inet/path.d:169
#7  0x00000000009d5ad1 in std.format.__T12formatObjectTS3std5array17__T8AppenderTAyaZ8AppenderTS4vibe4inet4path4PathTaZ.formatObject() (f=..., val=..., w=...) at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/format.d:2819
#8  0x00000000009d5a52 in std.format.__T11formatValueTS3std5array17__T8AppenderTAyaZ8AppenderTS4vibe4inet4path4PathTaZ.formatValue() (f=..., val=..., w=...) at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/format.d:3135
#9  0x00000000008ee57e in std.conv.__T5toStrTAyaTS4vibe4inet4path4PathZ.toStr() (src=...) at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/conv.d:123
#10 0x00000000008ee542 in std.conv.__T6toImplTAyaTS4vibe4inet4path4PathZ.toImpl() (value=...) at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/conv.d:923
#11 0x00000000008ee522 in std.conv.__T2toTAyaZ.__T2toTS4vibe4inet4path4PathZ.to() (_param_0=...) at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/conv.d:298
#12 0x000000000093897a in grad.file_name.readGradChanges() (dc=...) at ../grad_core/source/grad/file_name.d:121
#13 0x00000000009387d8 in std.algorithm.iteration.__T9MapResultS1044grad9file_name15readGradChangesFC4vibe4core4file16DirectoryWatcherAyaS3std8datetime8DateTimeZ9__lambda5TS3std9algorithm9iteration161__T12FilterResultS1044grad9file_name15readGradChangesFC4vibe4core4file16DirectoryWatcherAyaS3std8datetime8DateTimeZ9__lambda4TAS4vibe4core4file15DirectoryChangeZ12FilterResultZ.MapResult.front() (this=...) at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/algorithm/iteration.d:563
#14 0x0000000000938a1e in std.algorithm.iteration.__T12FilterResultS1044grad9file_name15readGradChangesFC4vibe4core4file16DirectoryWatcherAyaS3std8datetime8DateTimeZ9__lambda6TS3std9algorithm9iteration326__T9MapResultS1044grad9file_name15readGradChangesFC4vibe4core4file16DirectoryWatcherAyaS3std8datetime8DateTimeZ9__lambda5TS3std9algorithm9iteration161__T12FilterResultS1044grad9file_name15readGradChangesFC4vibe4core4file16DirectoryWatcherAyaS3std8datetime8DateTimeZ9__lambda4TAS4vibe4core4file15DirectoryChangeZ12FilterResultZ9MapResultZ.FilterResult.__ctor() (this=..., r=...)
    at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/algorithm/iteration.d:985
#15 0x00000000009389d1 in std.algorithm.iteration.__T6filterS1044grad9file_name15readGradChangesFC4vibe4core4file16DirectoryWatcherAyaS3std8datetime8DateTimeZ9__lambda6Z.__T6filterTS3std9algorithm9iteration326__T9MapResultS1044grad9file_name15readGradChangesFC4vibe4core4file16DirectoryWatcherAyaS3std8datetime8DateTimeZ9__lambda5TS3std9algorithm9iteration161__T12FilterResultS1044grad9file_name15readGradChangesFC4vibe4core4file16DirectoryWatcherAyaS3std8datetime8DateTimeZ9__lambda4TAS4vibe4core4file15DirectoryChangeZ12FilterResultZ9MapResultZ.filter() (this=0x7fffc0718880, __HID303=0x7fff627fea50, range=...)
    at /home/alexey/repos/imo.im/build/third_party/dmd.2.070.0-b1.linux/dmd2/linux/bin64/../../src/phobos/std/algorithm/iteration.d:944
#16 0x0000000000935c82 in grad.file_name.readGradChanges() (startTime=..., typeMatch=..., directoryWatcher=0x7ffff7fb46d0) at ../grad_core/source/grad/file_name.d:119
#17 0x00000000009242b9 in file_monitor.FileMonitor.start() (this=0x7ffff7ef8600) at source/file_monitor.d:159
#18 0x00000000009238d4 in file_monitor.Feeder.__ctor() (fileMonitor=0x7ffff7ef8600) at source/file_monitor.d:33
#19 0x0000000000965f7d in vibe.core.core.__T16makeTaskFuncInfoTPFOC12file_monitor11FileMonitorZvTOC12file_monitor11FileMonitorZ.makeTaskFuncInfo() (tfi=0x7fff627fee10) at ../dep/vibe.d/source/vibe/core/core.d-mixin-498:498
#20 0x0000000000961500 in vibe.core.core.CoreTask.run() (this=0x7ffff7f80000) at ../dep/vibe.d/source/vibe/core/core.d:1080
#21 0x0000000000b6e162 in core.thread.Fiber.run() ()
#22 0x0000000000b6dedc in fiber_entryPoint ()
#23 0x0000000000000000 in ?? ()
s-ludwig commented 8 years ago

Hm, so it crashes in the GC when calling Path.toString()? readGradChanges isn't from vibe.d, or does it internally use the file system watcher?

Judging by the call stack it doesn't look that likely that this is a vibe.d issue. Rather something in the GC if it's really just a segfault. It could of course be a memory corruption issue...

9il commented 8 years ago

Judging by the call stack it doesn't look that likely that this is a vibe.d issue. Rather something in the GC if it's really just a segfault. It could of course be a memory corruption issue...

It is very strange crash. It happens when vibe.d, GC, and inotify meet each other. This failure happens both with vibe.d + https://github.com/DmitryOlshansky/dinotify and vibe.d + libevent driver.

9il commented 8 years ago

Hm, so it crashes in the GC when calling Path.toString()? readGradChanges isn't from vibe.d, or does it internally use the file system watcher?

It happens during GC allocation (when GC collect). Path.toString is OK