-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::bad_alloc issue with Ubuntu18.04 #10
Comments
I've had this same error before too. I assumed it was just something odd with my setup (I'm using RHEL7, which is not as well supported), but it appears not. The issue is with the regex commands. Specifically, it seems different OS's (or versions of an OS) implement the regex support differently. For example, I changed this line: https://github.com/patflick/miopen-benchmark/blob/master/miopen.hpp#L175 to use this:
(I also applied similar fixes elsewhere in miopen.hpp, but this seems to be the line you're having a problem with) Not sure if the same fix works for you? Hope this helps, |
Hi Matt, But, we are still seeing the issue with regex issue. It's doesn't help in Ubuntu18.04. Thanks, |
Just in case we're miscommunicating, the change I'm proposing for line 175 is small and based on your response it seems like you may have thought it was identical to what is already there. Currently it is:
I changed it to this:
(I just put parentheses around the Matt |
I did the same again as you said but still it's not working.
"\" is not coming after comment posted but I used "\" only. |
Yeah, the "" doesn't show up unless you use the code feature (put "`" around the code part). Sorry my fix didn't work for you. I will say that I played around with a bunch of the C++ regex options before settling on that. Perhaps one of the others will solve your problem? Also, when I was making those changes, I broke apart line 175 so I could run with gdb and figure out exactly what is failing. I suggest you do the same. EDIT: One last thing: did you use 1 or 2 backslashes in the above? I used 2, but it seems like you may have used one based on what you said. Hope this helps, |
My apologies for the late reply. Your stack trace points to something very odd. Somewhere in regex_match, it tries to allocate a std::vector of size 12297829382473034424. I can't reproduce and neither imagine why this would happen. Putting parenthesis around the Could you try to print out the |
Thanks Patflick. Sorry for delay response.
while ((entry = readdir(dir)) != NULL) {
std::string fname(entry->d_name);
if (fname != "." && fname != "..") {
`INFO(fname);`
if (std::regex_match(fname, match)) {
files.push_back(fname);
void init_sys_paths() {
bool found = false;
` for (std::string cardname : ls_dir("/sys/class/drm", std::regex("card(\\d+)"))) {`
std::string carddir = "/sys/class/drm/" + cardname;
std::string fname = carddir + "/device/uevent"; |
They seem to have changed the directory structure / folder naming scheme for the sysfs driver api. I still don't know why the regex would segfault, but the regex To check the folder structure, can you run Also, try changing the regex from |
Thanks.
for (std::string cardname : ls_dir("/sys/class/drm", std::regex("card\\d+).*."))) { if (fname != "." && fname != "..") {
INFO(fname);
if (std::regex_match(fname, match)) {
files.push_back(fname);
Did you guys tried anytime on Ubuntu18.04? |
Any more suggestion or is someone looking into it. |
Hi patflick , |
Hi @pramenku I could never reproduce your error. I just pushed a code change that might help, although I'm really just guessing. If this doesn't work, your best bet is to try to debug this yourself. Sorry |
Hi @pramenku . I merged the PR. Did you get a chance to try the potential fix? |
Sorry @patflick for delay. Really I was too much occupied with priority tasks. |
Hi @patflick |
Hi @pramenku, I think I understand your problem now. Unfortunately I don't know if there is a happy solution. To the best of my knowledge, ROCm does not yet support Ubuntu 18.04. I believe the specific problem you are encountering is that 18.04 has gcc/g++ 7.2 as the "default" gcc/g++, but ROCm needs gcc/g++ 5.4. Have you tried installing 5.4 locally and pointing to that instead? Matt |
Thanks @mattsinc. With ROCm release 1.9 , Ubuntu 18.04 is also supported. Please check https://github.com/RadeonOpenCompute/ROCm/blob/master/README.md. So, anyone is trying 18.04 on ROCm 1.9, they will see this issue. |
@pramenku, I did not realize that ROCm 1.9 had that support. If you use gcc 5.4 with ROCm 1.9 does it work? If so, I would guess the problem is a ROCm problem? Matt |
@mattsinc |
Hi @patflick and all It's about 2 months since last discuss, but I encountered the same issue with tip code. My env is ubuntu 16.04 + manually installed gcc-7.3.0. To narrow down, I write a very simple example:
name the above code in "main.cc", I did several test:
To be concrete, I can reproduce this regex issue on hipcc with -O3 flag. So, I'm curious if hipcc compiler have compatibility issue with gcc-7.3.0, or maybe @pramenku can help test on ubuntu 18.04 environment? below is my hipcc info (/opt/rocm/bin/hipcc --version)
|
Tried miopen-benchmark ubuntu18.04 to give a try.
Building of test went fine but while running the test , got "std::bad_alloc" issue.
Issue is coming from miopen-benchmark's header file when it tries to construct a directory path.
This may be relevant:
https://stackoverflow.com/questions/36106154/how-to-handle-or-avoid-exceptions-from-c11-regex-matching-functions-28-11
Thanks
The text was updated successfully, but these errors were encountered: