Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Seg Fault in dpl_dict_iterate() #209

Open
vrancurel opened this issue Nov 16, 2015 · 0 comments
Open

Seg Fault in dpl_dict_iterate() #209

vrancurel opened this issue Nov 16, 2015 · 0 comments

Comments

@vrancurel
Copy link
Contributor

To reproduce, create a bucket and an object in S3

// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');

/**
   Create a file for identification information in ~/.aws/credentials under 
   Mac/Linux or C:\Users\USERNAME\.aws\credentials under Windows

   [default]
   aws_access_key_id = your_access_key
   aws_secret_access_key = your_secret_key
 */

// Set your region for future requests.
//AWS.config.region = 'us-west-2';

// Create a bucket using bound parameters and put something in it.
// Make sure to change the bucket name from "my-bucket" to something unique.
var s3bucket = new AWS.S3({params: {Bucket: 'my-bucket'}});
s3bucket.createBucket(function() {
  var params = {Key: 'myKey', Body: 'Hello!'};
  s3bucket.upload(params, function(err, data) {
    if (err) {
      console.log("Error uploading data: ", err);
    } else {
      console.log("Successfully uploaded data to my-bucket/myKey");
    }
  });
});

Compile Droplet-sh, then with following droplet config file:

host = s3.amazonaws.com
access_key = your access key
secret_key = your secret key
aws_auth_sign_version = 4
aws_region = us-east-1

Then

$ gdb --args src/dplsh 
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from src/dplsh...done.
(gdb) r
Starting program: /home/vr/WorkTemp/Droplet-sh/src/dplsh 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
info: src/droplet.c:135: dpl_init: PRNG has been seeded with enough data
:/> set trace_buffers 0
:/> my-bucket:
my-bucket:/> ls
myKey
my-bucket:/> getattr myKey 

Program received signal SIGSEGV, Segmentation fault.
dpl_dict_iterate (dict=0x0, cb_func=cb_func@entry=0x7ffff796c900 <cb_var_print>, 
    cb_arg=cb_arg@entry=0x7fffffffa9a0) at src/dict.c:233
233   for (bucket = 0;bucket < dict->n_buckets;bucket++)
(gdb) where
#0  dpl_dict_iterate (dict=0x0, cb_func=cb_func@entry=0x7ffff796c900 <cb_var_print>, 
    cb_arg=cb_arg@entry=0x7fffffffa9a0) at src/dict.c:233
#1  0x00007ffff796cc3b in dpl_dict_print (dict=<optimized out>, f=<optimized out>, 
    level=level@entry=0) at src/dict.c:352
#2  0x000000000040386c in cmd_getattr (argc=<optimized out>, argv=<optimized out>)
    at cmd_getattr.c:103
#3  0x0000000000407200 in shell_parse (defs=defs@entry=0x60bf40 <cmd_defs>, 
    str=0x63609e "", str@entry=0x636090 "getattr myKey ", 
    errp=errp@entry=0x7fffffffcc9c) at shell.c:270
#4  0x000000000040736d in shell_do (defs=0x60bf40 <cmd_defs>) at shell.c:363
#5  0x0000000000402c67 in main (argc=<optimized out>, argv=<optimized out>)
    at dplsh.c:206
(gdb) 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant