ruby-protobuf / protobuf

A pure ruby implementation of Google's Protocol Buffers
https://github.com/ruby-protobuf
MIT License
463 stars 101 forks source link

protobuf-2.7.3/bin/rprotoc:55: [BUG] Segmentation fault #67

Closed crowdmatt closed 11 years ago

crowdmatt commented 11 years ago

Running a simple command: rprotoc data/realtime-bidding.proto --ruby_out ./lib

I get this seg fault:

/Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/protobuf-2.7.3/bin/rprotoc:55: [BUG] Segmentation fault
ruby 1.9.3p155 (2012-03-03 revision 34878) [x86_64-darwin11.2.0]

-- Control frame information -----------------------------------------------
c:0008 p:---- s:0027 b:0027 l:000026 d:000026 CFUNC  :_rprotoc_extern
c:0007 p:0147 s:0022 b:0022 l:000021 d:000021 METHOD /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/protobuf-2.7.3/bin/rprotoc:55
c:0006 p:0307 s:0016 b:0016 l:000015 d:000015 TOP    /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/protobuf-2.7.3/bin/rprotoc:62
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :load
c:0003 p:0127 s:0007 b:0007 l:002618 d:0025d0 EVAL   /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/bin/rprotoc:19
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002618 d:002618 TOP   

-- Ruby level backtrace information ----------------------------------------
/Users/exampleuser/.rvm/gems/ruby-1.9.3-head/bin/rprotoc:19:in `
' /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/bin/rprotoc:19:in `load' /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/protobuf-2.7.3/bin/rprotoc:62:in `' /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/protobuf-2.7.3/bin/rprotoc:55:in `compile_proto' /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/protobuf-2.7.3/bin/rprotoc:55:in `_rprotoc_extern' -- C level backtrace information ------------------------------------------- See Crash Report log file under ~/Library/Logs/CrashReporter or /Library/Logs/CrashReporter, for the more detail of. -- Other runtime information ----------------------------------------------- * Loaded script: /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/bin/rprotoc * Loaded features: 0 enumerator.so 1 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/x86_64-darwin11.2.0/enc/encdb.bundle 2 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/x86_64-darwin11.2.0/enc/trans/transdb.bundle 3 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb 4 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/x86_64-darwin11.2.0/rbconfig.rb 5 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb 6 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/exceptions.rb 7 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb 8 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems.rb 9 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/version.rb 10 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb 11 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb 12 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/platform.rb 13 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb 14 /Users/exampleuser/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/path_support.rb 15 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi_c.bundle 16 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/platform.rb 17 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/types.rb 18 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/library.rb 19 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/errno.rb 20 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/pointer.rb 21 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/memorypointer.rb 22 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/struct_layout_builder.rb 23 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/struct.rb 24 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/union.rb 25 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/managedstruct.rb 26 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/callback.rb 27 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/io.rb 28 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/autopointer.rb 29 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/variadic.rb 30 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/enum.rb 31 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi/ffi.rb 32 /Users/exampleuser/.rvm/gems/ruby-1.9.3-head/gems/ffi-1.4.0/lib/ffi.rb [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html Abort trap: 6

The .proto file is supplied by Google:

// Copyright 2012 Google Inc. All Rights Reserved.

