This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bug in optimised strstr


I think there is bug in the current strstr implementation.  I initially
found this in the codesourcery distribution and have recently reproduced
it using newlib form CVS on both arm and x86 platforms.  Here is the
repro case:

    const char* s1 = "GL_OES_byte_coordinates GL_OES_compressed_paletted_texture GL_OES_fixed_point GL_OES_point_size_array GL_OES_point_sprite GL_OES_read_format GL_OES_single_precision GL_IMG_texture_compression_pvrtc GL_IMG_texture_env_enhanced_fixed_function GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_IMG_user_clip_planes GL_OES_matrix_get GL_IMG_vertex_program GL_EXT_multi_draw_arrays GL_OES_matrix_palette GL_OES_draw_texture ";
    const char* s2 = "GL_IMG_texture_compression_pvrtc";
    const char* res = strstr(s1, s2);  // crash in critical_factorization

This bug seems to have been in newlib for a long time.  It can be worked
around by compiling with -Os and thereby disabling the strstr
optimisations.

-- 
sam clegg
sam@ideaworks3d.com

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]