Hello, Still trying to write a custom scheduler, I stumbled accross a highly suspicious code in all schedulers. In both ScheduleDAGFast.cpp and ScheduleDAGRRList.cpp, one can find this piece of code: SUnit *CopyFromSU = CreateNewSUnit(NULL); and then in the same files: SUnit *CreateNewSUnit(SDNode *N) { [...] SUnit *NewNode = NewSUnit(N); And finally in ScheduleDAGSDNodes.cpp: SUnit *ScheduleDAGSDNodes::NewSUnit(SDNode *N) { [...] if (N->isMachineOpcode() && [...] So basically, it means that calling CreateNewSUnit with NULL will call NewSUnit with NULL and with result in NULL->isMachineOpcode() which would certainly trigger a segfault. Now I'm highly surprized because I still haven't encountered any segfault in the scheduler yet all schedulers might call this code. So either I'm missing something and this code is valid or this code has not been executed for a *really* long time now and should be removed or fixed. Unfortunately, I don't know the code enough to fix it if it's necessary that's why I'm seeking for help or reviews on this point :) Regards Amaury Pouly -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100808/1feedada/attachment.html>
Thanks for the report. It's been getting lucky. I'll fix it. Evan On Aug 8, 2010, at 6:27 AM, Amaury Pouly wrote:> Hello, > Still trying to write a custom scheduler, I stumbled accross a highly suspicious code in all schedulers. > In both ScheduleDAGFast.cpp and ScheduleDAGRRList.cpp, one can find this piece of code: > > SUnit *CopyFromSU = CreateNewSUnit(NULL); > > and then in the same files: > > SUnit *CreateNewSUnit(SDNode *N) { > [...] > SUnit *NewNode = NewSUnit(N); > > And finally in ScheduleDAGSDNodes.cpp: > > SUnit *ScheduleDAGSDNodes::NewSUnit(SDNode *N) { > [...] > if (N->isMachineOpcode() && [...] > > So basically, it means that calling CreateNewSUnit with NULL will call NewSUnit with NULL and with result in NULL->isMachineOpcode() which would certainly trigger a segfault. > Now I'm highly surprized because I still haven't encountered any segfault in the scheduler yet all schedulers might call this code. > So either I'm missing something and this code is valid or this code has not been executed for a *really* long time now and should be removed or fixed. Unfortunately, I don't know the code enough to fix it if it's necessary that's why I'm seeking for help or reviews on this point :) > > Regards > > Amaury Pouly > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reasonably Related Threads
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?