// This is the message that Google uses to request bids.  A single BidRequest
// includes all applicable ad slots from a single impression.
//
message BidRequest {
  // This is deprecated.  Please ignore.
  optional int32 DEPRECATED_protocol_version = 1;

  // Unique request id generated by Google.  This is 16 bytes long.
  required bytes id = 2;

  // This is deprecated.  Please use the CLICK_URL macro in the HTML snippet
  // instead.
  optional string DEPRECATED_click_tracking_url = 3;

  // -----------------------------------------------------------
  // This section lists information that we know about the user.

  // The first 3 bytes of the IP address in network byte order for IPv4, or the
  // first 6 bytes for IPv6.  Note that the number and position of the bytes
  // included from IPv6 addresses may change later.
  optional bytes ip = 4;

  // This is deprecated.  Please use google_user_id instead.
  optional uint64 DEPRECATED_cookie = 5;

  // This is deprecated.  Please use google_user_id instead.
  optional bytes DEPRECATED_hashed_cookie = 16;

  // The Google ID for the user as described in the documentation for the cookie
  // matching service.  This field is the unpadded web-safe base64 encoded
  // version of a binary cookie id. See the "Base 64 Encoding with URL and
  // Filename Safe Alphabet" section in RFC 3548 for encoding details.  This
  // field is the same as the Google ID returned by the cookie matching service.
  optional string google_user_id = 21;

  // The version number of the google_user_id.  We may sometimes change the
  // mapping from cookie to google_user_id.  In this case the version will be
  // incremented.
  optional uint32 cookie_version = 20;

  // The time in seconds since the google_user_id was created.
  optional int32 cookie_age_seconds = 31;

  // Match data stored for this google_user_id through the cookie matching
  // service.  If a match exists, then this field holds the decoded data that
  // was passed in the google_hm parameter.
  optional bytes hosted_match_data = 37;

  // A string that identifies the browser and type of device that sent the
  // request.
  optional string user_agent = 6;

  // These fields are deprecated. Please use the geo_criteria_id instead.
  optional string DEPRECATED_country = 7;
  optional string DEPRECATED_region = 8;
  optional string DEPRECATED_city = 9;
  optional int32 DEPRECATED_metro = 10;

  // Geo information.  These use a subset of the codes used in the AdWords API.
  // The documentation for the codes is at
  // https://developers.google.com/adwords/api/docs/appendix/geotargeting
  //
  // The geo_criteria_id field supercedes the legacy country, region, city, and
  // metro fields.
  optional int32 geo_criteria_id = 39;

  // Detected postal code of the appropriate type for the country (e.g. zip code
  // if the country is "US").  The postal_code_prefix field is set when accuracy
  // is too low to imply a full code, otherwise the postal_code field is set.
  optional string postal_code = 33;
  optional string postal_code_prefix = 34;

  // The offset of the user's time from GMT in minutes.  For example, GMT+10 is
  // timezone_offset = 600.
  optional int32 timezone_offset = 25;

  // List of detected user verticals.  Currently unused.
  repeated int32 user_vertical = 30 [packed=true];

  // Audience-targeting list to which the user has been added. See the Buyer UI
  // Help topics on remarketing, where it is called a remarketing list.
  message UserList {
    // The user list id.
    optional int64 id = 1;

    // The time in seconds since the user was added to the list.
    optional int32 age_seconds = 2;
  }
  repeated UserList user_list = 32;

  // -----------------------------------------------------------
  // This section lists information that we know about the web page or mobile
  // application where the impression originates.

  // This is deprecated. Please use seller_network_id instead.
  optional string DEPRECATED_seller_network = 22;

  // The seller network id.  See seller-network-ids.txt file in the technical
  // documentation for a list of ids.  This is only set if the site is not
  // anonymous and the publisher allows site targeting.
  optional int32 seller_network_id = 41;

  // The URL of the page with parameters removed.  This is only set if the site
  // is not anonymous and the publisher allows site targeting.  You can use
  // anonymous_id for targeting if the inventory is anonymous.  Otherwise, use
  // detected_vertical's.
  optional string url = 11;

  // An id for the domain of the page.  This is set when the inventory is
  // anonymous.
  optional string anonymous_id = 19;

  // The two-letter code for the language of the page.  The documentation for
  // the codes is at
  // https://developers.google.com/adwords/api/docs/appendix/languagecodes
  optional string detected_language = 12;

  // One or more detected verticals for the page as determined by Google.
  //
  message Vertical {
    // The vertical id.  See the publisher-verticals.txt file in the technical
    // documentation for a list of ids.
    required int32 id = 1;

    // Weight for this vertical, in the (0.0, 1.0] range.  More relevant
    // verticals have higher weights.
    required float weight = 2;
  }

  // Unordered list of detected content verticals.  See the
  // publisher-verticals.txt file in the technical documentation for a list of
  // ids.
  repeated Vertical detected_vertical = 13;

  // The dictionary version used in the detected_vertical field.  This is
  // currently always "2".
  optional int32 vertical_dictionary_version = 24;

  // List of detected content labels.  See content-labels.txt file in the
  // technical documentation for a list of ids.
  repeated int32 detected_content_label = 26 [packed=true];

  // Site lists that apply to this publisher.  See site-lists.txt in the
  // technical documentation for a list of ids.
  repeated int32 site_list_id = 36;

  // Additional key-value attributes.  Currently unused.
  message KeyValue {
    optional string key = 1;
    optional string value = 2;
  }
  repeated KeyValue key_value = 38;

  // Information for ad queries coming from mobile devices.  A mobile device is
  // either a smartphone or a tablet.  This is present for ad queries both from
  // mobile devices browsing the web and from mobile apps.
  //
  message Mobile {
    // This is deprecated.  Please use app_id instead.
    optional string DEPRECATED_app_name = 1;

    // This is deprecated.  Please do not use.
    optional string DEPRECATED_company_name = 2;

    // The platform of the mobile device.  Examples: android, iphone, palm
    optional string platform = 3;

    // The brand of the mobile device, e.g. Nokia, Samsung.
    optional string brand = 12;

    // The model of the mobile device, e.g. N70, Galaxy.
    optional string model = 13;

    // This message contains the OS version of the platform.  For instance, for
    // Android 2.1, os_version_major=2, os_version_minor=1, and os_version_micro
    // will remain unpopulated.  For iPhone 3.3.1, os_version_major=3,
    // os_version_minor=3, and os_version_micro=1.
    message DeviceOsVersion {
      optional int32 os_version_major = 1;
      optional int32 os_version_minor = 2;
      optional int32 os_version_micro = 3;
    }

    // The OS version; e.g. 2.1 for Android 2.1, or 3.3.1 for iOS 3.3.1.
    optional DeviceOsVersion os_version = 14;

    // The name of the mobile carrier when the mobile device is connected to the
    // internet via the carrier (as opposed to via WiFi).  Example: t-mobile
    optional string carrier_name = 4;

    // The country the mobile carrier operates in when the mobile device is
    // connected to the internet via the carrier (as opposed to via WiFi).
    // Example: jp
    optional string carrier_country = 5;

    // If true, then this request is from a mobile application. Will always be
    // true when app_id is set.  May also be true for anonymous inventory, in
    // which case anonymous_id will be set.
    optional bool is_app = 7 [default = false];

    // The identifier of the mobile app when this ad query comes from a mobile
    // app.  If the app was downloaded from the Apple iTunes app store, then
    // this is the app-store id.  For Android devices, this is the fully
    // qualified package name.  Examples: 343200656, com.rovio.angrybirds
    optional string app_id = 6;

    // The type of mobile device in which the ad will be shown.
    enum MobileDeviceType {
      UNKNOWN = 0;
      HIGHEND_PHONE = 1;
      TABLET = 2;
    }
    optional MobileDeviceType mobile_device_type = 8 [default = UNKNOWN];

    // The screen orientation of the device when the ad request is sent.
    enum ScreenOrientation {
      SCREEN_ORIENTATION_UNKNOWN = 0;
      SCREEN_ORIENTATION_PORTRAIT = 1;
      SCREEN_ORIENTATION_LANDSCAPE = 2;
    }
    optional int32 screen_orientation = 9 [default = 0];

    // If true, then this is a mobile full screen ad request.
    optional bool is_interstitial_request = 10 [default = false];

    // This field contains the IDs of categories to which the current mobile app
    // belongs.  This field will be empty if is_app is false.  The mapping
    // between mobile apps and categories is defined by the Google Play Store
    // for Android apps, or the Apple iTunes Store for iOS apps.  To look up
    // category name from category ID, please refer to
    // https://developers.google.com/adwords/api/docs/appendix/mobileappcategories
    repeated int32 app_category_ids = 11;
  }

  optional Mobile mobile = 28;

  // Information about the video if this is an in-video ad request.
  //
  message Video {
    // The time in milliseconds from the start of the video when the ad will be
    // displayed.  0 means pre-roll and -1 means post-roll.  The value is valid
    // only if this param is set.  When not set, the display position is
    // unknown.
    optional int32 videoad_start_delay = 1;

    // The maximum duration in milliseconds of the ad that you should return.
    // If this is not set or has value <= 0, any duration is allowed.
    optional int32 max_ad_duration = 2;

    // The minimum duration in milliseconds of the ad that you should return.
    // If this is not set or has value <= 0, there is no minimum duration.
    optional int32 min_ad_duration = 8;

    // The type of inventory from which request is sent.
    enum InventoryType {
      WEB_VIDEO = 0;
      GAMES = 1;
      MOBILE_INTERSTITIAL = 2;
    }

    optional int32 inventory_type = 3 [default = 0];

    // Does the publisher allow/require/block skippable video ads?  If this
    // field is not set, skippable ads are allowed.
    enum SkippableBidRequestType {
      ALLOW_SKIPPABLE = 0;
      REQUIRE_SKIPPABLE = 1;
      BLOCK_SKIPPABLE = 2;
    }
    optional SkippableBidRequestType video_ad_skippable = 4 [default =
        ALLOW_SKIPPABLE];

    // The maximum duration in milliseconds for the ad you should return, if
    // this ad is skippable (this generally differs from the maximum duration
    // allowed for non-skippable ads).  If this is not set or has value <= 0,
    // any duration is allowed.
    optional int32 skippable_max_ad_duration = 5;

    // The video technologies that are allowed for this request. The response
    // should support at least one of them.
    enum VideoFormat {
      VIDEO_FLASH = 0;
      VIDEO_HTML5 = 1;  // Valid HTML5 VAST ads contain both mp4 and webm media
                        // files in the first Ad/Creative VAST node.
    };
    repeated VideoFormat allowed_video_formats = 6;

    // Information about the companion ad slots that can be shown with the
    // video.  While this is a repeated field there will only be one value in
    // most cases.  If there are no companion ads available this field will not
    // be set.
    //
    message CompanionSlot {
      // These fields represent the available heights and widths in this slot.
      // There will always be the same number heights and widths fields.
      repeated int32 height = 1 [packed=true];
      repeated int32 width  = 2 [packed=true];

      // These are the formats of the creatives allowed in this companion ad slot.
      enum CreativeFormat {
        IMAGE_CREATIVE = 0;
        FLASH_CREATIVE = 1;
        HTML_CREATIVE  = 2;
      }
      repeated CreativeFormat creative_format = 3;
    }
    repeated CompanionSlot companion_slot = 7;
  }
  optional Video video = 29;

  // This is deprecated.  Please ignore.
  repeated string DEPRECATED_excluded_click_through_url = 18;

  // This is deprecated.  Please use the uint64 publisher_settings_list_id field
  // instead.
  optional bytes DEPRECATED_publisher_settings_list_id = 23;

  // The publisher settings list id that applies to this page.  See the
  // Targeting section of the RTB documentation for details.
  optional fixed64 publisher_settings_list_id = 42;

  // This is deprecated.  Please ignore.
  //
  message MatchingNetwork {
    // This is deprecated.  Please ignore.
    optional string DEPRECATED_network_id = 1;

    // This is deprecated.  Please ignore.
    optional string DEPRECATED_google_user_id = 2;
  }
  repeated MatchingNetwork DEPRECATED_matching_network = 27;

  // -----------------------------------------------------------
  // Information about the adslots on the page.
  //
  message AdSlot {

    // An arbitrarily assigned slot id that is unique on a given page and
    // usually starts counting from 1.  You use this to identify which slot to
    // bid on in the BidResponse.
    required int32 id = 1;

    // Unique identifier for this adslot's ad block for the page URL.
    optional uint64 ad_block_key = 14;

    // Set of channels of which this ad slot is a member.  A channel is a set of
    // ad slots on a site.  You can target a channel (like "the sports section",
    // or "all top banners") to get more fine-grained control over where your ad
    // shows.  Channel names are provided by the publisher.
    repeated string targetable_channel = 10;

    // The width and height in pixels of the allowed ad sizes.  Most requests
    // allow only a single size, but some allow more than one.  Widths and
    // heights must be at the same index.  For example, if the width values are
    // [728, 300, 468] and the height values are [90, 250, 60], then the allowed
    // formats are 728x90, 300x250, and 468x60.  Note that most requests that
    // allow more than one size are for video.  Those requests with more than
    // one size that are not video usually have excluded_attribute=21
    // (CreativeType:Html) which means that you cannot respond with a creative
    // that uses the html_snippet field in the BidResponse.
    repeated int32 width = 2;
    repeated int32 height = 3;

    // The disallowed attribute ids for the ads that can show in this slot. See
    // the creative-attributes.txt file in the technical documentation for a
    // list of ids.
    repeated int32 excluded_attribute = 4 [packed=true];

    // This is deprecated.  Please use excluded_attribute instead.
    repeated int32 DEPRECATED_allowed_attribute = 5;

    // The allowed vendor types.  See the vendors.txt file in the technical
    // documentation for a list of ids.  When the seller_network is GDN, the
    // vendor ids listed in gdn-vendors.txt in the supporting technical
    // documentation are also allowed.
    repeated int32 allowed_vendor_type = 6 [packed=true];

    // The disallowed sensitive ad categories.  See the
    // ad-sensitive-categories.txt file in the technical documentation for a
    // list of ids.  You should enforce these exclusions if you have the ability
    // to classify ads into the listed categories.
    repeated int32 excluded_sensitive_category = 7 [packed=true];

    // The disallowed ad product categories. See the ad-product-categories.txt
    // file in the technical documentation for a list of ids.  You should
    // enforce these exclusions if you have the ability to classify ads into the
    // listed categories.
    repeated int32 excluded_product_category = 13 [packed=true];

    // This is deprecated.  Please ignore.
    repeated string DEPRECATED_excluded_click_through_url = 8;

    // Information about the pre-targeting campaigns and adgroups that matched.
    //
    message MatchingAdData {
      // This is deprecated.  Please ignore.
      optional int64 DEPRECATED_campaign_id = 1;

      // The adgroup id of the matching ad.
      optional int64 adgroup_id = 2;

      // This is deprecated.  Please ignore.
      optional bool DEPRECATED_per_buyer_minimum_cpm = 3;

      // This is deprecated.  Please use fixed_cpm_micros within direct_deal
      // instead.
      optional int64 DEPRECATED_fixed_cpm_micros = 4;

      // The minimum CPM value that you can bid to not be filtered before the
      // auction.  This may be a global minimum, or it may be a minimum set by
      // the publisher.  The value is in micros of your account currency.
      optional int64 minimum_cpm_micros = 5;

      // Information about any direct deals you matched for this inventory.
      //
      message DirectDeal {
        // An id identifying the deal.
        optional int64 direct_deal_id = 1;

        // The fixed CPM deal that applies to your account for this adslot.  If
        // you choose to bid on this impression, then you must bid at least the
        // value of fixed_cpm_micros, and if you win, you will always be charged
        // fixed_cpm_micros.  The value is in micros of your account currency.
        // For example, if the fixed cpm is 1290000 (1.29 in your account
        // currency), then you need to bid at least this amount.  If you win,
        // you will be charged a CPM of 1.29 in your account currency.
        optional int64 fixed_cpm_micros = 2;
      }
      repeated DirectDeal direct_deal = 6;
    }
    repeated MatchingAdData matching_ad_data = 9;

    // This field is deprecated and should not be used.  Please use the uint64
    // publisher_settings_list_id field instead.
    repeated bytes DEPRECATED_publisher_settings_list_id = 11;

    // The publisher settings list ids that apply to this slot.  See the
    // Targeting section of the RTB documentation for details.
    optional fixed64 publisher_settings_list_id = 15;

    // Visibility information for the slot.
    enum SlotVisibility  {
      NO_DETECTION = 0;
      ABOVE_THE_FOLD = 1;
      BELOW_THE_FOLD = 2;
    }
    optional SlotVisibility slot_visibility = 12 [default = NO_DETECTION];
  }
  repeated AdSlot adslot = 14;

  // -----------------------------------------------------------
  // Testing flags.

  // If true, then this is a test request.  Results will not be displayed to
  // users and you will not be billed for a response even if it wins the
  // auction.  You should still do regular processing since the request may be
  // used to evaluate latencies or for other testing.
  optional bool is_test = 15 [default=false];

  // If true, then this request is intended to measure network latency.  Please
  // return an empty but parseable BidResponse (containing any required fields)
  // as quickly as possible without executing any bidding logic.
  optional bool is_ping = 17 [default=false];

  // If true, then this request is using an experimental deadline greater than
  // the normal 100ms.  We will sometimes send a small number of requests with
  // experimental_deadline=true to evaluate the effect of different deadlines on
  // spend.  Requests with experimental_deadline=true are for real impressions
  // and you should bid on them normally.  However, if you use internal timeouts
  // to abort processing when it is taking too long as a way of keeping your
  // error rate low, then you can disable these internal timeouts for requests
  // with experimental_deadline=true.  The effect on your error rate will be
  // limited since we will only set this on a small percentage of requests.
  // Paying attention to experimental_deadline is optional, but you may choose
  // to do so if you would benefit from higher deadlines and therefore wish to
  // help us accurately measure the effect of raising them.
  optional bool experimental_deadline = 35 [default=false];
}

