[Gambas-user] segfault with gb.compress

gen braga genbraga1 at gmail.com
Tue Jul 9 18:32:37 CEST 2019


Hi there,

with code

Public Function Compress(sMsg As String) As String
  Dim zip As New Compress
  Dim sBuffer As String
  zip.Type = "zlib"

  sBuffer = zip.String(sMsg,, False)

  Return sBuffer
End

Public Function Uncomp(sMsg) As String
  Dim zip As New Uncompress
  Dim sBuffer As String

  zip.Type = "zlib"

  Try sBuffer = zip.String(sMsg)

  Return sBuffer
End

I pass an XML to Compress function and everything seems Ok. Sometimes
(not aways) when I send the compressed text to Uncomp I get an
SegFault at line:

Try sBuffer = zip.String(Mensagem)

Attached the backtrace.

Regards,

-
Gen
-------------- next part --------------
[System]
Gambas=3.13.90 d913a59 (master)
OperatingSystem=Linux
Kernel=4.4.0-154-generic
Architecture=x86_64
Distribution=Ubuntu 16.04.6 LTS
Desktop=UNITY
Theme=Gtk
Language=pt_BR.UTF-8
Memory=7896M

[Libraries]
Cairo=libcairo.so.2.11400.6
Curl=libcurl.so.4.4.0
DBus=libdbus-1.so.3.14.6
GStreamer=libgstreamer-1.0.so.0.803.0
GTK+2=libgtk-x11-2.0.so.0.2400.30
GTK+3=libgtk-3.so.0.1800.9
OpenGL=libGL.so.1.2.0
OpenGL=libGL.so.1.7.0
Poppler=libpoppler.so.58.0.0
QT4=libQtCore.so.4.8.7
QT5=libQt5Core.so.5.5.1
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6
-------------- next part --------------
Thread 1 "gbx3" received signal SIGSEGV, Segmentation fault.
0x0000000000407583 in my_malloc (len=<optimized out>)
    at ../share/gb_alloc_temp.h:351
351			if (_pool_count[pool])
(gdb) bt
#0  0x0000000000407583 in my_malloc (len=<optimized out>)
    at ../share/gb_alloc_temp.h:351
#1  0x00000000004076c8 in my_realloc (alloc=0x7fff2f693018, 
    new_len=<optimized out>) at ../share/gb_alloc_temp.h:477
#2  0x000000000042121f in GB_Realloc (addr=0x7fffffffce50, len=<optimized out>)
    at gbx_api.c:1951
#3  0x00007ffff0ff0349 in u_String (target=0x7fffffffce50, 
    lent=0x7fffffffce4c, 
    source=0x1f92390 "x\234]S[O\244\060\024~\367W \317\062\224V\030\331`\315\004g\243\211NTX\337\033\350ΐ\005\312\322bf\376\275\247\345\356\023\375n\347\364r\210\036\316Ui}\361V\026\242\276\267\275\r\262-^g\"/\352\343\275\375'\375\355\334\331\017\364*\272v\234]\323r\311k\305r\321ZI\272\377\070\354\034\264A\033\214\035\a\034\225<ZgY\374\252ŁU\\6,\343Iv\342\025{\021\031S\246:\227\377; 6g\231\333\326s\376*\241\005\331\332\364ʊ>a\aLP/r\207\225\005dr\221iQ\361\226\006\236\037ޑ\340\026\276\340\230h\355\331e\272vzi8E\221\273 at Z<tUڲ\354\237ԅg"..., len=315)
    at main.c:208
#4  0x00007ffff11f44d8 in CUNCOMPRESS_String (_object=<optimized out>, 
    _param=<optimized out>) at CUncompress.c:85
#5  0x0000000000446075 in EXEC_native_quick () at gbx_exec.c:1180
#6  0x000000000044719c in EXEC_native_check (defined=<optimized out>)
    at gbx_exec.c:1130
#7  0x0000000000440e2c in EXEC_loop () at gbx_exec_loop.c:1160
#8  0x00000000004457f5 in EXEC_function_loop () at gbx_exec.c:910



More information about the User mailing list