FLTK logo

[fltk/fltk] Segfault on Android (#143)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

[fltk/fltk] Segfault on Android (#143) Mohammed Alyousef Sep 22, 2020  
 

On Android x86 arch (haven't tried others), FLTK applications segfault during callbacks because of a strlen call on a null const char* path_.
https://github.com/fltk/fltk/blob/a4a5720658a46dde4e71b9c0991ecbbca567da86/src/Fl_Preferences.cxx#L1343

bt:

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
backtrace:
    #00 pc 0001e532  /system/lib/libc.so (strlen+18)
    #01 pc 002d9ba1  /lib/x86/libnative-lib.so (Fl_Preferences::Node::find(char const*)+33)
    #02 pc 002d7571  /lib/x86/libnative-lib.so (Fl_Preferences::Fl_Preferences(Fl_Preferences&, char const*)+97)
    #03 pc 002ab68a  /lib/x86/libnative-lib.so (Fl::option(Fl::Fl_Option)+122)
    #04 pc 002b313d  /lib/x86/libnative-lib.so (Fl_Button::handle(int)+109)

This can be triggered with:

int main(int argc, char **argv) {
    auto win = new Fl_Window(0, 30, 600, 800 - 30);
    auto but = new Fl_Button(10, 10, 160, 80, "Click");
    win->end();
    win->show();
    return Fl::run();
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.