// This is the message that you return in response to a BidRequest.  You may
// specify a list of ads.  For each ad, you should provide a list of ad slots on
// which the ad can run.  Ad slots are identifed by the ids included in the
// BidRequest.  Each ad can win at most one ad slot.  If you do not wish to bid,
// submit a response with no ads and with just processing_time_ms set.
//
message BidResponse {
  // This is deprecated.  Please do not set.
  optional int32 DEPRECATED_protocol_version = 1;

  // If your bid wins, specify a unique identifier for the creative to be
  // served. This became mandatory on April 1, 2012.
  // -- For a creative hosted on your servers, the unique identifier chosen by
  //    you goes in the buyer_creative_id field of the BidResponse. Each
  //    buyer_creative_id you return must always be associated with the same
  //    creative. The identifier string that you create is limited to 64 bytes.
  // -- For a creative hosted by Google, the unique identifier provided by
  //    Google goes in the creative_id field of the BidResponse.

  message Ad {
    // A buyer-specific identifier for the creative in this ad.  If set, this
    // field can be used to communicate approval statuses when issues are found.
    // Do not specify the same id for different creatives, or all creatives will
    // be disapproved if a problem with a single ad is found.  Do not specify
    // different ids for the same creative in different responses, or no
    // creatives will be served, since approval status is assigned on a per-id
    // basis.
    optional string buyer_creative_id = 10;

    // The HTML snippet that will display the ad when inserted in the web page.
    // Please use adslot.adgroup_id to indicate which adgroup this snippet is
    // attributed to.  The adgroup must be one of the adgroups for the slot sent
    // in the BidRequest.  Only one of the following should be set:
    // html_snippet, creative_id, video_url, snippet_template.  Only set this
    // field if the BidRequest is NOT for an in-video ad (BidRequest.video is
    // NOT present).
    optional string html_snippet = 1;

    // Id of a creative hosted by Google.  Please use adslot.adgroup_id to
    // indicate which adgroup this creative belongs to.  We will check that the
    // creative is part of the adgroup and the adgroup is one of the adgroups
    // for the slot sent in the BidRequest.  Only one of the following should be
    // set: html_snippet, creative_id, video_url, snippet_template.
    optional int64 creative_id = 8;

    // The URL to fetch a video ad.  The URL should return an XML response that
    // conforms to the VAST 2.0 standard.  Please use adslot.adgroup_id to
    // indicate which adgroup to attribute this ad to.  The adgroup must be one
    // of the adgroups for the slot sent in the BidRequest.  Only one of the
    // following should be set: html_snippet, creative_id, video_url,
    // snippet_template.  Only set this field if the BidRequest is for an
    // in-video ad (BidRequest.video is present).
    optional string video_url = 9;

    // An HTML snippet in the form of a template and multiple parameter values.
    // You should use a template and parameters if you render multiple creatives
    // in one slot.  The template should contain macro values of the form %%PX%%
    // where X is the position in the list of corresponding template_parameter
    // messages starting at 0.  Each template_parameter corresponds to one
    // creative in the slot.  For example, if the template is