Segmentation fault in ld.lib.so when using gzread

Johannes Schlatow schlatow at ...238...
Thu Oct 30 20:01:05 CET 2014


Hey everyone,

I'm using some 3rd party code that depends on zlib. In particular, it
uses gzread() in order to read a file. Unfortunately, the
corresponding piece of code causes a segfault in ld.lib.so.

I narrowed this down to the following minimum example:

  gzFile gzfile_components = gzopen("test.txt", "rb");
  unsigned char buffer[1024*1024];
  gzread(gzfile_components, buffer, sizeof(buffer));

As you can see, the buffer is quite large but this the actual (and
reasonable) value used in the 3rd party code.
As soon as I reduce the size to e.g. 4096, the segfault is gone. 

The file I used has a size of 293 bytes. I'm using base-linux.
I also remember using this code successfully on a different computer
with an older version of Genode (14.03).

Any ideas/comments on this?




More information about the users mailing list