-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track Chapel Bugs #9
Comments
None of these issues at this point are pressing for us or in general for Chapel, I think. I can take care of them when I am looking for something lightweight. Feel free to do it yourself, if you wish. Could be a good practice in contributing to Chapel. |
Uh... Engin... you might want to have a look at the first one again. I got the same issue with EmptyEnum.chpl enum CausesA { CRASH } DriverProgram.chpl proc main() {} I apologize if it isn't in the format specified in the document you linked (felt I had to immediately report it). This bug seems rather significant. I'm also assuming in Edit: According to this, it doesn't make any sense. You can add all you want to the module (in fact it triggered from a module with like ~100 lines of code), and it even triggers in |
Probably more significant than I thought, but still one thing that is not clear to me is that why you would compile these two files together? i.e. I think you are still right that this behavior is awkward, but still seems to be a corner case that has no implication on real world use. Am I missing something?
Not so sure about that. Compiler may be creating a file scope module that wraps the BigInteger module. In which case, the block of the file scope module would have a single AST node (
I am not sure if I am understanding right. But I wouldn't want you to try to fix this. What you can do is to create an issue/future for the team to solve this (or any similar future problem). Compiler work is never as easy as it may seem. Further, for this case, the comment before the assertion shows that this assertion was inserted there to close another edge case bug which triggers a segfault. Two questions:
|
This more or less comes up as an obstacle/road-block but its easy enough to work around it, just requires a bit more effort. I can create a makefile which only builds specific files, but I liked the feature of compiling every single file in my repository and just have the compiler discard the ones I'm currently not using. I was debating on whether or not having a makefile per sub-directory would be best and just call it recursively or have a single global makefile which builds only specific files based on arguments passed, but when I move/rename/add files I have to make the proper adjustments. Which do you think I should use?
I think if you submitted it (but linked me to it) so I can see how to do it myself next time, it'd be best. |
It looks like this is something you probably need to accept :( Even if we open the issue, there is no guarantee it will be solved right away.
Will try to do it this week. |
Hey @e-kayrakli , I found another bug that relates to type inference from the compiler... Although to be sure, I'd need to figure out how to query more information about the type. Currently, it seems much more like undefined behavior and seems difficult to produce a MWE for. It has to do with generic inheritance and polymorphism/dynamic dispatch. I'm not sure precisely why. I'm wondering if by a glance you can pinpoint the issue... So, here is the declaration of the field. If I change it to the following: var localQueues : [cyclicDomain] Queue(eltType); It will produce undefined behavior. In one case, it ended up looping infinitely here, which if this occurs then uncommenting this line, it works fine. This was however when I had use my global makefile script. Later, when I decided to make the necessary changes so that I can run only the required files, seen here, the behavior changed... this time, the returned value is garbage. It produces random values, which definitely is undefined behavior. As before, uncommenting this line fixes the issue. I kind of need to make this change so I can inject different kind of queues into benchmarks and tests, the base class seen here. Finally, to put the final nail in the coffin... here, if we change it to... var boardQueue : Queue(26 * int) = new DistributedFIFOQueue(26 * int); It says:
To Build Run: Note: Bug occurs with and without |
For the race condition: Are you sure you don't have a race in Looking into dynamic dispatch issue... |
Dynamic dispatch: Your formals are not identical. See 15.2.5 in specs:
|
You mean using the main program for
CCQueue.enqueue matches Queue.enqueue. CCQueue.dequeue matches Queue.dequeue. Furthermore, it does not make sense for as to why inside of |
For emphasis, if you see deadlock, try it both when you change the type of the queue to |
Also, I realized now that |
No, I mean NQueens. make NQueens && for t in `seq 1 10`; do ./a.out; done Deadlocks on There are two separate issues: mismatching function signatures causing dynamic dispatch to not work, and a possible deadlock in NQueens. Uncommenting
Aren't you trying to do dynamic dispatch between Queue and DistributedFIFOQueue? |
NQueens itself does not contain a deadlock, as it only spins like that inside of
I'm certain it isn't a race condition at all. If you uncomment the line, the line after it states that it is spinning, it works. This added synchronization from |
Hey Engin, in terms of removing first class functions in it's entirety (and to get it out of the way, with hopeful benefit of eliminating that undefined behavior bug), I had an idea... Classes as First Class Function ObjectsThis is separate from the idea of functors in functional programming (that requires working first class functions :P), but more like C++'s functional objects. The idea is to have something similar to Java's functional interface, where you define an implementation of an interface (although I'm curious: are anonymous objects supported? Are they stable to use if so?). (I'm just teasing btw, Chapel is an amazing language, can't wait to help it grow more!) class BaseFunctor {
// Needed because it is created before it is passed the actual, so can't have
// compiler infer type.
type dataType;
// Perform some operation in mutual exclusion (guaranteed by CCLock).
// Is there a better way to manage types? The return type can vary
// from operation to operation; I.E: Enqueue returns void normally,
// a Dequeue return void normally. However, CCNode requires a dummy node, and so
// we don't know the actual type at initialization time...
proc op(data : dataType);
} As noted above, this is the 'Chicken-Or-The-Egg' problem. The return type is determined by the implementer, but we require a dummy node with space allocated of the same type. Any generic function requires us to know the type, we can't just query it (which the prime issue, what if we don't know? Why can't we just ask it knowing it has to know it???). For Usagevar lock$ : cclock(dataType);
// Custom operator! Pretty cool looking! This would make cclock a higher higher order function!
lock$ >>= new BaseFunctor(dataType) { proc op(data) { ... } }; Where lock$ would call AlternativesInline LogicAn example of the equivalent code that is inlined... // Code used to do action as combiner thread goes here...
...
// Code that is specific to our logic...
doSomethingWith(data);
// Rest of code to complete action, etc.
... Imagine that copy-pasted all over the place... Bleh! Push idea back until after evaluationsThis is something of which, at this point, I guess I can do if the above isn't possible... I'd need to rerun and re-tune benchmarks again to collect data, but its saves a ton of time. |
Hm, actually perhaps I should just go ahead and use sync vars for now. CCLock would be an optimization in and of itself, so I can insert/inject that in after I know I have everything else. Edit: Okay, so replacing it with Edit2: I see it now... it is halting! Wow... unexpected... This is actually... really bad... I can't believe there is no way to determine exactly where all tasks locally are. Its not a sync var deadlock as I used Edit3: Installing Windows Driver Kit overnight so I can analyze the program itself. Might also have to know how to generate C the code as well (can I have a reminder?). Going to have to do a lot of debugging this weekend if it can't be solved by tomorrow. Edit4: I have an exam soon but could not resist to test again... confirmed it is not NQueens. I literally have a busy loop and one of the issues (where I declared as parent type in DistributedFIFOQueue) shows up, and a new one (where I get internal segfault during compilation when I assign DistributedFIFOQueue to a variable with parent type Queue). More testing results as I go on... Edit5: While the original issues are present (regarding dynamic dispatch), the deadlock issue definitely seems to be specific to NQueens. |
Hm, nevermind, race condition is still there... Edit: So, now I get a compiler internal segfault trying to compile it... might have to spend rest of day trying to figure out a decent MWE. Output:
It happens on both 1.16 pre-release (master) and 1.15 (release).
Edit 2: Issue seemed to resolve itself when I removed one of the queues that was derived from the same parent.. at least I know where to start. |
I'm thinking... I know you mentioned a lot I should try to keep everything self-contained (especially for |
Does this latest bug still persist? Let me know if you want me to take a closer look. |
This is a meta-issue to keep a TODO list of Chapel implementation bugs we found/reported:
BigInteger
, but never gets used itself: First Class Functions and Type System #3 (comment)Issue now reported: chapel-lang/chapel#6536
Issue: chapel-lang/chapel#6538
Issue: chapel-lang/chapel#6542
ref
intent causes incorrect types during code generation.Issue: chapel-lang/chapel#6642 -- only adresses the problem partially
SHA: 205021e
Notes: Run
make FCHQueue
--cache-remote
fails assertion with FIFO queueSHA: 51dd86e
Notes: Run with
make Benchmark EXTRAFLAGS='--cache-remote -sisFIFO=true'
thenbin/main.exe -nl 2 --nElements=1000
Output:
TIO
Recommended reading:
https://github.com/chapel-lang/chapel/blob/master/doc/rst/developer/bestPractices/TestSystem.rst
The whole document is important as you'll be developing correctness tests that can be used in Chapel's testing infrastructure. Sub-header "Futures" some way down in the document is particularly useful for reporting bugs: you create an issue and ideally create a PR adding a "future" to the test system to track down the issue in nightly testing)
The text was updated successfully, but these errors were encountered: