Skip to content
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

StackOverflow on @sprintf("%a", big"42") #14409

Closed
mason-bially opened this issue Dec 15, 2015 · 23 comments
Closed

StackOverflow on @sprintf("%a", big"42") #14409

mason-bially opened this issue Dec 15, 2015 · 23 comments

Comments

@mason-bially
Copy link
Contributor

While writing coverage tests for printf I encountered this bug. Only %a combined with BigInts seem to be problematic.

@sprintf("%a", big"42")

It seems related to BigInts. I'm still new to Julia and am not quite sure how to go about fixing this error or I would do it myself. My coverage tests will include this case/issue commented out.

@ivarne ivarne added the good first issue Indicates a good issue for first-time contributors to Julia label Dec 15, 2015
@ivarne
Copy link
Member

ivarne commented Dec 15, 2015

Great to see that writing tests catches StackOverflows in Julia. What output would you expect?

It is not obvious to me how a Hexadecimal floating point representation of a BigInt would look like, except for just doing a potentially lossy conversion to an arbitrary FloatingPoint precicion. Generally we seem to prefer having the user explicitly ask for lossy conversions. Maybe a friendly exception is the right solution?

@ScottPJones
Copy link
Contributor

Even C/C++ compilers give warnings these days about mismatches between the *printf format string and the arguments.
I agree with @ivarne, a "friendly" exception would be the best way to handle this.

@simonbyrne
Copy link
Contributor

Here are 3 possible options:

  1. Throw an error (well, a more informative one than we do now).
  2. Convert to a BigFloat (other integers are also converted to float: the problem here is that the branch to handle BigFloats occurs before this conversion).
  3. Actually implement this properly (for all integer types).

Option 3 is a little bit tricky, but is actually well-defined (find the leading significant bit, and go from there). Whatever we do, we should make it consistent across all integer types.

@ivarne ivarne removed the good first issue Indicates a good issue for first-time contributors to Julia label Dec 15, 2015
@ivarne
Copy link
Member

ivarne commented Dec 15, 2015

With three options, it isn't an intro issue.

@ScottPJones
Copy link
Contributor

Would you set the precision temporarily of the BigFloat, to make sure it is large enough to hold the BigInt without loss, for option 2?

@simonbyrne
Copy link
Contributor

That's one option, but it should be possible to avoid doing that.

@mason-bially
Copy link
Contributor Author

I was actually sort of thinking about rewriting the printf library from mostly scratch. See #14331 . I created this issue because I thought it might be the BigInt code that was problematic. If it's the printf code I was sort of planning on replacing all of it anyway as part of getting up to speed on contributing to Julia.

@simonbyrne
Copy link
Contributor

That would be awesome! Do feel free to ping me if you have any questions, I'm more than happy to help with that.

@StefanKarpinski
Copy link
Member

I'm also more than happy to help.

@mason-bially
Copy link
Contributor Author

My goal would probably be by the end of the year. Thanks for the offers, I'll keep it in mind.

@StefanKarpinski
Copy link
Member

Ditto for early design and/or code review.

@simonbyrne
Copy link
Contributor

Actually, an even easier way to do this would be to print the hex integer ("%x"), prefixing with 0x and suffix with p0. The only problem would be moving the sign to before 0x.

@mason-bially
Copy link
Contributor Author

Unfortunately shortly after my last comment here, the Julia community demonstrated what I had hoped would not be true after reading this. So I put it on pause to think and finally decided not to make it something I contribute to regularly. I'll update my pull request #14410 but other than that I can't justify contributing to a project with a community having systemic problems.

@nalimilan
Copy link
Member

@mason-bially Could be more explicit about what happened which prompted you to stop contributing to Julia? That post by Dan Luu mentions many different issues, most of which are now solved, and has already generated a lot of heated discussions. If you want to be constructive, please explain your criticism in a detailed message rather than via short allusive comments in GitHub.

@mason-bially
Copy link
Contributor Author

It was the updates in the Dan Luu post that concerned me the most. The specific response is that the person in the Julia community who I most identified with, agreed with, and to whom I have a similar argumentative style was banned. There is no committee or larger community guidelines for recourse, and the decision appeared arbitrary (and for that matter made by a single person).

I think Julia is a great project, and I'll continue to use and evangelize it, but I cannot invest my time in a community where I could be so easily, arbitrarily banned with no recourse. Sorry to have wasted your time.

@simonbyrne
Copy link
Contributor

I'm not really sure what the story with Dan is (I'm not one for seeking out drama), but I have to say my personal experience with the community could not have been more different (I did however agree with many of his technical complaints at that point in time).

