-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Including a separate ruby file with a proto definition that has a recursive field results in RuntimeError: can't modify frozen SystemStackError #425
Comments
Have you listed jet as a gem dependency of janus? |
Yes |
I actually tried both:
It's a core global state issue |
A few things:
I'll figure out what's going on. |
I'm 99% sure I'm just messing it up, but happy to give concrete reproduce On Tuesday, May 26, 2015, Chris Fallin notifications@github.com wrote:
|
Cool, if you could share your specific build steps and toplevel Ruby that's |
I just verified I can Something more subtle must be going on. Are you able to share the contents of your |
let me get something together and I'll send it on, it's probably me :) On Tuesday, May 26, 2015, Chris Fallin notifications@github.com wrote:
|
OK @cfallin I figured out what the issue is, and I put this together to reproduce: https://github.com/peter-edge/ruby-protobuf-bug If you have another file with a message that has a recursive field, it will error. Just clone that and type |
Thanks. @haberman will be handling the Ruby work from now on -- Josh, could you take a look? |
Thanks for the report! I was able to reproduce this error and reduce it to the following test case: #!/usr/bin/ruby
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "A" do
optional :a, :message, 1, "A"
end
end
Google::Protobuf::DescriptorPool.generated_pool.build do
end Running this program yields:
This is a stack overflow in upb. C backtrace is:
I'll work on a fix. |
Fixes this bug that came up in the Ruby extension: protocolbuffers/protobuf#425
Fixed in #530 |
Maybe I'm missing something.
janus.proto
importsjet.proto
.If I have two generated protos,
jet.rb
andjanus.rb
, in different packages:After importing
jet.rb
, if I then importjet.rb
, I will get:This actually seems correct, because what I think is happening is there is a global pool that is then finalized.
And then reference `JANUS_POOL instead:
Which is not generated code obviously...this doesn't work because the pools don't know about each other (is there a way to merge pools?)
This seems to be a big problem for anyone who has protos that import each other. Am I missing something?
The text was updated successfully, but these errors were encountered: