Code Monkey home page Code Monkey logo

Comments (4)

KyleLin123456 avatar KyleLin123456 commented on August 16, 2024

Hi, I read your problem and would like to ask why you said the parameter of Malloc is more easily to overflow when nr_class is equal to 2? Is there a simple narrative to explain?
Also, in previous issue #88, did you actually encounter the scenario where you have model->nr_feature greater than 2^16-1 thus causes overflow? or is it just a potential scenario?

from liblinear.

cascades-sjtu avatar cascades-sjtu commented on August 16, 2024

Well, it seems a mistake in my expression. I was just want to say that nr_class=2 is more easily to cause an integer overflow than nr_class=1. Of course, nr_class can be a much higher value (than 2) and assigned to nr_w to cause an integer overflow much more easily, but I am not familiar with the restriction of the source of nr_class, so I didn't make that further statement.

yes, it is just a potential scenario reported by static analyzer, I tried to figure out how to actually trigger this bug but failed.

from liblinear.

KyleLin123456 avatar KyleLin123456 commented on August 16, 2024

Well, if you look closely at the if-else statement, nr_w is assigned to value 1 when nr_class is either equal to 1 or 2, so I think both cases have the same chance to occur overflow. Also, nr_class and nr_w are of type int, I assume overflowing in typical machine isn't a main concern, but if you really have a large set of data, @cjlin1 did mention a version that can handle larger set of data in #88. I guess this solution might solve your problem.

Same solution for #88

from liblinear.

cjlin1 avatar cjlin1 commented on August 16, 2024

At this moment we do not cover data with more than 2^32 features/labels. If you need to handle such large data, please use "LIBLINEAR for more than 2^32 instances/features (experimental)" at https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/#liblinear_for_more_than_2^32_instances_features_experimental

So we don't plan to do any change here. Thank you again for your comments.

from liblinear.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.