As to banning, I assure you that a decision of such magnitude is not taken lightly or unilaterally: it is only done after repeated warnings, and with wide consultation and agreement within the community. That said, as the community is growing, it perhaps is time to have some sort of community moderation committee, so that such matters could be handled more transparently in future (though we've been lucky so far that this has been exceedingly rare).

simonbyrne added a commit that referenced this issue Feb 16, 2016
Adds %a methods for printing integers, fixes #14409.
@mason-bially
Copy link
Contributor Author

I witnessed it a few days after planning on joining the community it appeared unilateral to me, and the target was a person whom I identified and agreed with on many things. I agree the technical part's of Dan's posts have been addressed it's his updates about the community that are the problem I am referencing.

It's put me off to a degree that I can no longer consider being part of the community. If it was a broader decision then you should communicate that, because the whole thing looked like a personal vendetta to me.

@mason-bially
Copy link
Contributor Author

I'm saying between the blog post and what I witnessed it paints a picture I don't want to participate in. The fact it only took 6 days for my primary lingering concern (this one) about my decision - to work with the Julia language every day - to be validated didn't help either. Multiple instances of smoke so close together (in my mind) implies fire to me.

Look at it from my perspective, research all criticism about a language to see if I want to commit, find one of the only in-depth outside-commentator posts mentions community problems, take it with a grain of salt, 6 days after immersing myself in the community (reviewing all github activity) I "personally" (over github) witness (what appears to be) arbitrary community banning; my grain of salt is not enough, my further research of public comment/commit histories paint what looks like a personal vendetta. I'm not in deep enough with the community to know what happened (maybe if it had been months instead of 6 days for example), I can only review the public content, and it doesn't paint a pretty picture. Sorry, but I can't undo that in my mind, I'm not going to invest my time for that sort of drama.

I didn't want to make a big deal out of it, I'm specifically not seeking drama either (that's my whole point), but on the other hand I didn't want to just disappear quietly and let the ball be dropped. Technically speaking Julia is exactly the language I want. And I want to help make it better. So maybe I'll check back in a few years when I work on my next project. But multiple instances implying an abusive community manifesting so quickly in my mind have put me off for now.

For reference these sections of the Dan Luu post:

this post was edited a bit to remove a sentence about how friendly the Julia community is since that no longer seemed appropriate in light of recent private and semi-private communications from one of the co-creators of Julia. They were, by far, the nastiest and most dishonest responses I’ve ever gotten to any blog post.

and

The same person who previously attacked me in private is now posting heavily edited and misleading excerpts in an attempt to discredits this post. I’m not going to post the full content in part because it’s extremely long, but mostly because it’s a gross violation of that community’s norms to post internal content publicly.

@nalimilan
Copy link
Member

@mason-bially Really, all the fuss Dan Luu makes about the Julia community on his blog appear as an exaggeration to me. It's really unfortunate that it's one of the first posts you find when reading about Julia. We don't have access to private the conversations he talks about. But you can confront what he says about public discussions being rude with the actual contents of the threads, which sound extremely constructive to me: https://groups.google.com/d/msg/julia-users/GyH8nhExY9I/SoSKxSv6HtYJ

It's too bad that you joined the party just 6 days before Scott's banishment from GitHub. But this happened only once in several years, so I'd say it's just a bad coincidence for you. Please judge the Julia community by your actual daily experience when working with people, not from what you can hear about it. I can assure you you won't be disappointed.

@KristofferC
Copy link
Member

6 days after immersing myself in the community (reviewing all github activity) I "personally" (over github) witness (what appears to be) arbitrary community banning.

Maybe you should realize that if you have been in a community for 6 days that you don't have the whole picture. This was something that developed over 6 months and the incredible patience and multiple attempts at cleanly handling the situation from the core Julia members s something that should be praised. Calling it a "personal vendetta" is completely false.

This seem to have given you a bad impression of the way the julia community is being handled while for me it is completely the opposite. I am glad that the community managers have the guts to make the hard decisions instead of just sitting by passively.

@timholy
Copy link
Member

timholy commented Feb 17, 2016

@mason-bially, if I had thought about contributing to something and then immediately saw "fire," as you so aptly put it, I too would be inclined to walk away. I can't blame you a bit, and would probably have done the same myself. Definitely Julia's loss, and I hope you find other projects that make you happy.

That said, I do hope you'll take away a balanced perspective. Bad stuff happens eventually in any project that involves so many people, and for a project that regularly attracts new contributors it's a statistical certainty that someone will happen to be walking in the front door just at the moment when it all hits the fan. You happened to be that unlucky someone. Too bad for us, and perhaps for you. But as the others have said, it was not the sudden and arbitrary decision that it might appear to be.

From nearly 4 years in this project, my own personal experience has been one of the most congenial collective enterprises I've ever experienced. Even as you walk away (for good reasons), I hope you have at least the willingness to consider the possibility that you happened to get unlucky, and that most contributors seem to have a very positive experience.

@mason-bially
Copy link
Contributor Author

Please judge the Julia community by your actual daily experience when working with people

I am, I had positive interactions with him on the gitter the day he was banned. He helped me though a problem, at the time he was the only person "in the community" whom I had had any live interaction with. Then I witness his banning "live". That was my daily interaction with the community that day.

I did read that response directly after reading the original Dan article. It confirmed my grain of salt at the time.

Maybe you should realize that if you have been in a community for 6 days that you don't have the whole picture. [...] Calling it a "personal vendetta" is completely false.

I do realize that, on the other hand it completely killed my enthusiasm and excitement for the project, before I could develop long term invested feelings for it.

That probably is false, but that's what it looked like when I went through the logs myself. The only person "in the community" I felt comfortable asking at the time was obviously biased. I drew my own conclusions.

Even as you walk away (for good reasons), I hope you have at least the willingness to consider the possibility that you happened to get unlucky, and that most contributors seem to have a very positive experience.

I'm not so sure. The thing is that if some one who helped me, who's arguments I tend to agree with, and has an argumentative style similar to my own gets banned for what looks like a supremely silly reason to me... maybe I am not someone you want in your community. And if that's the case I am not going to force it, I'm not going to invest my time when it seems like I'm just going to get a ban for it.

@mason-bially
Copy link
Contributor Author

On a note of actually fixing Julia 😅 the fix posted above doesn't seem to fix below.

@sprintf("%A",0x002a) # "0X1.5P+4"

simonbyrne added a commit that referenced this issue Feb 17, 2016
fixes `%A` formatting (#14409)
pkofod pushed a commit to pkofod/julia that referenced this issue Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants